]> SALOME platform Git repositories - modules/shaper.git/blobdiff - src/FeaturesPlugin/FeaturesPlugin_Tools.cpp
Salome HOME
Merge remote-tracking branch 'remotes/origin/HigherLevelObjectsHistory'
[modules/shaper.git] / src / FeaturesPlugin / FeaturesPlugin_Tools.cpp
index b484349d08f2f8809b0fd83faf07b42639b9ce5e..ed96231b4387dc1307117285b224ef157b3e3f5d 100644 (file)
 
 //==================================================================================================
 void FeaturesPlugin_Tools::loadModifiedShapes(ResultBodyPtr theResultBody,
-                                              const GeomShapePtr theBaseShape,
+                                              const ListOfShape& theBaseShapes,
                                               const ListOfShape& theTools,
                                               const GeomMakeShapePtr& theMakeShape,
-                                              const GeomShapePtr theResultShape)
+                                              const GeomShapePtr theResultShape,
+                                              const std::string& theNamePrefix)
 {
-  if (theBaseShape->isEqual(theResultShape)) {
-    theResultBody->store(theResultShape, false);
-    return;
-  }
+  theResultBody->storeModified(theBaseShapes, theResultShape, theMakeShape);
 
-  theResultBody->storeModified(theBaseShape, theResultShape);
+  ListOfShape aShapes = theBaseShapes;
+  ListOfShape::const_iterator aToolIter = theTools.cbegin();
+  for(; aToolIter != theTools.cend(); aToolIter++)
+    aShapes.push_back(*aToolIter);
 
-  ListOfShape aShapes = theTools;
-  aShapes.push_front(theBaseShape);
+  std::string aVertexName, anEdgeName, aFaceName;
+  if (!theNamePrefix.empty()) {
+    aVertexName = theNamePrefix + "_Vertex";
+    anEdgeName = theNamePrefix + "_Edge";
+    aFaceName = theNamePrefix + "_Face";
+  }
 
   for (ListOfShape::const_iterator anIter = aShapes.begin(); anIter != aShapes.end(); ++anIter)
   {
-    theResultBody->loadModifiedShapes(theMakeShape, *anIter, GeomAPI_Shape::VERTEX);
-    theResultBody->loadModifiedShapes(theMakeShape, *anIter, GeomAPI_Shape::EDGE);
-    theResultBody->loadModifiedShapes(theMakeShape, *anIter, GeomAPI_Shape::FACE);
+    theResultBody->loadModifiedShapes(theMakeShape, *anIter, GeomAPI_Shape::VERTEX, aVertexName);
+    theResultBody->loadModifiedShapes(theMakeShape, *anIter, GeomAPI_Shape::EDGE, anEdgeName);
+    theResultBody->loadModifiedShapes(theMakeShape, *anIter, GeomAPI_Shape::FACE, aFaceName);
   }
 }
 
 //==================================================================================================
 void FeaturesPlugin_Tools::loadModifiedShapes(ResultBodyPtr theResultBody,
-                                              const GeomShapePtr theBaseShape,
+                                              const GeomShapePtr& theBaseShape,
                                               const GeomMakeShapePtr& theMakeShape,
                                               const std::string theName)
 {
@@ -97,7 +102,8 @@ void FeaturesPlugin_Tools::loadDeletedShapes(ResultBodyPtr theResultBody,
   const GeomShapePtr theResultShapesCompound)
 {
   ListOfShape aShapes = theTools;
-  aShapes.push_front(theBaseShape);
+  if (theBaseShape.get())
+    aShapes.push_front(theBaseShape);
 
   for (ListOfShape::const_iterator anIter = aShapes.begin(); anIter != aShapes.end(); anIter++)
   {