router: pick similar starting shapes for the diff pairs, not the very nearest one

This commit is contained in:
Tomasz Wlostowski 2015-10-07 19:26:33 +02:00 committed by Maciej Suminski
parent 346b721156
commit b4fd9f3ed5
2 changed files with 18 additions and 1 deletions

View File

@ -540,7 +540,14 @@ bool PNS_DIFF_PAIR_PLACER::findDpPrimitivePair( const VECTOR2I& aP, PNS_ITEM* aI
double dist = ( *anchor - *refAnchor ).EuclideanNorm();
if( dist < bestDist )
bool shapeMatches = true;
if( item->OfKind( PNS_ITEM::SOLID ) && item->Layers() != aItem->Layers() )
{
shapeMatches = false;
}
if( dist < bestDist && shapeMatches )
{
found = true;
bestDist = dist;

View File

@ -111,6 +111,16 @@ public:
return PNS_LAYERSET( 0, 256 ); // fixme: use layer IDs header
}
bool operator==( const PNS_LAYERSET& aOther ) const
{
return ( m_start == aOther.m_start ) && ( m_end == aOther.m_end );
}
bool operator!=( const PNS_LAYERSET& aOther ) const
{
return ( m_start != aOther.m_start ) || ( m_end != aOther.m_end );
}
private:
int m_start;
int m_end;