Component dragger: make relaxed segment pickup work for PTH pads

This commit is contained in:
Jon Evans 2020-12-22 22:43:44 -05:00
parent 70c6314c67
commit 912657dd23
4 changed files with 16 additions and 17 deletions

View File

@ -91,9 +91,9 @@ bool COMPONENT_DRAGGER::Start( const VECTOR2I& aP, ITEM_SET& aPrimitives )
std::vector<JOINT*> extraJoints;
if( m_world->QueryJoints( solid->Hull().BBox(), extraJoints, solid->Layer(),
ITEM::SEGMENT_T | ITEM::ARC_T ) )
{
m_world->QueryJoints( solid->Hull().BBox(), extraJoints, solid->Layers(),
ITEM::SEGMENT_T | ITEM::ARC_T );
for( JOINT* extraJoint : extraJoints )
{
if( extraJoint->Net() == jt->Net() && extraJoint->LinkCount() == 1 )
@ -105,7 +105,6 @@ bool COMPONENT_DRAGGER::Start( const VECTOR2I& aP, ITEM_SET& aPrimitives )
}
}
}
}
return true;
}

View File

@ -1417,7 +1417,7 @@ ARC* NODE::findRedundantArc( ARC* aArc )
}
int NODE::QueryJoints( const BOX2I& aBox, std::vector<JOINT*>& aJoints, int aLayerMask,
int NODE::QueryJoints( const BOX2I& aBox, std::vector<JOINT*>& aJoints, LAYER_RANGE aLayerMask,
int aKindMask )
{
int n = 0;
@ -1426,7 +1426,7 @@ int NODE::QueryJoints( const BOX2I& aBox, std::vector<JOINT*>& aJoints, int aLay
for( JOINT_MAP::value_type& j : m_joints )
{
if( j.second.Layer() != aLayerMask )
if( !j.second.Layers().Overlaps( aLayerMask ) )
continue;
if( aBox.Contains( j.second.Pos() ) && j.second.LinkCount( aKindMask ) )
@ -1441,7 +1441,7 @@ int NODE::QueryJoints( const BOX2I& aBox, std::vector<JOINT*>& aJoints, int aLay
for( JOINT_MAP::value_type& j : m_root->m_joints )
{
if( !Overrides( &j.second ) && j.second.Layer() == aLayerMask )
if( !Overrides( &j.second ) && j.second.Layers().Overlaps( aLayerMask ) )
{
if( aBox.Contains( j.second.Pos() ) && j.second.LinkCount( aKindMask ) )
{

View File

@ -233,8 +233,8 @@ public:
int QueryJoints( const BOX2I& aBox,
std::vector<JOINT*>& aJoints,
int aLayerMask = -1,
int aKindMask = ITEM::ANY_T);
LAYER_RANGE aLayerMask = LAYER_RANGE::All(),
int aKindMask = ITEM::ANY_T );
int QueryColliding( const ITEM* aItem, OBSTACLE_VISITOR& aVisitor );

View File

@ -404,7 +404,7 @@ bool KEEP_TOPOLOGY_CONSTRAINT::Check( int aVertex1, int aVertex2, const LINE* aO
auto bb = encPoly.BBox();
std::vector<JOINT*> joints;
int cnt = m_world->QueryJoints( bb, joints, aOriginLine->Layers().Start(), ITEM::SOLID_T );
int cnt = m_world->QueryJoints( bb, joints, aOriginLine->Layers(), ITEM::SOLID_T );
if( !cnt )
return true;