router: NODE::AllItemsInNet() can now filter by item type

This commit is contained in:
Tomasz Wlostowski 2020-09-05 01:10:26 +02:00
parent 70beca164f
commit 54ca66be72
2 changed files with 5 additions and 4 deletions

View File

@ -1295,14 +1295,15 @@ void NODE::KillChildren()
}
void NODE::AllItemsInNet( int aNet, std::set<ITEM*>& aItems )
void NODE::AllItemsInNet( int aNet, std::set<ITEM*>& aItems, int aKindMask)
{
INDEX::NET_ITEMS_LIST* l_cur = m_index->GetItemsForNet( aNet );
if( l_cur )
{
for( ITEM*item : *l_cur )
aItems.insert( item );
if( item->OfKind( aKindMask ) )
aItems.insert( item );
}
if( !isRoot() )
@ -1311,7 +1312,7 @@ void NODE::AllItemsInNet( int aNet, std::set<ITEM*>& aItems )
if( l_root )
for( INDEX::NET_ITEMS_LIST::iterator i = l_root->begin(); i!= l_root->end(); ++i )
if( !Overrides( *i ) )
if( !Overrides( *i ) && (*i)->OfKind( aKindMask ))
aItems.insert( *i );
}
}

View File

@ -410,7 +410,7 @@ public:
///> Destroys all child nodes. Applicable only to the root node.
void KillChildren();
void AllItemsInNet( int aNet, std::set<ITEM*>& aItems );
void AllItemsInNet( int aNet, std::set<ITEM*>& aItems, int aKindMask = -1 );
void ClearRanks( int aMarkerMask = MK_HEAD | MK_VIOLATION );