From: skv Date: Tue, 30 Aug 2016 13:53:57 +0000 (+0300) Subject: 0023326: [CEA 1934] Error when extracting a shape X-Git-Tag: V8_1_0rc1~5 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=b95d6c1ac8a4bfe0f412f50e549941bc8795022f;p=modules%2Fgeom.git 0023326: [CEA 1934] Error when extracting a shape --- diff --git a/src/GEOMImpl/GEOMImpl_ShapeDriver.cxx b/src/GEOMImpl/GEOMImpl_ShapeDriver.cxx index 436e2a927..b7947fdf7 100644 --- a/src/GEOMImpl/GEOMImpl_ShapeDriver.cxx +++ b/src/GEOMImpl/GEOMImpl_ShapeDriver.cxx @@ -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(); diff --git a/src/OperationGUI/OperationGUI_ExtractionDlg.cxx b/src/OperationGUI/OperationGUI_ExtractionDlg.cxx index 1e4c61142..0eee97dc7 100644 --- a/src/OperationGUI/OperationGUI_ExtractionDlg.cxx +++ b/src/OperationGUI/OperationGUI_ExtractionDlg.cxx @@ -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(); }