Salome HOME
new method clearItems() to clear the scene
authorasl <asl@opencascade.com>
Wed, 22 Nov 2017 12:27:05 +0000 (15:27 +0300)
committerasl <asl@opencascade.com>
Wed, 22 Nov 2017 12:27:05 +0000 (15:27 +0300)
src/GraphicsView/GraphicsView_ViewPort.cxx
src/GraphicsView/GraphicsView_ViewPort.h

index 1c4739bcfe1e7cceca65a5fdff98023b2930638e..627a30cddbc796f981fafd5eaa0260bc5e31f44e 100644 (file)
@@ -312,6 +312,15 @@ void GraphicsView_ViewPort::removeItem( QGraphicsItem* theItem )
   onBoundingRectChanged();
 }
 
+void GraphicsView_ViewPort::clearItems()
+{
+  myHighlightedObject = 0;
+  mySelectedObjects.clear();
+  myObjects.clear();
+  myScene->clear();
+  onBoundingRectChanged();
+}
+
 //================================================================
 // Function : getObjects
 // Purpose  : 
index f6b440bc09d4a2f9e73e0c3bf348a6f89e32e6cd..7617e347b73699fa2a3bc092b0dffe4b7aa9479f 100644 (file)
@@ -84,6 +84,7 @@ public:
   void                             addItem( QGraphicsItem* theItem );
   bool                             isItemAdded( QGraphicsItem* theItem );
   void                             removeItem( QGraphicsItem* theItem );
+  void                             clearItems();
 
   enum SortType { NoSorting, SelectedFirst, SortByZLevel };
   GraphicsView_ObjectList          getObjects( SortType theSortType = NoSorting ) const;