-//============================================================================
-void FeaturesPlugin_Extrusion::LoadNamingDS(GeomAlgoAPI_Extrusion& theFeature,
- std::shared_ptr<ModelAPI_ResultBody> theResultBody,
- std::shared_ptr<GeomAPI_Shape> theBasis,
- std::shared_ptr<GeomAPI_Shape> theContext)
-{
-
-
- //load result
- if(theBasis->isEqual(theContext))
- theResultBody->store(theFeature.shape());
- else
- theResultBody->storeGenerated(theContext, theFeature.shape());
-
- GeomAPI_DataMapOfShapeShape* aSubShapes = new GeomAPI_DataMapOfShapeShape();
- theFeature.mapOfShapes(*aSubShapes);
-
- //Insert lateral face : Face from Edge
- std::string aLatName = "LateralFace";
- theResultBody->loadAndOrientGeneratedShapes(theFeature.makeShape(), theBasis, EDGE,_LATERAL_TAG, aLatName, *aSubShapes);
-
- //Insert bottom face
- std::string aBotName = "BottomFace";
- std::shared_ptr<GeomAPI_Shape> aBottomFace = theFeature.firstShape();
- if (!aBottomFace->isNull()) {
- if (aSubShapes->isBound(aBottomFace)) {
- aBottomFace = aSubShapes->find(aBottomFace);
- }
- theResultBody->generated(aBottomFace, aBotName, _FIRST_TAG);
+//=================================================================================================
+bool FeaturesPlugin_Extrusion::makeExtrusions(ListOfShape& theBaseShapes,
+ ListOfMakeShape& theMakeShapes)
+{
+ theMakeShapes.clear();
+
+ // Getting base shapes.
+ getBaseShapes(theBaseShapes);
+
+ //Getting direction.
+ std::shared_ptr<GeomAPI_Dir> aDir;
+ std::shared_ptr<GeomAPI_Edge> anEdge;
+ AttributeSelectionPtr aSelection = selection(DIRECTION_OBJECT_ID());
+ if(aSelection.get() && aSelection->value().get() && aSelection->value()->isEdge()) {
+ anEdge = std::shared_ptr<GeomAPI_Edge>(new GeomAPI_Edge(aSelection->value()));
+ } else if(aSelection->context().get() &&
+ aSelection->context()->shape().get() &&
+ aSelection->context()->shape()->isEdge()) {
+ anEdge = std::shared_ptr<GeomAPI_Edge>(new GeomAPI_Edge(aSelection->context()->shape()));
+ }
+ if(anEdge.get()) {
+ if(anEdge->isLine()) {
+ aDir = anEdge->line()->direction();
+ }
+ }
+
+ // Getting sizes.
+ double aToSize = 0.0;
+ double aFromSize = 0.0;
+
+ if(string(CREATION_METHOD())->value() == CREATION_METHOD_BY_SIZES()) {
+ aToSize = real(TO_SIZE_ID())->value();
+ aFromSize = real(FROM_SIZE_ID())->value();
+ } else {
+ aToSize = real(TO_OFFSET_ID())->value();
+ aFromSize = real(FROM_OFFSET_ID())->value();