Salome HOME
Add the GDML primitive "Cone Segment".
[modules/shaper.git] / src / GDMLAPI / GDMLAPI_ConeSegment.h
1 // Copyright (C) 2014-2016 CEA/DEN, EDF R&D -->
2
3 // File:        GDMLAPI_ConeSegment.h
4 // Created:     29 Nov. 2016
5 // Author:      Clarisse Genrault (CEA)
6
7 #ifndef GDMLAPI_ConeSegment_H_
8 #define GDMLAPI_ConeSegment_H_
9
10 #include "GDMLAPI.h"
11
12 #include <GDMLPlugin_ConeSegment.h>
13
14 #include <ModelHighAPI_Interface.h>
15 #include <ModelHighAPI_Macro.h>
16
17 class ModelHighAPI_Double;
18
19 /// \class GDMLPlugin_ConeSegment
20 /// \ingroup CPPHighAPI
21 /// \brief Interface for primitive ConeSegment feature.
22 class GDMLAPI_ConeSegment: public ModelHighAPI_Interface
23 {
24 public:
25   /// Constructor without values.
26   GDMLAPI_EXPORT
27   explicit GDMLAPI_ConeSegment(const std::shared_ptr<ModelAPI_Feature>& theFeature);
28
29   /// Constructor with values.
30   GDMLAPI_EXPORT
31   explicit GDMLAPI_ConeSegment(const std::shared_ptr<ModelAPI_Feature>& theFeature,
32                                const ModelHighAPI_Double& theRMin1,
33                                const ModelHighAPI_Double& theRMax1,
34                                const ModelHighAPI_Double& theRMin2,
35                                const ModelHighAPI_Double& theRMax2,
36                                const ModelHighAPI_Double& theZ,
37                                const ModelHighAPI_Double& theStartPhi,
38                                const ModelHighAPI_Double& theDeltaPhi);
39
40   /// Destructor.
41   GDMLAPI_EXPORT
42   virtual ~GDMLAPI_ConeSegment();
43
44   INTERFACE_7(GDMLPlugin_ConeSegment::ID(),
45               rmin1, GDMLPlugin_ConeSegment::RMIN1_ID(),
46               ModelAPI_AttributeDouble, /** Inner radius at base of cone */,
47               rmax1, GDMLPlugin_ConeSegment::RMAX1_ID(),
48               ModelAPI_AttributeDouble, /** Outer radius at base of cone */,
49               rmin2, GDMLPlugin_ConeSegment::RMIN2_ID(),
50               ModelAPI_AttributeDouble, /** Inner radius at top of cone */,
51               rmax2, GDMLPlugin_ConeSegment::RMAX2_ID(),
52               ModelAPI_AttributeDouble, /** Outer radius at top of cone */,
53               z, GDMLPlugin_ConeSegment::Z_ID(),
54               ModelAPI_AttributeDouble, /** Height of the cone segment */,
55               startphi, GDMLPlugin_ConeSegment::STARTPHI_ID(),
56               ModelAPI_AttributeDouble, /** Start angle of the segment */,
57               deltaphi, GDMLPlugin_ConeSegment::DELTAPHI_ID(),
58               ModelAPI_AttributeDouble, /** Angle of the segment */)
59
60   /// Set dimensions
61   GDMLAPI_EXPORT
62   void setAttributes(const ModelHighAPI_Double& theRMin1,
63                      const ModelHighAPI_Double& theRMax1,
64                      const ModelHighAPI_Double& theRMin2,
65                      const ModelHighAPI_Double& theRMax2,
66                      const ModelHighAPI_Double& theZ,
67                      const ModelHighAPI_Double& theStartPhi,
68                      const ModelHighAPI_Double& theDeltaPhi);
69 };
70
71 /// Pointer on primitive ConeSegment object
72 typedef std::shared_ptr<GDMLAPI_ConeSegment> ConeSegmentPtr;
73
74 /// \ingroup CPPHighAPI
75 /// \brief Create GDML ConeSegment feature.
76 GDMLAPI_EXPORT
77 ConeSegmentPtr addConeSegment(const std::shared_ptr<ModelAPI_Document>& thePart,
78                               const ModelHighAPI_Double& theRMin1,
79                               const ModelHighAPI_Double& theRMax1,
80                               const ModelHighAPI_Double& theRMin2,
81                               const ModelHighAPI_Double& theRMax2,
82                               const ModelHighAPI_Double& theZ,
83                               const ModelHighAPI_Double& theStartPhi,
84                               const ModelHighAPI_Double& theDeltaPhi);
85
86 #endif // GDMLAPI_ConeSegment_H_