Implemented a change to differentiate between "sticky" labels and

labels that are not connected to their declared layers.  It's the
latter type that need additional processing in ExtSubtree.
Limiting this processing significantly cuts down on processing
time when there are many labels in a layout, as happens with the
"def read -labels" command option.
This commit is contained in:
Tim Edwards 2023-04-06 12:26:18 -04:00
parent 380b9245f3
commit 1d8fcca09b
3 changed files with 61 additions and 3 deletions

View File

@ -1 +1 @@
8.3.388
8.3.389

View File

@ -305,7 +305,6 @@ typedef struct label
#define PORT_VISITED 0x2000 /* Bit for checking if a port */
/* has been previously visited. */
#define LABEL_STICKY 0x4000 /* Label does not change layers */
#define LABEL_GENERATE 0x8000 /* Auto-generated label */

View File

@ -698,6 +698,26 @@ extSubtreeOutputCoupling(ha)
}
}
/*
* ----------------------------------------------------------------------------
*
* extFoundProc ---
*
* Simple callback function that returns 1 when a tile is found during a
* plane area search. Used to determine if a label has incompatible material
* inside the label area.
*
* ----------------------------------------------------------------------------
*/
int
extFoundProc(tile, clientData)
Tile *tile;
ClientData clientData;
{
return 1;
}
/*
* ----------------------------------------------------------------------------
*
@ -782,17 +802,56 @@ extSubtreeFunc(scx, ha)
// Copy any sticky labels to cumUse->cu_def, so that the labels
// can be found even when there is no geometry underneath in
// the parent cell.
//
// Update, 4/6/2023: Overuse of the sticky flag can make this
// ridiculously inefficient. The goal is to capture labels
// that don't have a layer underneath that is incompatible
// with the label type. Adding a simple search over the
// area of the label and the plane of the label layer. Only
// if the search finds nothing will the label be copied.
CellDef *cumDef = ha->ha_cumFlat.et_lookNames;
if (cumDef != NULL)
{
Rect r;
Label *lab, *newlab;
unsigned int n;
for (lab = cumDef->cd_labels; lab ; lab = lab->lab_next)
for (lab = cumDef->cd_labels; lab; lab = lab->lab_next)
{
if (!(lab->lab_flags & LABEL_STICKY)) continue;
r = lab->lab_rect;
GEOCLIP(&r, &ha->ha_interArea);
if (GEO_RECTNULL(&r)) continue;
if (r.r_xbot == r.r_xtop)
{
if (r.r_ybot == r.r_ytop)
{
/* Quick solution for point labels--use GOTOPOINT
* instead of an area search.
*/
Plane *plane = cumDef->cd_planes[DBPlane(lab->lab_type)];
Tile *tile = plane->pl_hint;
GOTOPOINT(tile, &r.r_ll);
if (TTMaskHasType(&DBConnectTbl[lab->lab_type], TiGetType(tile)))
continue;
}
r.r_xbot--;
r.r_xtop++;
}
if (r.r_ybot == r.r_ytop)
{
r.r_ybot--;
r.r_ytop++;
}
if (DBSrPaintArea((Tile *)NULL,
cumDef->cd_planes[DBPlane(lab->lab_type)],
&r, &DBNotConnectTbl[lab->lab_type],
extFoundProc, (ClientData)NULL) == 0)
continue;
n = sizeof (Label) + strlen(lab->lab_text)
- sizeof lab->lab_text + 1;