From: ouv Date: Mon, 28 Feb 2011 11:20:17 +0000 (+0000) Subject: Remove storing/restoring selection from dumpView() - this should be done at the highe... X-Git-Tag: DIAGRAM_1_0~24 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=e5b8d76f3ffc4271d8bfaf7468dc78a5a89b9766;p=modules%2Fgui.git Remove storing/restoring selection from dumpView() - this should be done at the higher level --- diff --git a/src/GraphicsView/GraphicsView_ViewPort.cxx b/src/GraphicsView/GraphicsView_ViewPort.cxx index 2258de9c2..daa1b7087 100644 --- a/src/GraphicsView/GraphicsView_ViewPort.cxx +++ b/src/GraphicsView/GraphicsView_ViewPort.cxx @@ -301,25 +301,12 @@ QImage GraphicsView_ViewPort::dumpView( bool theWholeScene ) if( aRect.isNull() ) return QImage(); - // store a list of selected objects - GraphicsView_ObjectList aSelectedObjects = mySelectedObjects; - - // unhighlight and unselect all objects - clearHighlighted(); - clearSelected(); - // render the scene to an image QImage anImage( aRect.toRect().size(), QImage::Format_RGB32 ); QPainter aPainter( &anImage ); QRectF aTargetRect( 0, 0, aRect.width(), aRect.height() ); myScene->render( &aPainter, aTargetRect, aRect ); - // restore selection - GraphicsView_ObjectListIterator aSelectedIter( aSelectedObjects ); - while( aSelectedIter.hasNext() ) - if( GraphicsView_Object* anObject = aSelectedIter.next() ) - setSelected( anObject ); - return anImage; } diff --git a/src/GraphicsView/GraphicsView_ViewPort.h b/src/GraphicsView/GraphicsView_ViewPort.h index 45a0ce15b..59b1f61bb 100644 --- a/src/GraphicsView/GraphicsView_ViewPort.h +++ b/src/GraphicsView/GraphicsView_ViewPort.h @@ -142,6 +142,9 @@ public: bool nextSelected(); GraphicsView_Object* selectedObject(); + const GraphicsView_ObjectList& getSelectedObjects() const { return mySelectedObjects; } + + // rectangle selection void startSelectByRect( int x, int y ); void drawSelectByRect( int x, int y );