router: fixed loop removal regression in shove mode

This commit is contained in:
Tomasz Wlostowski 2015-10-09 14:31:06 +02:00 committed by Maciej Suminski
parent 7d5cb75507
commit 3596ef2d4c
4 changed files with 13 additions and 11 deletions

View File

@ -84,9 +84,6 @@ public:
/// segments of the same net, on the same layer.
bool IsLineCorner() const
{
if( m_locked )
return false;
if( m_linkedItems.Size() != 2 || m_linkedItems.Count( SEGMENT ) != 2 )
return false;

View File

@ -737,7 +737,8 @@ void PNS_NODE::Remove( PNS_LINE& aLine )
void PNS_NODE::followLine( PNS_SEGMENT* aCurrent, bool aScanDirection, int& aPos,
int aLimit, VECTOR2I* aCorners, PNS_SEGMENT** aSegments, bool& aGuardHit )
int aLimit, VECTOR2I* aCorners, PNS_SEGMENT** aSegments, bool& aGuardHit,
bool aStopAtLockedJoints )
{
bool prevReversed = false;
@ -762,7 +763,9 @@ void PNS_NODE::followLine( PNS_SEGMENT* aCurrent, bool aScanDirection, int& aPos
break;
}
if( !jt->IsLineCorner() || aPos < 0 || aPos == aLimit )
bool locked = aStopAtLockedJoints ? jt->IsLocked() : false;
if( locked || !jt->IsLineCorner() || aPos < 0 || aPos == aLimit )
break;
aCurrent = jt->NextSegment( aCurrent );
@ -773,7 +776,7 @@ void PNS_NODE::followLine( PNS_SEGMENT* aCurrent, bool aScanDirection, int& aPos
}
const PNS_LINE PNS_NODE::AssembleLine( PNS_SEGMENT* aSeg, int* aOriginSegmentIndex )
const PNS_LINE PNS_NODE::AssembleLine( PNS_SEGMENT* aSeg, int* aOriginSegmentIndex, bool aStopAtLockedJoints )
{
const int MaxVerts = 1024 * 16;
@ -790,10 +793,10 @@ const PNS_LINE PNS_NODE::AssembleLine( PNS_SEGMENT* aSeg, int* aOriginSegmentInd
pl.SetNet( aSeg->Net() );
pl.SetOwner( this );
followLine( aSeg, false, i_start, MaxVerts, corners, segs, guardHit );
followLine( aSeg, false, i_start, MaxVerts, corners, segs, guardHit, aStopAtLockedJoints );
if( !guardHit )
followLine( aSeg, true, i_end, MaxVerts, corners, segs, guardHit );
followLine( aSeg, true, i_end, MaxVerts, corners, segs, guardHit, aStopAtLockedJoints );
int n = 0;

View File

@ -309,7 +309,8 @@ public:
* @param aOriginSegmentIndex index of aSeg in the resulting line
* @return the line
*/
const PNS_LINE AssembleLine( PNS_SEGMENT* aSeg, int* aOriginSegmentIndex = NULL );
const PNS_LINE AssembleLine( PNS_SEGMENT* aSeg, int* aOriginSegmentIndex = NULL,
bool aStopAtLockedJoints = false );
///> Prints the contents and joints structure
void Dump( bool aLong = false );
@ -446,7 +447,8 @@ private:
int aLimit,
VECTOR2I* aCorners,
PNS_SEGMENT** aSegments,
bool& aGuardHit );
bool& aGuardHit,
bool aStopAtLockedJoints );
///> hash table with the joints, linking the items. Joints are hashed by
///> their position, layer set and net.

View File

@ -95,7 +95,7 @@ PNS_SHOVE::~PNS_SHOVE()
PNS_LINE PNS_SHOVE::assembleLine( const PNS_SEGMENT* aSeg, int* aIndex )
{
return m_currentNode->AssembleLine( const_cast<PNS_SEGMENT*>( aSeg ), aIndex );
return m_currentNode->AssembleLine( const_cast<PNS_SEGMENT*>( aSeg ), aIndex, true );
}
// A dumb function that checks if the shoved line is shoved the right way, e.g.