]> SALOME platform Git repositories - modules/geom.git/commitdiff
Salome HOME
0023326: [CEA 1934] Error when extracting a shape
authorskv <skv@opencascade.com>
Tue, 30 Aug 2016 13:53:57 +0000 (16:53 +0300)
committerskv <skv@opencascade.com>
Tue, 30 Aug 2016 13:53:57 +0000 (16:53 +0300)
src/GEOMImpl/GEOMImpl_ShapeDriver.cxx
src/OperationGUI/OperationGUI_ExtractionDlg.cxx

index 436e2a9270168daf8f9529e246ba3f03cd398d9e..b7947fdf7d0ae0c24ec24efd923474dd6149834d 100644 (file)
@@ -1015,6 +1015,10 @@ Standard_Integer GEOMImpl_ShapeDriver::Execute(LOGBOOK& log) const
 
     aShape = anExtractor.GetResult();
 
+    if (aShape.IsNull()) {
+      Standard_ConstructionError::Raise("Result of extraction is empty");
+    }
+
     // Get statistics.
     const TopTools_ListOfShape       &aRemoved    = anExtractor.GetRemoved();
     const TopTools_ListOfShape       &aModified   = anExtractor.GetModified();
index 1e4c61142794317fdff3614414749cf64f7010d0..0eee97dc726021837ac8a2e8c2d317ec8c028651 100644 (file)
@@ -1298,12 +1298,18 @@ void OperationGUI_ExtractionDlg::eraseSubShape(const int theId)
 void OperationGUI_ExtractionDlg::eraseAll()
 {
   TColStd_MapIteratorOfMapOfInteger anIter(myMapDisplayedIDs);
+  TColStd_ListOfInteger             aDisplayedIDs;
 
   for (; anIter.More(); anIter.Next()) {
-    eraseSubShape(anIter.Key());
+    aDisplayedIDs.Append(anIter.Key());
+  }
+
+  TColStd_ListIteratorOfListOfInteger aListIter(aDisplayedIDs);
+
+  for (; aListIter.More(); aListIter.Next()) {
+    eraseSubShape(aListIter.Value());
   }
 
-  myMapDisplayedIDs.Clear();
   getDisplayer()->UpdateViewer();
 }