From: ouv Date: Sat, 13 Nov 2010 13:41:54 +0000 (+0000) Subject: Visualization debug X-Git-Tag: DIAGRAM_0_1~25 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=82aa957cba47f5a2a3d22df300c52e272f5ec252;p=modules%2Fgui.git Visualization debug --- 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: