Salome HOME
Fix for the issue #1928
[modules/shaper.git] / src / FeaturesPlugin / FeaturesPlugin_Rotation.cpp
index 1e0dd3c29a45ad8c5e1fd5deb3f20725b5a753ab..9ba830b83b603144021b4cbe62eee553cd8b3cc6 100755 (executable)
@@ -14,6 +14,8 @@
 #include <GeomAPI_Edge.h>
 #include <GeomAPI_Lin.h>
 
+#include <FeaturesPlugin_Tools.h>
+
 //=================================================================================================
 FeaturesPlugin_Rotation::FeaturesPlugin_Rotation()
 {
@@ -126,27 +128,11 @@ void FeaturesPlugin_Rotation::loadNamingDS(GeomAlgoAPI_Rotation& theRotaionAlgo,
   // Store result.
   theResultBody->storeModified(theBaseShape, theRotaionAlgo.shape());
 
-  std::shared_ptr<GeomAPI_DataMapOfShapeShape> aSubShapes = theRotaionAlgo.mapOfSubShapes();
-
   int aRotatedTag = 1;
   std::string aRotatedName = "Rotated";
+  std::shared_ptr<GeomAPI_DataMapOfShapeShape> aSubShapes = theRotaionAlgo.mapOfSubShapes();
 
-  switch(theBaseShape->shapeType()) {
-    case GeomAPI_Shape::COMPOUND:
-    case GeomAPI_Shape::COMPSOLID:
-    case GeomAPI_Shape::SOLID:
-    case GeomAPI_Shape::SHELL:
-      theResultBody->loadAndOrientModifiedShapes(&theRotaionAlgo,
-                                    theBaseShape, GeomAPI_Shape::FACE,
-                                    aRotatedTag, aRotatedName + "_Face", *aSubShapes.get());
-    case GeomAPI_Shape::FACE:
-    case GeomAPI_Shape::WIRE:
-      theResultBody->loadAndOrientModifiedShapes(&theRotaionAlgo,
-                                  theBaseShape, GeomAPI_Shape::EDGE,
-                                  ++aRotatedTag, aRotatedName + "_Edge", *aSubShapes.get());
-    case GeomAPI_Shape::EDGE:
-      theResultBody->loadAndOrientModifiedShapes(&theRotaionAlgo,
-                                theBaseShape, GeomAPI_Shape::VERTEX,
-                                ++aRotatedTag, aRotatedName + "_Vertex", *aSubShapes.get());
-  }
+  FeaturesPlugin_Tools::storeModifiedShapes(theRotaionAlgo, theResultBody,
+                                            theBaseShape, aRotatedTag, aRotatedName,
+                                            *aSubShapes.get());
 }