Salome HOME
Merge branch 'master' of newgeom:newgeom
[modules/shaper.git] / src / FeaturesPlugin / FeaturesPlugin_Extrusion.h
1 // File:        FeaturesPlugin_Extrusion.h
2 // Created:     30 May 2014
3 // Author:      Vitaly SMETANNIKOV
4
5 #ifndef FeaturesPlugin_Extrusion_H_
6 #define FeaturesPlugin_Extrusion_H_
7
8 #include "FeaturesPlugin.h"
9 #include <ModelAPI_Feature.h>
10 #include <ModelAPI_ResultBody.h>
11 #include <GeomAlgoAPI_Extrusion.h>
12 #include <GeomAPI_Shape.h>
13 class FeaturesPlugin_Extrusion : public ModelAPI_Feature
14 {
15  public:
16   /// Extrusion kind
17   inline static const std::string& ID()
18   {
19     static const std::string MY_EXTRUSION_ID("Extrusion");
20     return MY_EXTRUSION_ID;
21   }
22   /// attribute name of referenced face
23   inline static const std::string& FACE_ID()
24   {
25     static const std::string MY_FACE_ID("extrusion_face");
26     return MY_FACE_ID;
27   }
28   /// attribute name of extrusion size
29   inline static const std::string& SIZE_ID()
30   {
31     static const std::string MY_SIZE_ID("extrusion_size");
32     return MY_SIZE_ID;
33   }
34   /// attribute name of reverse direction
35   inline static const std::string& REVERSE_ID()
36   {
37     static const std::string MY_REVERSE_ID("extrusion_reverse");
38     return MY_REVERSE_ID;
39   }
40
41   /// Returns the kind of a feature
42   FEATURESPLUGIN_EXPORT virtual const std::string& getKind()
43   {
44     static std::string MY_KIND = FeaturesPlugin_Extrusion::ID();
45     return MY_KIND;
46   }
47
48   /// Creates a new part document if needed
49   FEATURESPLUGIN_EXPORT virtual void execute();
50
51   /// Request for initialization of data model of the feature: adding all attributes
52   FEATURESPLUGIN_EXPORT virtual void initAttributes();
53
54   /// Use plugin manager for features creation
55   FeaturesPlugin_Extrusion();
56 private:
57   /// Load Naming data structure of the feature to the document
58   void LoadNamingDS(GeomAlgoAPI_Extrusion& theFeature, std::shared_ptr<ModelAPI_ResultBody> theResultBody,
59                         std::shared_ptr<GeomAPI_Shape> theBasis,
60                         std::shared_ptr<GeomAPI_Shape> theContext);
61 };
62
63 #endif