1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D -->
3 // File: FeaturesPlugin_Extrusion.h
4 // Created: 30 May 2014
5 // Author: Vitaly SMETANNIKOV
7 #ifndef FeaturesPlugin_Extrusion_H_
8 #define FeaturesPlugin_Extrusion_H_
10 #include <FeaturesPlugin.h>
11 #include <GeomAlgoAPI_Prism.h>
13 #include <FeaturesPlugin_CompositeSketch.h>
16 class ModelAPI_ResultBody;
18 /**\class FeaturesPlugin_Extrusion
20 * \brief Feature for creation of extrusion from the planar face.
22 * Extrusion creates the lateral faces based on edges of the base face and
23 * the top and bottom faces equal to the base face or this faces can be projection on the
24 * bounding planes if they were set. Direction of extrusion is taken from the face
25 * plane or if the bounding faces were set then it will be from the bottom to the top plane.
27 class FeaturesPlugin_Extrusion : public FeaturesPlugin_CompositeSketch
31 inline static const std::string& ID()
33 static const std::string MY_EXTRUSION_ID("Extrusion");
34 return MY_EXTRUSION_ID;
36 /// attribute name of references sketch entities list, it should contain a sketch result or
37 /// a pair a sketch result to sketch face
38 inline static const std::string& LIST_ID()
40 static const std::string MY_GROUP_LIST_ID("base");
41 return MY_GROUP_LIST_ID;
44 /// attribute name of an object to which the extrusion grows
45 inline static const std::string& AXIS_OBJECT_ID()
47 static const std::string MY_TO_OBJECT_ID("axis_object");
48 return MY_TO_OBJECT_ID;
51 /// attribute name for creation method
52 inline static const std::string& CREATION_METHOD()
54 static const std::string METHOD_ATTR("CreationMethod");
58 /// attribute name of extrusion size
59 inline static const std::string& TO_SIZE_ID()
61 static const std::string MY_TO_SIZE_ID("to_size");
65 /// attribute name of extrusion size
66 inline static const std::string& FROM_SIZE_ID()
68 static const std::string MY_FROM_SIZE_ID("from_size");
69 return MY_FROM_SIZE_ID;
72 /// attribute name of an object to which the extrusion grows
73 inline static const std::string& TO_OBJECT_ID()
75 static const std::string MY_TO_OBJECT_ID("to_object");
76 return MY_TO_OBJECT_ID;
79 /// attribute name of extrusion offset
80 inline static const std::string& TO_OFFSET_ID()
82 static const std::string MY_TO_OFFSET_ID("to_offset");
83 return MY_TO_OFFSET_ID;
86 /// attribute name of tool object
87 inline static const std::string& FROM_OBJECT_ID()
89 static const std::string MY_FROM_OBJECT_ID("from_object");
90 return MY_FROM_OBJECT_ID;
93 /// attribute name of extrusion offset
94 inline static const std::string& FROM_OFFSET_ID()
96 static const std::string MY_FROM_OFFSET_ID("from_offset");
97 return MY_FROM_OFFSET_ID;
100 /// Returns the kind of a feature
101 FEATURESPLUGIN_EXPORT virtual const std::string& getKind()
103 static std::string MY_KIND = FeaturesPlugin_Extrusion::ID();
107 /// Creates a new part document if needed
108 FEATURESPLUGIN_EXPORT virtual void execute();
110 /// Request for initialization of data model of the feature: adding all attributes
111 FEATURESPLUGIN_EXPORT virtual void initAttributes();
113 /// Use plugin manager for features creation
114 FeaturesPlugin_Extrusion();
117 /// Init attributes for extrusion.
118 virtual void initMakeSolidsAttributes() {};
120 /// Create solid from face with extrusion.
121 virtual void makeSolid(const std::shared_ptr<GeomAPI_Shape> theFace,
122 std::shared_ptr<GeomAlgoAPI_MakeShape>& theMakeShape) {};
125 /// Load Naming data structure of the feature to the document
126 void loadNamingDS(GeomAlgoAPI_Prism& thePrismAlgo,
127 std::shared_ptr<ModelAPI_ResultBody> theResultBody,
128 std::shared_ptr<GeomAPI_Shape> theBasis);
130 /// Set the sub-object to list of exturusion base.
131 void setSketchObjectToList();