PNS: Re-add debugging of via dragging
This commit is contained in:
parent
6ebc2fca15
commit
79a6b0d129
|
@ -66,7 +66,7 @@ void SHOVE::replaceLine( LINE& aOld, LINE& aNew, bool aIncludeInChangedArea, NOD
|
||||||
if( changed_area )
|
if( changed_area )
|
||||||
{
|
{
|
||||||
SHAPE_RECT r( *changed_area );
|
SHAPE_RECT r( *changed_area );
|
||||||
PNS_DBG(Dbg(), AddShape, &r, BLUE, 0, wxT( "shove-changed-area" ) );
|
PNS_DBG( Dbg(), AddShape, &r, BLUE, 0, wxT( "shove-changed-area" ) );
|
||||||
|
|
||||||
m_affectedArea = m_affectedArea ? m_affectedArea->Merge( *changed_area )
|
m_affectedArea = m_affectedArea ? m_affectedArea->Merge( *changed_area )
|
||||||
: *changed_area;
|
: *changed_area;
|
||||||
|
@ -983,12 +983,12 @@ SHOVE::SHOVE_STATUS SHOVE::onCollidingVia( ITEM* aCurrent, VIA* aObstacleVia, OB
|
||||||
LINE* currentLine = (LINE*) aCurrent;
|
LINE* currentLine = (LINE*) aCurrent;
|
||||||
|
|
||||||
PNS_DBG( Dbg(), AddItem, currentLine, LIGHTRED, 10000, wxT( "current-line" ) );
|
PNS_DBG( Dbg(), AddItem, currentLine, LIGHTRED, 10000, wxT( "current-line" ) );
|
||||||
|
|
||||||
if( currentLine->EndsWithVia() )
|
if( currentLine->EndsWithVia() )
|
||||||
{
|
{
|
||||||
PNS_DBG( Dbg(), AddItem, ¤tLine->Via(), LIGHTRED, 10000, wxT( "current-line-via" ) );
|
PNS_DBG( Dbg(), AddItem, ¤tLine->Via(), LIGHTRED, 10000, wxT( "current-line-via" ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
PNS_DBG( Dbg(), AddItem, &vtmp, LIGHTRED, 100000, wxT( "orig-via" ) );
|
PNS_DBG( Dbg(), AddItem, &vtmp, LIGHTRED, 100000, wxT( "orig-via" ) );
|
||||||
|
|
||||||
lineCollision = vtmp.Shape()->Collide( currentLine->Shape(),
|
lineCollision = vtmp.Shape()->Collide( currentLine->Shape(),
|
||||||
|
@ -1019,7 +1019,7 @@ SHOVE::SHOVE_STATUS SHOVE::onCollidingVia( ITEM* aCurrent, VIA* aObstacleVia, OB
|
||||||
mtv = VECTOR2I(0, 0);
|
mtv = VECTOR2I(0, 0);
|
||||||
|
|
||||||
SHOVE::SHOVE_STATUS st = pushOrShoveVia( aObstacleVia, -mtv, aCurrent->Rank() );
|
SHOVE::SHOVE_STATUS st = pushOrShoveVia( aObstacleVia, -mtv, aCurrent->Rank() );
|
||||||
PNS_DBG(Dbg(), Message, wxString::Format("push-or-shove-via st %d", st ) );
|
PNS_DBG( Dbg(), Message, wxString::Format("push-or-shove-via st %d", st ) );
|
||||||
|
|
||||||
PNS_DBGN( Dbg(), EndGroup );
|
PNS_DBGN( Dbg(), EndGroup );
|
||||||
|
|
||||||
|
@ -1056,12 +1056,11 @@ SHOVE::SHOVE_STATUS SHOVE::onReverseCollidingVia( LINE& aCurrent, VIA* aObstacle
|
||||||
|
|
||||||
if( st != SH_OK )
|
if( st != SH_OK )
|
||||||
{
|
{
|
||||||
#if 0
|
PNS_DBG( Dbg(), BeginGroup, "on-reverse-via-fail-shove", m_iter );
|
||||||
m_logger.NewGroup( "on-reverse-via-fail-shove", m_iter );
|
PNS_DBG( Dbg(), AddItem, aObstacleVia, LIGHTRED, 100000, wxT( "the-via" ) );
|
||||||
m_logger.Log( aObstacleVia, 0, "the-via" );
|
PNS_DBG( Dbg(), AddItem, &aCurrent, LIGHTGREEN, 10000, wxT( "current-line" ) );
|
||||||
m_logger.Log( &aCurrent, 1, "current-line" );
|
PNS_DBG( Dbg(), AddItem, &shoved, LIGHTRED, 10000, wxT( "shoved-line" ) );
|
||||||
m_logger.Log( &shoved, 3, "shoved-line" );
|
PNS_DBGN( Dbg(), EndGroup );
|
||||||
#endif
|
|
||||||
|
|
||||||
return st;
|
return st;
|
||||||
}
|
}
|
||||||
|
@ -1073,11 +1072,10 @@ SHOVE::SHOVE_STATUS SHOVE::onReverseCollidingVia( LINE& aCurrent, VIA* aObstacle
|
||||||
|
|
||||||
if( !n )
|
if( !n )
|
||||||
{
|
{
|
||||||
#if 0
|
PNS_DBG( Dbg(), BeginGroup, "on-reverse-via-fail-lonevia", m_iter );
|
||||||
m_logger.NewGroup( "on-reverse-via-fail-lonevia", m_iter );
|
PNS_DBG( Dbg(), AddItem, aObstacleVia, LIGHTRED, 100000, wxT( "the-via" ) );
|
||||||
m_logger.Log( aObstacleVia, 0, "the-via" );
|
PNS_DBG( Dbg(), AddItem, &aCurrent, LIGHTGREEN, 10000, wxT( "current-line" ) );
|
||||||
m_logger.Log( &aCurrent, 1, "current-line" );
|
PNS_DBGN( Dbg(), EndGroup );
|
||||||
#endif
|
|
||||||
|
|
||||||
LINE head( aCurrent );
|
LINE head( aCurrent );
|
||||||
head.Line().Clear();
|
head.Line().Clear();
|
||||||
|
@ -1095,16 +1093,11 @@ SHOVE::SHOVE_STATUS SHOVE::onReverseCollidingVia( LINE& aCurrent, VIA* aObstacle
|
||||||
if( aCurrent.EndsWithVia() )
|
if( aCurrent.EndsWithVia() )
|
||||||
shoved.AppendVia( aCurrent.Via() );
|
shoved.AppendVia( aCurrent.Via() );
|
||||||
|
|
||||||
#if 0
|
PNS_DBG( Dbg(), BeginGroup, "on-reverse-via", m_iter );
|
||||||
m_logger.NewGroup( "on-reverse-via", m_iter );
|
|
||||||
m_logger.Log( aObstacleVia, 0, "the-via" );
|
|
||||||
m_logger.Log( &aCurrent, 1, "current-line" );
|
|
||||||
m_logger.Log( &shoved, 3, "shoved-line" );
|
|
||||||
#endif
|
|
||||||
|
|
||||||
PNS_DBG( Dbg(), AddItem, aObstacleVia, YELLOW, 0, wxT( "rr-the-via" ) );
|
PNS_DBG( Dbg(), AddItem, aObstacleVia, YELLOW, 0, wxT( "rr-the-via" ) );
|
||||||
PNS_DBG( Dbg(), AddItem, &aCurrent, BLUE, 0, wxT( "rr-current-line" ) );
|
PNS_DBG( Dbg(), AddItem, &aCurrent, BLUE, 0, wxT( "rr-current-line" ) );
|
||||||
PNS_DBG( Dbg(), AddItem, &shoved, GREEN, 0, wxT( "rr-shoved-line" ) );
|
PNS_DBG( Dbg(), AddItem, &shoved, GREEN, 0, wxT( "rr-shoved-line" ) );
|
||||||
|
PNS_DBGN( Dbg(), EndGroup );
|
||||||
|
|
||||||
int currentRank = aCurrent.Rank();
|
int currentRank = aCurrent.Rank();
|
||||||
replaceLine( aCurrent, shoved );
|
replaceLine( aCurrent, shoved );
|
||||||
|
@ -1323,7 +1316,7 @@ SHOVE::SHOVE_STATUS SHOVE::shoveIteration( int aIter )
|
||||||
nearest->m_item->Rank() ) );
|
nearest->m_item->Rank() ) );
|
||||||
|
|
||||||
PNS_DBG( Dbg(), AddShape, nearest->m_item->Shape(), YELLOW, 10000, wxT( "nearest" ) );
|
PNS_DBG( Dbg(), AddShape, nearest->m_item->Shape(), YELLOW, 10000, wxT( "nearest" ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
if( nearest )
|
if( nearest )
|
||||||
break;
|
break;
|
||||||
|
@ -1565,10 +1558,6 @@ SHOVE::SHOVE_STATUS SHOVE::ShoveLines( const LINE& aCurrentHead )
|
||||||
m_optimizerQueue.clear();
|
m_optimizerQueue.clear();
|
||||||
m_newHead = OPT_LINE();
|
m_newHead = OPT_LINE();
|
||||||
|
|
||||||
#if 0
|
|
||||||
m_logger.Clear();
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// Pop NODEs containing previous shoves which are no longer necessary
|
// Pop NODEs containing previous shoves which are no longer necessary
|
||||||
//
|
//
|
||||||
ITEM_SET headSet;
|
ITEM_SET headSet;
|
||||||
|
@ -1638,7 +1627,7 @@ SHOVE::SHOVE_STATUS SHOVE::ShoveLines( const LINE& aCurrentHead )
|
||||||
m_newHead = OPT_LINE();
|
m_newHead = OPT_LINE();
|
||||||
}
|
}
|
||||||
|
|
||||||
if(m_newHead)
|
if( m_newHead )
|
||||||
m_newHead->Unmark();
|
m_newHead->Unmark();
|
||||||
|
|
||||||
if( m_newHead && head.EndsWithVia() )
|
if( m_newHead && head.EndsWithVia() )
|
||||||
|
@ -1674,10 +1663,6 @@ SHOVE::SHOVE_STATUS SHOVE::ShoveMultiLines( const ITEM_SET& aHeadSet )
|
||||||
m_lineStack.clear();
|
m_lineStack.clear();
|
||||||
m_optimizerQueue.clear();
|
m_optimizerQueue.clear();
|
||||||
|
|
||||||
#if 0
|
|
||||||
m_logger.Clear();
|
|
||||||
#endif
|
|
||||||
|
|
||||||
VIA_HANDLE dummyVia;
|
VIA_HANDLE dummyVia;
|
||||||
|
|
||||||
NODE* parent = reduceSpringback( headSet, dummyVia );
|
NODE* parent = reduceSpringback( headSet, dummyVia );
|
||||||
|
|
Loading…
Reference in New Issue