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:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user