Salome HOME
Fix for the issue #2753 : error when dump/load script
[modules/shaper.git] / src / BuildPlugin / BuildPlugin_Solid.cpp
index 5a98995260263c28b974e5450ec122570b6e317a..dc0c57ed54d37afb59bca4fb74b1f75aadaa2f36 100644 (file)
@@ -51,7 +51,8 @@ void BuildPlugin_Solid::execute()
       aShape = aSelection->context()->shape();
     anOriginalShapes.push_back(aShape);
   }
-  std::shared_ptr<GeomAlgoAPI_MakeVolume> anAlgo(new GeomAlgoAPI_MakeVolume(anOriginalShapes));
+  std::shared_ptr<GeomAlgoAPI_MakeVolume> anAlgo(
+    new GeomAlgoAPI_MakeVolume(anOriginalShapes, false));
   // check and process result of volume maker
   GeomShapePtr aResShape = getSingleSubshape(anAlgo->shape());
   storeResult(anOriginalShapes, aResShape, anAlgo);
@@ -59,19 +60,18 @@ void BuildPlugin_Solid::execute()
 
 void BuildPlugin_Solid::storeResult(const ListOfShape& theOriginalShapes,
                                     const GeomShapePtr& theResultShape,
-                                    const std::shared_ptr<GeomAlgoAPI_MakeShape>& theAlgorithm)
+                                    const GeomMakeShapePtr& theAlgorithm)
 {
   ResultBodyPtr aResultBody = document()->createBody(data());
   aResultBody->store(theResultShape);
 
   // Store faces
-  std::shared_ptr<GeomAPI_DataMapOfShapeShape> aMapOfSubs = theAlgorithm->mapOfSubShapes();
-  int aModifiedTag = 1;
-  for(ListOfShape::const_iterator anIt = theOriginalShapes.cbegin();
-      anIt != theOriginalShapes.cend(); ++anIt) {
+  for (ListOfShape::const_iterator anIt = theOriginalShapes.cbegin();
+       anIt != theOriginalShapes.cend();
+       ++anIt)
+  {
     GeomShapePtr aShape = *anIt;
-    aResultBody->loadAndOrientModifiedShapes(theAlgorithm.get(), aShape, GeomAPI_Shape::FACE,
-        aModifiedTag, "Modified_Face", *aMapOfSubs.get(), false, true, true);
+    aResultBody->loadModifiedShapes(theAlgorithm, aShape, GeomAPI_Shape::FACE);
   }
   setResult(aResultBody);
 }