Salome HOME
Add the GDML primitive "Cone Segment".
[modules/shaper.git] / src / GDMLPlugin / GDMLPlugin_ConeSegment.h
1 // Copyright (C) 2014-2016 CEA/DEN, EDF R&D
2
3 // File:        GDMLPlugin_ConeSegment.h
4 // Created:     23 Nov 2016
5 // Author:      Clarisse Genrault (CEA)
6
7 #ifndef GDMLPLUGIN_CONESEGMENT_H_
8 #define GDMLPLUGIN_CONESEGMENT_H_
9
10 #include <GDMLPlugin.h>
11 #include <ModelAPI_Feature.h>
12 #include <GeomAlgoAPI_ConeSegment.h>
13
14 class GeomAPI_Shape;
15 class ModelAPI_ResultBody;
16
17 /**\class GDMLPlugin_ConeSegment
18  * \ingroup Plugins
19  * \brief Feature for creation of a GDML ConeSegment solid.
20  */
21 class GDMLPlugin_ConeSegment : public ModelAPI_Feature
22 {
23  public:
24   /// Cone segment kind
25   inline static const std::string& ID()
26   {
27     static const std::string MY_CONESEGMENT_ID("ConeSegment");
28     return MY_CONESEGMENT_ID;
29   }
30   /// attribute name of the inner radius at base of cone
31   inline static const std::string& RMIN1_ID()
32   {
33     static const std::string MY_RMIN1_ID("rmin1");
34     return MY_RMIN1_ID;
35   }
36   /// attribute name of the outer radius at base of cone
37   inline static const std::string& RMAX1_ID()
38   {
39     static const std::string MY_RMAX1_ID("rmax1");
40     return MY_RMAX1_ID;
41   }
42   /// attribute name of the inner radius at top of cone
43   inline static const std::string& RMIN2_ID()
44   {
45     static const std::string MY_RMIN2_ID("rmin2");
46     return MY_RMIN2_ID;
47   }
48   /// attribute name of the outer radius at top of cone
49   inline static const std::string& RMAX2_ID()
50   {
51     static const std::string MY_RMAX2_ID("rmax2");
52     return MY_RMAX2_ID;
53   }
54   /// attribute name of the height of the cone segment
55   inline static const std::string& Z_ID()
56   {
57     static const std::string MY_Z_ID("z");
58     return MY_Z_ID;
59   }
60   /// attribute name of the start angle of the segment
61   inline static const std::string& STARTPHI_ID()
62   {
63     static const std::string MY_STARTPHI_ID("startphi");
64     return MY_STARTPHI_ID;
65   }
66   /// attribute name of the angle of the segment
67   inline static const std::string& DELTAPHI_ID()
68   {
69     static const std::string MY_DELTAPHI_ID("deltaphi");
70     return MY_DELTAPHI_ID;
71   }
72
73   /// Returns the kind of a feature
74   GDMLPLUGIN_EXPORT virtual const std::string& getKind()
75   {
76     static std::string MY_KIND = GDMLPlugin_ConeSegment::ID();
77     return MY_KIND;
78   }
79
80   /// Creates a new part document if needed
81   GDMLPLUGIN_EXPORT virtual void execute();
82
83   /// Request for initialization of data model of the feature: adding all attributes
84   GDMLPLUGIN_EXPORT virtual void initAttributes();
85
86   /// Use plugin manager for features creation
87   GDMLPlugin_ConeSegment();
88
89  private:
90   /// Load Naming data structure of the feature to the document
91   void loadNamingDS(std::shared_ptr<GeomAlgoAPI_ConeSegment> theConeSegmentAlgo,
92                     std::shared_ptr<ModelAPI_ResultBody> theResultConeSegment);
93
94 };
95
96 #endif // GDMLPLUGIN_CONESEGMENT_H_