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