diff --git a/pcbnew/router/pns_node.cpp b/pcbnew/router/pns_node.cpp index a2daae7bb8..9ef649b151 100644 --- a/pcbnew/router/pns_node.cpp +++ b/pcbnew/router/pns_node.cpp @@ -1390,6 +1390,46 @@ ARC* NODE::findRedundantArc( ARC* aArc ) } +int NODE::QueryJoints( const BOX2I& aBox, + std::vector& 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() ); diff --git a/pcbnew/router/pns_node.h b/pcbnew/router/pns_node.h index 7f5dd3cab3..e8572a1640 100644 --- a/pcbnew/router/pns_node.h +++ b/pcbnew/router/pns_node.h @@ -207,6 +207,8 @@ public: bool aDifferentNetsOnly = true, int aForceClearance = -1 ); + int QueryJoints( const BOX2I& aBox, std::vector & 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 {