Salome HOME
Fix for shortcut problem
[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
16 /**\class FeaturesPlugin_Extrusion
17  * \ingroup Plugins
18  * \brief Feature for creation of extrusion from the planar face.
19  *
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.
23  */
24 class FeaturesPlugin_Extrusion : public ModelAPI_Feature
25 {
26  public:
27   /// Extrusion kind
28   inline static const std::string& ID()
29   {
30     static const std::string MY_EXTRUSION_ID("Extrusion");
31     return MY_EXTRUSION_ID;
32   }
33   /// attribute name of referenced face
34   inline static const std::string& FACE_ID()
35   {
36     static const std::string MY_FACE_ID("extrusion_face");
37     return MY_FACE_ID;
38   }
39   /// attribute name of extrusion size
40   inline static const std::string& SIZE_ID()
41   {
42     static const std::string MY_SIZE_ID("extrusion_size");
43     return MY_SIZE_ID;
44   }
45   /// attribute name of reverse direction
46   inline static const std::string& REVERSE_ID()
47   {
48     static const std::string MY_REVERSE_ID("extrusion_reverse");
49     return MY_REVERSE_ID;
50   }
51
52   /// Returns the kind of a feature
53   FEATURESPLUGIN_EXPORT virtual const std::string& getKind()
54   {
55     static std::string MY_KIND = FeaturesPlugin_Extrusion::ID();
56     return MY_KIND;
57   }
58
59   /// Creates a new part document if needed
60   FEATURESPLUGIN_EXPORT virtual void execute();
61
62   /// Request for initialization of data model of the feature: adding all attributes
63   FEATURESPLUGIN_EXPORT virtual void initAttributes();
64
65   /// Use plugin manager for features creation
66   FeaturesPlugin_Extrusion();
67 private:
68   /// Load Naming data structure of the feature to the document
69   void LoadNamingDS(GeomAlgoAPI_Extrusion& theFeature, std::shared_ptr<ModelAPI_ResultBody> theResultBody,
70                         std::shared_ptr<GeomAPI_Shape> theBasis,
71                         std::shared_ptr<GeomAPI_Shape> theContext);
72 };
73
74 #endif