router: correctly assign owner via/pad to its hole when committing the world state

fixes #14852
This commit is contained in:
Tomasz Wlostowski 2023-06-08 11:54:32 +02:00
parent b57d77dd0b
commit ae8ea3b938
1 changed files with 28 additions and 3 deletions

View File

@ -476,8 +476,11 @@ const ITEM_SET NODE::HitTest( const VECTOR2I& aPoint ) const
void NODE::addSolid( SOLID* aSolid )
{
if( aSolid->HasHole() && aSolid->Hole()->BelongsTo( aSolid ) )
if( aSolid->HasHole() )
{
assert( aSolid->Hole()->BelongsTo( aSolid ) );
addHole( aSolid->Hole() );
}
if( aSolid->IsRoutable() )
linkJoint( aSolid->Pos(), aSolid->Layers(), aSolid->Net(), aSolid );
@ -496,8 +499,14 @@ void NODE::Add( std::unique_ptr< SOLID >&& aSolid )
void NODE::addVia( VIA* aVia )
{
if( aVia->HasHole() && aVia->Hole()->BelongsTo( aVia ) )
if( aVia->HasHole() )
{
if( ! aVia->Hole()->BelongsTo( aVia ) )
{
assert( false );
}
addHole( aVia->Hole() );
}
linkJoint( aVia->Pos(), aVia->Layers(), aVia->Net(), aVia );
aVia->SetOwner( this );
@ -705,7 +714,7 @@ void NODE::doRemove( ITEM* aItem )
if( hole )
{
m_index->Remove( hole ); // hole is not directly owned by NODE but by the parent SOLID/VIA.
hole->SetOwner( hole->ParentPadVia() );
hole->SetOwner( aItem );
}
}
}
@ -815,6 +824,11 @@ void NODE::Remove( VIA* aVia )
{
removeViaIndex( aVia );
doRemove( aVia );
if( !aVia->Owner() )
{
assert( aVia->Hole()->BelongsTo( aVia ) );
}
}
@ -845,7 +859,10 @@ void NODE::Remove( ITEM* aItem )
SOLID* solid = static_cast<SOLID*>( aItem );
if( solid->HasHole() )
{
Remove( solid->Hole() );
solid->Hole()->SetOwner( solid );
}
Remove( static_cast<SOLID*>( aItem ) );
break;
@ -870,7 +887,10 @@ void NODE::Remove( ITEM* aItem )
VIA* via = static_cast<VIA*>( aItem );
if( via->HasHole() )
{
Remove( via->Hole() );
via->Hole()->SetOwner( via );
}
Remove( static_cast<VIA*>( aItem ) );
break;
@ -1406,6 +1426,11 @@ void NODE::Commit( NODE* aNode )
for( ITEM* item : *aNode->m_index )
{
if( item->HasHole() )
{
item->Hole()->SetOwner( item );
}
item->SetRank( -1 );
item->Unmark();
add( item );