Salome HOME
updated copyright message
[modules/shaper.git] / src / FeaturesPlugin / FeaturesPlugin_RemoveSubShapes.cpp
index 0276c873d3b728352e8e64e236112f19ab811107..e1820d2afa961673a185874eccac57760313b208 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2019  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2023  CEA, EDF
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
@@ -100,7 +100,8 @@ void FeaturesPlugin_RemoveSubShapes::attributeChanged(const std::string& theID)
       }
 
       std::list<GeomShapePtr> aSubShapes = GeomAlgoAPI_ShapeTools::getLowLevelSubShapes(aBaseShape);
-      for (ListOfShape::const_iterator anIt = aSubShapes.cbegin(); anIt != aSubShapes.cend(); ++anIt)
+      ListOfShape::const_iterator anIt = aSubShapes.cbegin();
+      for (; anIt != aSubShapes.cend(); ++anIt)
       {
         GeomShapePtr aSubShape = *anIt;
         if(!isHasSubs) {
@@ -137,7 +138,8 @@ void FeaturesPlugin_RemoveSubShapes::attributeChanged(const std::string& theID)
       }
 
       std::list<GeomShapePtr> aSubShapes = GeomAlgoAPI_ShapeTools::getLowLevelSubShapes(aBaseShape);
-      for (ListOfShape::const_iterator anIt = aSubShapes.cbegin(); anIt != aSubShapes.cend(); ++anIt)
+      ListOfShape::const_iterator anIt = aSubShapes.cbegin();
+      for (; anIt != aSubShapes.cend(); ++anIt)
       {
         GeomShapePtr aSubShape = *anIt;
         if (aSubShapesToKeep.isBound(aSubShape))
@@ -178,7 +180,8 @@ void FeaturesPlugin_RemoveSubShapes::attributeChanged(const std::string& theID)
 
 
       std::list<GeomShapePtr> aSubShapes = GeomAlgoAPI_ShapeTools::getLowLevelSubShapes(aBaseShape);
-      for (ListOfShape::const_iterator anIt = aSubShapes.cbegin(); anIt != aSubShapes.cend(); ++anIt)
+      ListOfShape::const_iterator anIt = aSubShapes.cbegin();
+      for (; anIt != aSubShapes.cend(); ++anIt)
       {
         GeomShapePtr aSubShape = *anIt;
         if (aSubShapesToRemove.isBound(aSubShape))
@@ -287,7 +290,9 @@ void FeaturesPlugin_RemoveSubShapes::execute()
 
   // Store result.
   ResultBodyPtr aResultBody = document()->createBody(data());
-  aResultBody->storeModified(aBaseShape, aResultShape);
+  std::list<GeomShapePtr> anOldShapes;
+  anOldShapes.push_back(aBaseShape);
+  aResultBody->storeModified(anOldShapes, aResultShape, aMakeShapeList);
   for (std::set<GeomAPI_Shape::ShapeType>::iterator aTypeIter = aTypes.begin();
        aTypeIter != aTypes.end();
        ++aTypeIter)