#include <GeomAPI_Edge.h>
#include <GeomAPI_Lin.h>
+#include <FeaturesPlugin_Tools.h>
+
//=================================================================================================
FeaturesPlugin_Rotation::FeaturesPlugin_Rotation()
{
// 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());
}