mirror of
https://gitlab.com/kicad/code/kicad.git
synced 2025-09-14 10:13:19 +02:00
Remove double-layer-processing.
(The caller already handles cycling through the layers.)
This commit is contained in:
parent
1e0a08034f
commit
7fc9fc5f58
@ -462,7 +462,7 @@ static void intersectsBackCourtyardFunc( LIBEVAL::CONTEXT* aCtx, void* self )
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool collidesWithArea( BOARD_ITEM* aItem, PCBEXPR_CONTEXT* aCtx, ZONE* aArea )
|
bool collidesWithArea( BOARD_ITEM* aItem, PCB_LAYER_ID aLayer, PCBEXPR_CONTEXT* aCtx, ZONE* aArea )
|
||||||
{
|
{
|
||||||
BOARD* board = aArea->GetBoard();
|
BOARD* board = aArea->GetBoard();
|
||||||
BOX2I areaBBox = aArea->GetBoundingBox();
|
BOX2I areaBBox = aArea->GetBoundingBox();
|
||||||
@ -552,40 +552,18 @@ bool collidesWithArea( BOARD_ITEM* aItem, PCBEXPR_CONTEXT* aCtx, ZONE* aArea )
|
|||||||
|
|
||||||
if( zoneRTree )
|
if( zoneRTree )
|
||||||
{
|
{
|
||||||
for( PCB_LAYER_ID layer : aArea->GetLayerSet().Seq() )
|
if( zoneRTree->QueryColliding( areaBBox, &areaOutline, aLayer ) )
|
||||||
{
|
|
||||||
if( aCtx->GetLayer() == layer || aCtx->GetLayer() == UNDEFINED_LAYER )
|
|
||||||
{
|
|
||||||
if( zoneRTree->QueryColliding( areaBBox, &areaOutline, layer ) )
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
else if( aItem->Type() == PCB_PAD_T )
|
|
||||||
{
|
|
||||||
PAD* pad = static_cast<PAD*>( aItem );
|
|
||||||
bool collision = false;
|
|
||||||
|
|
||||||
pad->Padstack().ForEachUniqueLayer(
|
|
||||||
[&]( PCB_LAYER_ID layer )
|
|
||||||
{
|
|
||||||
if( !collision && aArea->IsOnLayer( layer ) )
|
|
||||||
collision = areaOutline.Collide( pad->GetEffectiveShape( layer ).get() );
|
|
||||||
} );
|
|
||||||
|
|
||||||
return collision;
|
|
||||||
}
|
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
PCB_LAYER_ID layer = aCtx->GetLayer();
|
if( !aArea->GetLayerSet().Contains( aLayer ) )
|
||||||
|
|
||||||
if( layer != UNDEFINED_LAYER && !( aArea->GetLayerSet().Contains( layer ) ) )
|
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
return areaOutline.Collide( aItem->GetEffectiveShape( layer ).get() );
|
return areaOutline.Collide( aItem->GetEffectiveShape( aLayer ).get() );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -761,7 +739,7 @@ static void intersectsAreaFunc( LIBEVAL::CONTEXT* aCtx, void* self )
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool collides = collidesWithArea( item, context, aArea );
|
bool collides = collidesWithArea( item, layer, context, aArea );
|
||||||
|
|
||||||
if( ( item->GetFlags() & ROUTER_TRANSIENT ) == 0 )
|
if( ( item->GetFlags() & ROUTER_TRANSIENT ) == 0 )
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user