7
mirror of https://gitlab.com/kicad/code/kicad.git synced 2025-04-07 18:45:32 +00:00

router: dump NODE overrides debug method

This commit is contained in:
Tomasz Wlostowski 2025-02-02 18:41:04 +01:00
parent 857d4f3803
commit 9f2eade5f5
2 changed files with 23 additions and 1 deletions

View File

@ -24,6 +24,7 @@
#include "pns_via.h"
#include "pns_router.h"
#include "pns_debug_decorator.h"
#include "pns_node.h"
#include <geometry/shape_arc.h>
#include <geometry/shape_segment.h>
@ -531,4 +532,21 @@ const SHAPE_LINE_CHAIN BuildHullForPrimitiveShape( const SHAPE* aShape, int aCle
}
void NodeStats( DEBUG_DECORATOR* dbg, wxString label, PNS::NODE *node )
{
NODE::ITEM_VECTOR added, removed;
node->GetUpdatedItems( removed, added );
PNS_DBG( dbg, BeginGroup, wxString::Format( "node:%s this=%p depth=%d added=%d removed=%d",
label, node, node->Depth(), (int)added.size(), (int) removed.size() ), 0 );
for( auto& item : added )
PNS_DBG( dbg, AddItem, item, BLUE, 10000, wxT("added-item") );
for( auto& item : removed )
PNS_DBG( dbg, AddItem, item, RED, 10000, wxString::Format("removed-item") );
PNS_DBGN( dbg, EndGroup );
}
}

View File

@ -35,7 +35,8 @@ constexpr int HULL_MARGIN = 10;
class ITEM;
class LINE;
class DEBUG_DECORATOR;
class NODE;
/** Various utility functions */
const SHAPE_LINE_CHAIN ArcHull( const SHAPE_ARC& aSeg, int aClearance, int aWalkaroundThickness );
@ -67,6 +68,9 @@ void HullIntersection( const SHAPE_LINE_CHAIN& hull, const SHAPE_LINE_CHAIN& lin
const SHAPE_LINE_CHAIN BuildHullForPrimitiveShape( const SHAPE* aShape, int aClearance,
int aWalkaroundThickness );
void NodeStats( DEBUG_DECORATOR* aDbg, wxString aLabel, NODE *aNode );
}
#endif // __PNS_UTILS_H