]> SALOME platform Git repositories - modules/shaper.git/blobdiff - src/FeaturesPlugin/FeaturesPlugin_Placement.cpp
Salome HOME
Implementation of Partition movement using new result creation, with different data...
[modules/shaper.git] / src / FeaturesPlugin / FeaturesPlugin_Placement.cpp
index 69d3cc4a7240f893056b7c79e940ab474f7b5945..a52a2be08bfbc45a5d5953b4fa6e333963d1a647 100644 (file)
@@ -110,8 +110,6 @@ void FeaturesPlugin_Placement::execute()
   bool isReverse = boolean(REVERSE_ID())->value();
   bool isCentering = boolean(CENTERING_ID())->value();
 
-  bool isPart = aContextRes->groupName() == ModelAPI_ResultPart::group();
-
   // Getting transformation.
   GeomAlgoAPI_Placement aPlacementAlgo(
     aStartShape, anEndShape, aStartFace, anEndFace, isReverse, isCentering, true);
@@ -128,11 +126,11 @@ void FeaturesPlugin_Placement::execute()
   for(ListOfShape::iterator anObjectsIt = anObjects.begin(); anObjectsIt != anObjects.end();
       anObjectsIt++, aContext++) {
 
-    if (isPart) { // for part results just set transformation
-      ResultPartPtr anOrigin = std::dynamic_pointer_cast<ModelAPI_ResultPart>(aContextRes);
-      ResultPartPtr aResultPart = document()->copyPart(firstResult(), anOrigin);
+    if ((*aContext)->groupName() == ModelAPI_ResultPart::group()) { // for part results just set transformation
+      ResultPartPtr anOrigin = std::dynamic_pointer_cast<ModelAPI_ResultPart>(*aContext);
+      ResultPartPtr aResultPart = document()->copyPart(anOrigin, data(), aResultIndex);
       aResultPart->setTrsf(aContextRes, aTrsf);
-      setResult(aResultPart);
+      setResult(aResultPart, aResultIndex);
     } else {
       std::shared_ptr<GeomAPI_Shape> aBaseShape = *anObjectsIt;
       GeomAlgoAPI_Transform aTransformAlgo(aBaseShape, aTrsf);