router: NODE now can also query joints

This commit is contained in:
Tomasz Wlostowski 2020-02-19 18:41:13 +01:00
parent 6b767d50c3
commit a6d3ae3c5b
2 changed files with 43 additions and 0 deletions

View File

@ -1390,6 +1390,46 @@ ARC* NODE::findRedundantArc( ARC* aArc )
}
int NODE::QueryJoints( const BOX2I& aBox,
std::vector<JOINT*>& aJoints,
int aLayerMask,
int aKindMask
)
{
int n = 0;
aJoints.clear();
for( auto j = m_joints.begin(); j != m_joints.end(); ++j )
{
if ( aBox.Contains(j->second.Pos()) && j->second.LinkCount ( aKindMask ) )
{
aJoints.push_back( &j->second );
n++;
}
}
if ( isRoot() )
return n;
for( auto j = m_root->m_joints.begin(); j != m_root->m_joints.end(); ++j )
{
if( ! Overrides( &j->second) )
{ if ( aBox.Contains(j->second.Pos()) && j->second.LinkCount ( aKindMask ) )
{
aJoints.push_back( &j->second );
n++;
}
}
}
return n;
}
ITEM *NODE::FindItemByParent( const BOARD_CONNECTED_ITEM* aParent )
{
INDEX::NET_ITEMS_LIST* l_cur = m_index->GetItemsForNet( aParent->GetNetCode() );

View File

@ -207,6 +207,8 @@ public:
bool aDifferentNetsOnly = true,
int aForceClearance = -1 );
int QueryJoints( const BOX2I& aBox, std::vector<JOINT*> & aJoints, int aLayerMask = -1, int aKindMask = ITEM::ANY_T);
int QueryColliding( const ITEM* aItem,
OBSTACLE_VISITOR& aVisitor
);
@ -464,6 +466,7 @@ private:
void unlinkParent();
void releaseChildren();
void releaseGarbage();
void rebuildJoint( JOINT* aJoint, ITEM* aItem );
bool isRoot() const
{