// Author: Clarisse Genrault (CEA)
#include <FeaturesPlugin_MultiRotation.h>
+#include <FeaturesPlugin_Tools.h>
#include <GeomAlgoAPI_CompoundBuilder.h>
+#include <GeomAlgoAPI_MakeShapeList.h>
#include <GeomAlgoAPI_ShapeTools.h>
#include <GeomAlgoAPI_Tools.h>
#include <GeomAlgoAPI_Translation.h>
} else {
std::string anError;
ListOfShape aListOfShape;
- std::list<std::shared_ptr<GeomAlgoAPI_Rotation> > aListOfRotationAlgo;
+ std::shared_ptr<GeomAlgoAPI_MakeShapeList>
+ aListOfRotationAlgo(new GeomAlgoAPI_MakeShapeList);
for (int i=0; i<nbCopies; i++) {
std::shared_ptr<GeomAlgoAPI_Rotation> aRotationnAlgo(
break;
}
aListOfShape.push_back(aRotationnAlgo->shape());
- aListOfRotationAlgo.push_back(aRotationnAlgo);
+ aListOfRotationAlgo->appendAlgo(aRotationnAlgo);
}
std::shared_ptr<GeomAPI_Shape> aCompound =
GeomAlgoAPI_CompoundBuilder::compound(aListOfShape);
ResultBodyPtr aResultBody = document()->createBody(data(), aResultIndex);
- aResultBody->storeModified(aBaseShape, aCompound);
- loadNamingDS(aListOfRotationAlgo, aResultBody, aBaseShape);
+
+ ListOfShape aBaseShapes;
+ aBaseShapes.push_back(aBaseShape);
+ FeaturesPlugin_Tools::loadModifiedShapes(aResultBody, aBaseShapes, ListOfShape(),
+ aListOfRotationAlgo, aCompound, "Rotated");
setResult(aResultBody, aResultIndex);
}
}
}
#endif
-
-//=================================================================================================
-void FeaturesPlugin_MultiRotation::loadNamingDS(
- std::list<std::shared_ptr<GeomAlgoAPI_Rotation> > theListOfRotationAlgo,
- std::shared_ptr<ModelAPI_ResultBody> theResultBody,
- std::shared_ptr<GeomAPI_Shape> theBaseShape)
-{
- for (std::list<std::shared_ptr<GeomAlgoAPI_Rotation> >::const_iterator anIt =
- theListOfRotationAlgo.begin(); anIt != theListOfRotationAlgo.cend(); ++anIt) {
- // naming of faces
- theResultBody->loadModifiedShapes(*anIt, theBaseShape, GeomAPI_Shape::FACE, "Rotated_Face");
-
- // naming of edges
- theResultBody->loadModifiedShapes(*anIt, theBaseShape, GeomAPI_Shape::EDGE, "Rotated_Edge");
-
- // naming of vertex
- theResultBody->loadModifiedShapes(*anIt, theBaseShape, GeomAPI_Shape::VERTEX, "Rotated_Vertex");
- }
-}