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 <ModelAPI_ResultBody.h>
13 #include <GeomAlgoAPI_Extrusion.h>
14 #include <GeomAPI_Shape.h>
16 /**\class FeaturesPlugin_Extrusion
18 * \brief Feature for creation of extrusion from the planar face.
20 * Extrusion creates the lateral faces based on edges of the base face and
21 * the top face equal to the base face. Direction of extrusion is taken from the face
22 * plane, but can be corrected by the "reverse" flag.
24 class FeaturesPlugin_Extrusion : public ModelAPI_Feature
28 inline static const std::string& ID()
30 static const std::string MY_EXTRUSION_ID("Extrusion");
31 return MY_EXTRUSION_ID;
33 /// attribute name of references sketch entities list, it should contain a sketch result or
34 /// a pair a sketch result to sketch face
35 inline static const std::string& LIST_ID()
37 static const std::string MY_GROUP_LIST_ID("base");
38 return MY_GROUP_LIST_ID;
41 /// attribute name of an object to which the extrusion grows
42 inline static const std::string& AXIS_OBJECT_ID()
44 static const std::string MY_TO_OBJECT_ID("axis_object");
45 return MY_TO_OBJECT_ID;
48 /// attribute name of extrusion size
49 inline static const std::string& TO_SIZE_ID()
51 static const std::string MY_TO_SIZE_ID("to_size");
55 /// attribute name of extrusion size
56 inline static const std::string& FROM_SIZE_ID()
58 static const std::string MY_FROM_SIZE_ID("from_size");
59 return MY_FROM_SIZE_ID;
62 /// attribute name of an object to which the extrusion grows
63 inline static const std::string& TO_OBJECT_ID()
65 static const std::string MY_TO_OBJECT_ID("to_object");
66 return MY_TO_OBJECT_ID;
69 /// attribute name of tool object
70 inline static const std::string& FROM_OBJECT_ID()
72 static const std::string MY_FROM_OBJECT_ID("from_object");
73 return MY_FROM_OBJECT_ID;
75 /// attribute name of reverse direction
76 inline static const std::string& REVERSE_ID()
78 static const std::string MY_REVERSE_ID("reverse");
82 /// Returns the kind of a feature
83 FEATURESPLUGIN_EXPORT virtual const std::string& getKind()
85 static std::string MY_KIND = FeaturesPlugin_Extrusion::ID();
89 /// Creates a new part document if needed
90 FEATURESPLUGIN_EXPORT virtual void execute();
92 /// Request for initialization of data model of the feature: adding all attributes
93 FEATURESPLUGIN_EXPORT virtual void initAttributes();
95 /// Use plugin manager for features creation
96 FeaturesPlugin_Extrusion();
98 /// Load Naming data structure of the feature to the document
99 void LoadNamingDS(GeomAlgoAPI_Extrusion& theFeature, std::shared_ptr<ModelAPI_ResultBody> theResultBody,
100 std::shared_ptr<GeomAPI_Shape> theBasis,
101 std::shared_ptr<GeomAPI_Shape> theContext);
103 /// Set an empty shape to the result of extrusion