router: DEBUG_DECORATOR now allows to name each primitive

This commit is contained in:
Tomasz Wlostowski 2020-01-06 14:47:31 +01:00
parent 33f9843fb7
commit 9e605d6958
2 changed files with 10 additions and 15 deletions

View File

@ -38,11 +38,11 @@ public:
virtual ~DEBUG_DECORATOR() virtual ~DEBUG_DECORATOR()
{} {}
virtual void AddPoint( VECTOR2I aP, int aColor ) {}; virtual void AddPoint( VECTOR2I aP, int aColor, const std::string aName = "" ) {};
virtual void AddLine( const SHAPE_LINE_CHAIN& aLine, int aType = 0, int aWidth = 0 ) {}; virtual void AddLine( const SHAPE_LINE_CHAIN& aLine, int aType = 0, int aWidth = 0, const std::string aName = "" ) {};
virtual void AddSegment( SEG aS, int aColor ) {}; virtual void AddSegment( SEG aS, int aColor, const std::string aName = "" ) {};
virtual void AddBox( BOX2I aB, int aColor ) {}; virtual void AddBox( BOX2I aB, int aColor, const std::string aName = "" ) {};
virtual void AddDirections( VECTOR2D aP, int aMask, int aColor ) {}; virtual void AddDirections( VECTOR2D aP, int aMask, int aColor, const std::string aName = "" ) {};
virtual void Clear() {}; virtual void Clear() {};
}; };

View File

@ -438,7 +438,7 @@ public:
m_view->Add( m_items ); m_view->Add( m_items );
} }
void AddPoint( VECTOR2I aP, int aColor ) override void AddPoint( VECTOR2I aP, int aColor, const std::string aName = "") override
{ {
SHAPE_LINE_CHAIN l; SHAPE_LINE_CHAIN l;
@ -454,7 +454,7 @@ public:
AddLine( l, aColor, 10000 ); AddLine( l, aColor, 10000 );
} }
void AddBox( BOX2I aB, int aColor ) override void AddBox( BOX2I aB, int aColor, const std::string aName = "" ) override
{ {
SHAPE_LINE_CHAIN l; SHAPE_LINE_CHAIN l;
@ -470,7 +470,7 @@ public:
AddLine( l, aColor, 10000 ); AddLine( l, aColor, 10000 );
} }
void AddSegment( SEG aS, int aColor ) override void AddSegment( SEG aS, int aColor, const std::string aName = "") override
{ {
SHAPE_LINE_CHAIN l; SHAPE_LINE_CHAIN l;
@ -480,7 +480,7 @@ public:
AddLine( l, aColor, 10000 ); AddLine( l, aColor, 10000 );
} }
void AddDirections( VECTOR2D aP, int aMask, int aColor ) override void AddDirections( VECTOR2D aP, int aMask, int aColor, const std::string aName = "") override
{ {
BOX2I b( aP - VECTOR2I( 10000, 10000 ), VECTOR2I( 20000, 20000 ) ); BOX2I b( aP - VECTOR2I( 10000, 10000 ), VECTOR2I( 20000, 20000 ) );
@ -495,7 +495,7 @@ public:
} }
} }
void AddLine( const SHAPE_LINE_CHAIN& aLine, int aType, int aWidth ) override void AddLine( const SHAPE_LINE_CHAIN& aLine, int aType, int aWidth, const std::string aName = "" ) override
{ {
ROUTER_PREVIEW_ITEM* pitem = new ROUTER_PREVIEW_ITEM( NULL, m_view ); ROUTER_PREVIEW_ITEM* pitem = new ROUTER_PREVIEW_ITEM( NULL, m_view );
@ -991,8 +991,6 @@ bool PNS_KICAD_IFACE_BASE::syncGraphicalItem( PNS::NODE* aWorld, DRAWSEGMENT* aI
{ {
std::vector<SHAPE_SEGMENT*> segs; std::vector<SHAPE_SEGMENT*> segs;
printf("SyncGI: %p\n", aItem );
if( aItem->GetLayer() != Edge_Cuts && !IsCopperLayer( aItem->GetLayer() ) ) if( aItem->GetLayer() != Edge_Cuts && !IsCopperLayer( aItem->GetLayer() ) )
return false; return false;
@ -1147,11 +1145,8 @@ void PNS_KICAD_IFACE_BASE::SyncWorld( PNS::NODE *aWorld )
{ {
int worstPadClearance = 0; int worstPadClearance = 0;
printf("->syncWorld\n");
if( !m_board ) if( !m_board )
{ {
printf("no board\n");
wxLogTrace( "PNS", "No board attached, aborting sync." ); wxLogTrace( "PNS", "No board attached, aborting sync." );
return; return;
} }