+
+//=================================================================================================
+void FeaturesPlugin_Extrusion::storeResultWithBoundaries(
+ const GeomShapePtr theBaseShape,
+ const ListOfShape& theBoundaryShapes,
+ const std::shared_ptr<GeomAlgoAPI_MakeShape> theMakeShape,
+ const int theIndex)
+{
+ // Create result body.
+ ResultBodyPtr aResultBody = document()->createBody(data(), theIndex);
+
+ // Store modified shapes.
+ FeaturesPlugin_Tools::loadModifiedShapes(aResultBody, theBoundaryShapes, ListOfShape(),
+ theMakeShape, theMakeShape->shape());
+
+ // Store generated edges/faces.
+ storeGenerationHistory(aResultBody, theBaseShape, theMakeShape);
+
+ setResult(aResultBody, theIndex);
+}
+
+//=================================================================================================
+void FeaturesPlugin_Extrusion::getDirection(std::shared_ptr<GeomAPI_Dir>& theDir)
+{
+ static const std::string aSelectionError = "Error: The direction shape selection is bad.";
+ AttributeSelectionPtr aSelection = selection(DIRECTION_OBJECT_ID());
+ GeomShapePtr aShape = aSelection->value();
+ if (!aShape.get()) {
+ if (aSelection->context().get()) {
+ aShape = aSelection->context()->shape();
+ }
+ }
+
+ GeomEdgePtr anEdge;
+ if (aShape.get()) {
+ if (aShape->isEdge())
+ {
+ anEdge = aShape->edge();
+ }
+ else if (aShape->isCompound())
+ {
+ GeomAPI_ShapeIterator anIt(aShape);
+ anEdge = anIt.current()->edge();
+ }
+ }
+
+ if (anEdge.get()) {
+ if (anEdge->isLine()) {
+ theDir = anEdge->line()->direction();
+ }
+ }
+}
+
+//=================================================================================================
+void FeaturesPlugin_Extrusion::getSizes(double& theToSize, double& theFromSize)
+{
+ if (string(CREATION_METHOD())->value() == CREATION_METHOD_BY_SIZES()) {
+ theToSize = real(TO_SIZE_ID())->value();
+ theFromSize = real(FROM_SIZE_ID())->value();
+ } if (string(CREATION_METHOD())->value() == CREATION_METHOD_BY_PLANES()) {
+ theToSize = real(TO_OFFSET_ID())->value();
+ theFromSize = real(FROM_OFFSET_ID())->value();
+ } else {
+ }
+}