Corrected an issue with "bloat-all ... [dist]" in which an attempt

not to re-process processed tiles made an incorrect assumption,
causing tiles not to be re-processed when the clip area changed,
such that areas would be missed.  It is not clear that in its
corrected version, "bloat-all ... [dist]" is any more efficient
than the original implementation of an incremental series of bloat
+ AND.  At least the syntax in the tech file is much simplified.
This commit is contained in:
R. Timothy Edwards 2025-07-28 11:53:44 -04:00
parent 68e1c76f88
commit 1cc4d83425
2 changed files with 21 additions and 52 deletions

View File

@ -1 +1 @@
8.3.532
8.3.533

View File

@ -1282,8 +1282,13 @@ cifProcessSelectiveResetFunc(tile, clipArea)
* Find the first tile in the given area.
*
* Results:
* Return 1 to stop the search and process.
* Set clientData to the tile found.
* Return 1 to stop the search and process if an
* unprocessed tile was found. Otherwise, return
* 0 to keep the search going.
*
* Side effects:
* Push tile pointer to the stack that is passed
* as client data.
*
*-------------------------------------------------------
*/
@ -1293,8 +1298,13 @@ cifFoundFunc(
Tile *tile,
Stack **BloatStackPtr)
{
PUSHTILE(tile, *BloatStackPtr);
return 0;
if (TiGetClient(tile) == CIF_UNPROCESSED)
{
PUSHTILE(tile, *BloatStackPtr);
return 1;
}
else
return 0;
}
/* Data structure for bloat-all function */
@ -1425,33 +1435,11 @@ cifBloatAllFunc(
if (bloats->bl_distance[ttype] > 0)
(void) DBSrPaintArea((Tile *)NULL, *temps, &area,
&CIFSolidBits, cifFoundFunc, (ClientData)(&BloatStack));
/* Get clip area from intersection of found tile and t */
if (op->co_distance > 0)
{
if (!StackEmpty(BloatStack))
{
firstTile = (Tile *)StackLook(BloatStack);
TiToRect(firstTile, &foundArea);
GeoClip(&clipArea, &foundArea);
}
}
}
else
{
DBSrPaintArea((Tile *)NULL, def->cd_planes[bloats->bl_plane], &area,
connect, cifFoundFunc, (ClientData)(&BloatStack));
/* Get clip area from intersection of found tile and t */
if (op->co_distance > 0)
{
if (!StackEmpty(BloatStack))
{
firstTile = (Tile *)StackLook(BloatStack);
TiToRect(firstTile, &foundArea);
GeoClip(&clipArea, &foundArea);
}
}
}
}
else
@ -1490,10 +1478,12 @@ cifBloatAllFunc(
if (op->co_distance > 0)
{
if (!GEO_SURROUND(&clipArea, &area))
{
STACKPUSH(t, ResetStack);
}
/* Note: This is non-optimal, as it causes all tiles
* in the "bloat" group to be re-processed for each
* tile processed in the search group. However, it
* is difficult to find an optimal method.
*/
STACKPUSH(t, ResetStack);
GeoClip(&area, &clipArea);
if (GEO_RECTNULL(&area))
continue;
@ -1557,27 +1547,6 @@ cifBloatAllFunc(
TiSetClient(t, CIF_UNPROCESSED);
}
#if 0
if ((firstTile != NULL) && (op->co_distance > 0))
{
if (bloats->bl_plane < 0)
{
/* This would be a lot more efficient if the plane number of
* firstTile were pushed to the stack along with firstTile
*/
temps = bls->temps;
for (ttype = 0; ttype < TT_MAXTYPES; ttype++, temps++)
if (bloats->bl_distance[ttype] > 0)
(void) DBSrPaintArea((Tile *)NULL, *temps, &clipArea,
&CIFSolidBits, cifProcessSelectiveResetFunc,
&clipArea);
}
else
DBSrPaintArea((Tile *)firstTile, def->cd_planes[bloats->bl_plane],
&clipArea, connect, cifProcessSelectiveResetFunc, &clipArea);
}
#endif
return 0; /* Keep the search alive. . . */
}