Salome HOME
Merge branch 'master' into cgt/devCEA
[modules/shaper.git] / src / PrimitivesPlugin / PrimitivesPlugin_Cone.h
1 // Copyright (C) 2014-201x CEA/DEN, EDF R&D
2
3 // File:        PrimitivesPlugin_Cone.h
4 // Created:     17 Mar 2017
5 // Author:      Clarisse Genrault (CEA)
6
7 #ifndef PRIMITIVESPLUGIN_CONE_H_
8 #define PRIMITIVESPLUGIN_CONE_H_
9
10 #include <PrimitivesPlugin.h>
11 #include <ModelAPI_Feature.h>
12 #include <GeomAlgoAPI_Cone.h>
13
14 /**\class PrimitivesPlugin_Cone
15  * \ingroup Plugins
16  * \brief Feature for creation of a cone.
17  *
18  * Creates a cone from a 
19  */
20 class PrimitivesPlugin_Cone : public ModelAPI_Feature
21 {
22  public:
23   /// Cone kind
24   inline static const std::string& ID()
25   {
26     static const std::string MY_CONE_ID("Cone");
27     return MY_CONE_ID;
28   }
29
30   /// Attribute name of the base point
31   inline static const std::string& BASE_POINT_ID()
32   {
33     static const std::string MY_BASE_POINT_ID("base_point");
34     return MY_BASE_POINT_ID;
35   }
36
37   /// Attribute name of the axis
38   inline static const std::string& AXIS_ID()
39   {
40     static const std::string MY_AXIS_ID("axis");
41     return MY_AXIS_ID;
42   }
43
44   /// Attribute name of the base radius
45   inline static const std::string& BASE_RADIUS_ID()
46   {
47     static const std::string MY_BASE_RADIUS_ID("base_radius");
48     return MY_BASE_RADIUS_ID;
49   }
50
51   /// Attribute name of the radius
52   inline static const std::string& TOP_RADIUS_ID()
53   {
54     static const std::string MY_TOP_RADIUS_ID("top_radius");
55     return MY_TOP_RADIUS_ID;
56   }
57
58   /// Attribute name of the radius
59   inline static const std::string& HEIGHT_ID()
60   {
61     static const std::string MY_HEIGHT_ID("height");
62     return MY_HEIGHT_ID;
63   }
64
65   /// Returns the kind of a feature
66   PRIMITIVESPLUGIN_EXPORT virtual const std::string& getKind()
67   {
68     static std::string MY_KIND = PrimitivesPlugin_Cone::ID();
69     return MY_KIND;
70   }
71
72   /// Creates a new part document if needed
73   PRIMITIVESPLUGIN_EXPORT virtual void execute();
74
75   /// Request for initialization of data model of the feature: adding all attributes
76   PRIMITIVESPLUGIN_EXPORT virtual void initAttributes();
77
78   /// Use plugin manager for features creation
79   PrimitivesPlugin_Cone();
80
81  private:
82   /// Load Naming data structure of the feature to the document
83   void loadNamingDS(std::shared_ptr<GeomAlgoAPI_Cone> theConeAlgo,
84                     std::shared_ptr<ModelAPI_ResultBody> theResultCone);
85
86 };
87
88 #endif // PRIMITIVESPLUGIN_CONE_H_