From 89b6f4f92bc588976994c29d6d79b59a367b5eea Mon Sep 17 00:00:00 2001 From: Tim Edwards Date: Mon, 16 Dec 2024 21:52:11 -0500 Subject: [PATCH] Corrected an error with the bloat-all CIF operator in which bloat-all would fail to operate from the top layer of a contact type due to the use of DBplane(type) instead of counting all planes of the contact. --- VERSION | 2 +- cif/CIFgen.c | 14 +++++++++++--- database/DBtcontact.c | 18 ++++++++++++++++++ database/database.h.in | 3 ++- 4 files changed, 32 insertions(+), 5 deletions(-) diff --git a/VERSION b/VERSION index 8dfeebea..ab0a9437 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -8.3.506 +8.3.507 diff --git a/cif/CIFgen.c b/cif/CIFgen.c index bc234dc5..78a0c568 100644 --- a/cif/CIFgen.c +++ b/cif/CIFgen.c @@ -1327,9 +1327,17 @@ cifBloatAllFunc(tile, bls) } else { - int pNum = DBPlane(type); - pmask = (bloats->bl_plane < 0) ? 0 : - CoincidentPlanes(connect, PlaneNumToMaskBit(pNum)); + if (DBIsContact(type)) + { + pmask = (bloats->bl_plane < 0) ? 0 : + CoincidentPlanes(connect, DBLayerPlanes(type)); + } + else + { + int pNum = DBPlane(type); + pmask = (bloats->bl_plane < 0) ? 0 : + CoincidentPlanes(connect, PlaneNumToMaskBit(pNum)); + } if (pmask == 0) TiToRect(tile, &area); if (bloats->bl_plane < 0) { diff --git a/database/DBtcontact.c b/database/DBtcontact.c index 478dfd7d..3a6b1fb0 100644 --- a/database/DBtcontact.c +++ b/database/DBtcontact.c @@ -895,6 +895,24 @@ DBIsContact(type) return FALSE; } +/* + * ---------------------------------------------------------------------------- + * + * DBLayerPlanes -- + * + * Like LayerPlaneMask(), except as a subroutine, not a macro. For export + * to other routines. + * + * ---------------------------------------------------------------------------- + */ + +PlaneMask +DBLayerPlanes(type) + TileType type; +{ + return LayerPlaneMask(type); +} + /* * ---------------------------------------------------------------------------- * diff --git a/database/database.h.in b/database/database.h.in index 4e0bf5db..e0903415 100644 --- a/database/database.h.in +++ b/database/database.h.in @@ -829,7 +829,6 @@ extern void DBTechInitContact(); extern void DBTechFinalContact(); extern void DBTechFinalConnect(); extern void DBTechInitConnect(); -extern bool DBIsContact(); /* Cell symbol table */ extern void DBCellInit(); @@ -899,6 +898,8 @@ extern Plane *DBCellGenerateSimpleSubstrate(); extern TileType DBPlaneToResidue(); extern TileType DBTechFindStacking(); extern bool DBIsContact(); +extern PlaneMask DBLayerPlanes(); + extern TileTypeBitMask *DBResidueMask(); extern void DBFullResidueMask();