From 82aa957cba47f5a2a3d22df300c52e272f5ec252 Mon Sep 17 00:00:00 2001 From: ouv Date: Sat, 13 Nov 2010 13:41:54 +0000 Subject: [PATCH] Visualization debug --- src/GraphicsView/GraphicsView_ViewPort.cxx | 14 ++++++++++++++ src/GraphicsView/GraphicsView_ViewPort.h | 2 ++ 2 files changed, 16 insertions(+) diff --git a/src/GraphicsView/GraphicsView_ViewPort.cxx b/src/GraphicsView/GraphicsView_ViewPort.cxx index c76fe7f53..3dd2b6bec 100644 --- a/src/GraphicsView/GraphicsView_ViewPort.cxx +++ b/src/GraphicsView/GraphicsView_ViewPort.cxx @@ -184,6 +184,20 @@ void GraphicsView_ViewPort::removeItem( QGraphicsItem* theItem ) myScene->removeItem( theItem ); } +//================================================================ +// Function : getObjects +// Purpose : +//================================================================ +GraphicsView_ObjectList GraphicsView_ViewPort::getObjects() const +{ + GraphicsView_ObjectList aList; + QListIterator anIter( items() ); + while( anIter.hasNext() ) + if( GraphicsView_Object* anObject = dynamic_cast( anIter.next() ) ) + aList.append( anObject ); + return aList; +} + //================================================================ // Function : dumpView // Purpose : diff --git a/src/GraphicsView/GraphicsView_ViewPort.h b/src/GraphicsView/GraphicsView_ViewPort.h index 7cfe0ab35..a20583892 100644 --- a/src/GraphicsView/GraphicsView_ViewPort.h +++ b/src/GraphicsView/GraphicsView_ViewPort.h @@ -59,6 +59,8 @@ public: void addItem( QGraphicsItem* theItem ); void removeItem( QGraphicsItem* theItem ); + GraphicsView_ObjectList getObjects() const; + QImage dumpView( bool theWholeScene = false ); public: -- 2.39.2