More DRC performance work.

Push DRC zone RTrees into BOARD so that they can also be used by
insideArea.

All these caches are a bit of an encapsulation leak, but they make a
significant impact on performance.

Fixes https://gitlab.com/kicad/code/kicad/issues/7720
This commit is contained in:
Jeff Young
2021-02-27 11:45:04 +00:00
parent d8089ed54a
commit 4ede4e061e
6 changed files with 62 additions and 48 deletions
+5 -6
View File
@@ -347,16 +347,15 @@ static void insideArea( LIBEVAL::CONTEXT* aCtx, void* self )
if( item->Type() == PCB_ZONE_T || item->Type() == PCB_FP_ZONE_T )
{
ZONE* testZone = static_cast<ZONE*>( item );
ZONE* itemZone = static_cast<ZONE*>( item );
DRC_RTREE* itemRTree = board->m_CopperZoneRTrees[ itemZone ].get();
for( PCB_LAYER_ID layer : zone->GetLayerSet().Seq() )
{
if( testZone->IsOnLayer( layer ) )
if( itemRTree->QueryColliding( zone->GetCachedBoundingBox(), &zoneOutline,
layer, 0, nullptr, nullptr ) )
{
const SHAPE_POLY_SET& fill = testZone->GetFilledPolysList( layer );
if( zoneOutline.Collide( &fill ) )
return true;
return true;
}
}