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 <ModelAPI_Feature.h>
12 #include <GeomAlgoAPI_Prism.h>
15 class ModelAPI_ResultBody;
17 /**\class FeaturesPlugin_Extrusion
19 * \brief Feature for creation of extrusion from the planar face.
21 * Extrusion creates the lateral faces based on edges of the base face and
22 * the top and bottom faces equal to the base face or this faces can be projection on the
23 * bounding planes if they were set. Direction of extrusion is taken from the face
24 * plane or if the bounding faces were set then it will be from the bottom to the top plane.
26 class FeaturesPlugin_Extrusion : public ModelAPI_Feature
30 inline static const std::string& ID()
32 static const std::string MY_EXTRUSION_ID("Extrusion");
33 return MY_EXTRUSION_ID;
35 /// attribute name of references sketch entities list, it should contain a sketch result or
36 /// a pair a sketch result to sketch face
37 inline static const std::string& LIST_ID()
39 static const std::string MY_GROUP_LIST_ID("base");
40 return MY_GROUP_LIST_ID;
43 /// attribute name of an object to which the extrusion grows
44 inline static const std::string& AXIS_OBJECT_ID()
46 static const std::string MY_TO_OBJECT_ID("axis_object");
47 return MY_TO_OBJECT_ID;
50 /// attribute name of extrusion size
51 inline static const std::string& TO_SIZE_ID()
53 static const std::string MY_TO_SIZE_ID("to_size");
57 /// attribute name of extrusion size
58 inline static const std::string& FROM_SIZE_ID()
60 static const std::string MY_FROM_SIZE_ID("from_size");
61 return MY_FROM_SIZE_ID;
64 /// attribute name of an object to which the extrusion grows
65 inline static const std::string& TO_OBJECT_ID()
67 static const std::string MY_TO_OBJECT_ID("to_object");
68 return MY_TO_OBJECT_ID;
71 /// attribute name of tool object
72 inline static const std::string& FROM_OBJECT_ID()
74 static const std::string MY_FROM_OBJECT_ID("from_object");
75 return MY_FROM_OBJECT_ID;
78 /// Returns the kind of a feature
79 FEATURESPLUGIN_EXPORT virtual const std::string& getKind()
81 static std::string MY_KIND = FeaturesPlugin_Extrusion::ID();
85 /// Creates a new part document if needed
86 FEATURESPLUGIN_EXPORT virtual void execute();
88 /// Request for initialization of data model of the feature: adding all attributes
89 FEATURESPLUGIN_EXPORT virtual void initAttributes();
91 /// Use plugin manager for features creation
92 FeaturesPlugin_Extrusion();
94 /// Load Naming data structure of the feature to the document
95 void LoadNamingDS(GeomAlgoAPI_Prism& theFeature, std::shared_ptr<ModelAPI_ResultBody> theResultBody,
96 std::shared_ptr<GeomAPI_Shape> theBasis,
97 std::shared_ptr<GeomAPI_Shape> theContext);