Salome HOME
Fix for the issue #1755 : for now the sketch solver receives all modified entities...
[modules/shaper.git] / src / FeaturesPlugin / FeaturesPlugin_Translation.cpp
index e335277846986784435cb6a3cde322cc9736273e..9e616107b6ee22438313378a1e2d04e8de10932d 100644 (file)
@@ -85,7 +85,7 @@ void FeaturesPlugin_Translation::execute()
       ResultPartPtr anOrigin = std::dynamic_pointer_cast<ModelAPI_ResultPart>(*aContext);
       ResultPartPtr aResultPart = document()->copyPart(anOrigin, data(), aResultIndex);
       aResultPart->setTrsf(*aContext, aTrsf);
-      setResult(aResultPart);
+      setResult(aResultPart, aResultIndex);
     } else {
       GeomAlgoAPI_Translation aTranslationAlgo(aBaseShape, anAxis, aDistance);
 
@@ -128,8 +128,23 @@ void FeaturesPlugin_Translation::loadNamingDS(GeomAlgoAPI_Translation& theTransl
 
   int aTranslatedTag = 1;
   std::string aTranslatedName = "Translated";
-  theResultBody->loadAndOrientModifiedShapes(&theTranslationAlgo,
-                                             theBaseShape, GeomAPI_Shape::FACE,
-                                             aTranslatedTag, aTranslatedName, *aSubShapes.get());
 
+  switch(theBaseShape->shapeType()) {
+    case GeomAPI_Shape::COMPOUND:
+    case GeomAPI_Shape::COMPSOLID:
+    case GeomAPI_Shape::SOLID:
+    case GeomAPI_Shape::SHELL:
+      theResultBody->loadAndOrientModifiedShapes(&theTranslationAlgo,
+                                                 theBaseShape, GeomAPI_Shape::FACE,
+                                                 aTranslatedTag, aTranslatedName + "_Face", *aSubShapes.get());
+    case GeomAPI_Shape::FACE:
+    case GeomAPI_Shape::WIRE:
+      theResultBody->loadAndOrientModifiedShapes(&theTranslationAlgo,
+                                                 theBaseShape, GeomAPI_Shape::EDGE,
+                                                 ++aTranslatedTag, aTranslatedName + "_Edge", *aSubShapes.get());
+    case GeomAPI_Shape::EDGE:
+      theResultBody->loadAndOrientModifiedShapes(&theTranslationAlgo,
+                                                 theBaseShape, GeomAPI_Shape::VERTEX,
+                                                 ++aTranslatedTag, aTranslatedName + "_Vertex", *aSubShapes.get());
+  }
 }