diff options
| author | Tavmjong Bah <tavmjong@free.fr> | 2014-12-16 14:05:47 +0000 |
|---|---|---|
| committer | tavmjong-free <tavmjong@free.fr> | 2014-12-16 14:05:47 +0000 |
| commit | 0533bf991e946b09053753566f209940f500d368 (patch) | |
| tree | 2397d3e048ae8393126d928e0f163ee3638d722c /src/display/drawing-item.cpp | |
| parent | Read 'context-fill' and 'context-stroke' keywords. (diff) | |
| download | inkscape-0533bf991e946b09053753566f209940f500d368.tar.gz inkscape-0533bf991e946b09053753566f209940f500d368.zip | |
Debugging routines to print out XML, SP Object, and Display Item trees.
(bzr r13802)
Diffstat (limited to 'src/display/drawing-item.cpp')
| -rw-r--r-- | src/display/drawing-item.cpp | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/src/display/drawing-item.cpp b/src/display/drawing-item.cpp index 8ed74b550..8a438e1c2 100644 --- a/src/display/drawing-item.cpp +++ b/src/display/drawing-item.cpp @@ -908,6 +908,30 @@ DrawingItem::pick(Geom::Point const &p, double delta, unsigned flags) return NULL; } + +// For debugging: Print drawing tree structure. +void +DrawingItem::recursivePrintTree( unsigned level ) +{ + if (level == 0) { + std::cout << "Display Item Tree" << std::endl; + } + std::cout << "DI: "; + for (unsigned i = 0; i < level; ++i) { + std::cout << " "; + } + SPObject *object = static_cast<SPObject *>(_user_data); + if (object) { + std::cout << (object->getId()?object->getId():"No object id") << std::endl; + } else { + std::cout << "No associated object" << std::endl; + } + for (ChildrenList::iterator i = _children.begin(); i != _children.end(); ++i) { + i->recursivePrintTree( level+1 ); + } +} + + /** * Marks the current visual bounding box of the item for redrawing. * This is called whenever the object changes its visible appearance. |
