Salome HOME
updated copyright message
[modules/shaper.git] / src / FeaturesPlugin / FeaturesPlugin_MultiRotation.cpp
index 1fb43b872ddbf0d637044f839517126340c6ec0d..0b12af92515b52df4c5d843add44c873777011ee 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2017-2020  CEA/DEN, EDF R&D
+// Copyright (C) 2017-2023  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
@@ -25,7 +25,7 @@
 #include <FeaturesPlugin_Tools.h>
 
 #include <GeomAlgoAPI_CompoundBuilder.h>
-#include <GeomAlgoAPI_MakeShapeList.h>
+#include <GeomAlgoAPI_MakeShapeSet.h>
 #include <GeomAlgoAPI_ShapeTools.h>
 #include <GeomAlgoAPI_Tools.h>
 #include <GeomAlgoAPI_Translation.h>
@@ -44,6 +44,7 @@
 #include <ModelAPI_AttributeString.h>
 #include <ModelAPI_ResultBody.h>
 #include <ModelAPI_ResultPart.h>
+#include <ModelAPI_Tools.h>
 
 #include <math.h>
 #include <iostream>
@@ -166,8 +167,9 @@ void FeaturesPlugin_MultiRotation::performRotation1D()
 
   GeomAPI_ShapeHierarchy anObjects;
   std::list<ResultPtr> aParts;
-  if (!FeaturesPlugin_Tools::shapesFromSelectionList(
-       anObjectsSelList, isKeepSubShapes, anObjects, aParts))
+  ResultPtr aTextureSource;
+  if (!FeaturesPlugin_Tools::shapesFromSelectionList
+      (anObjectsSelList, isKeepSubShapes, anObjects, aParts, aTextureSource))
     return;
 
   // Parameters of rotation.
@@ -193,7 +195,7 @@ void FeaturesPlugin_MultiRotation::performRotation1D()
   }
 
   // Collect transformations for each object in a part.
-  std::shared_ptr<GeomAlgoAPI_MakeShapeList> aMakeShapeList(new GeomAlgoAPI_MakeShapeList);
+  std::shared_ptr<GeomAlgoAPI_MakeShapeSet> aMakeShapeList(new GeomAlgoAPI_MakeShapeSet);
   for (GeomAPI_ShapeHierarchy::iterator anObjectsIt = anObjects.begin();
        anObjectsIt != anObjects.end(); anObjectsIt++) {
     std::shared_ptr<GeomAPI_Shape> aBaseShape = *anObjectsIt;
@@ -222,8 +224,10 @@ void FeaturesPlugin_MultiRotation::performRotation1D()
   anObjects.topLevelObjects(aTopLevel);
   for (ListOfShape::iterator anIt = aTopLevel.begin(); anIt != aTopLevel.end(); ++anIt) {
     ResultBodyPtr aResultBody = document()->createBody(data(), aResultIndex);
-    FeaturesPlugin_Tools::loadModifiedShapes(aResultBody, anOriginalShapes, ListOfShape(),
-                                             aMakeShapeList, *anIt, "Rotated");
+    ModelAPI_Tools::loadModifiedShapes(aResultBody, anOriginalShapes, ListOfShape(),
+                                       aMakeShapeList, *anIt, "Rotated");
+    // Copy image data, if any
+    ModelAPI_Tools::copyImageAttribute(aTextureSource, aResultBody);
     setResult(aResultBody, aResultIndex++);
   }