Salome HOME
Merge branch 'master' into cgt/devCEA
[modules/shaper.git] / src / PrimitivesPlugin / PrimitivesPlugin_Torus.h
1 // Copyright (C) 2014-201x CEA/DEN, EDF R&D
2
3 // File:        PrimitivesPlugin_Torus.h
4 // Created:     17 Mar 2017
5 // Author:      Clarisse Genrault (CEA)
6
7 #ifndef PRIMITIVESPLUGIN_TORUS_H_
8 #define PRIMITIVESPLUGIN_TORUS_H_
9
10 #include <PrimitivesPlugin.h>
11 #include <ModelAPI_Feature.h>
12 #include <GeomAlgoAPI_Torus.h>
13
14 /**\class PrimitivesPlugin_Torus
15  * \ingroup Plugins
16  * \brief Feature for creation of a torus.
17  *
18  * Creates a torus from a 
19  */
20 class PrimitivesPlugin_Torus : public ModelAPI_Feature
21 {
22  public:
23   /// Torus kind
24   inline static const std::string& ID()
25   {
26     static const std::string MY_TORUS_ID("Torus");
27     return MY_TORUS_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 radius
45   inline static const std::string& RADIUS_ID()
46   {
47     static const std::string MY_RADIUS_ID("radius");
48     return MY_RADIUS_ID;
49   }
50
51   /// Attribute name of the section radius
52   inline static const std::string& RING_RADIUS_ID()
53   {
54     static const std::string MY_RING_RADIUS_ID("ring_radius");
55     return MY_RING_RADIUS_ID;
56   }
57
58   /// Returns the kind of a feature
59   PRIMITIVESPLUGIN_EXPORT virtual const std::string& getKind()
60   {
61     static std::string MY_KIND = PrimitivesPlugin_Torus::ID();
62     return MY_KIND;
63   }
64
65   /// Creates a new part document if needed
66   PRIMITIVESPLUGIN_EXPORT virtual void execute();
67
68   /// Request for initialization of data model of the feature: adding all attributes
69   PRIMITIVESPLUGIN_EXPORT virtual void initAttributes();
70
71   /// Use plugin manager for features creation
72   PrimitivesPlugin_Torus();
73
74  private:
75   /// Load Naming data structure of the feature to the document
76   void loadNamingDS(std::shared_ptr<GeomAlgoAPI_Torus> theTorusAlgo,
77                     std::shared_ptr<ModelAPI_ResultBody> theResultTorus);
78
79 };
80
81 #endif // PRIMITIVESPLUGIN_TORUS_H_