Salome HOME
updated copyright message
[modules/shaper.git] / src / GDMLAPI / GDMLAPI_ConeSegment.h
1 // Copyright (C) 2014-2023  CEA, EDF
2 //
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License, or (at your option) any later version.
7 //
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
11 // Lesser General Public License for more details.
12 //
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
16 //
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
18 //
19
20 #ifndef GDMLAPI_ConeSegment_H_
21 #define GDMLAPI_ConeSegment_H_
22
23 #include "GDMLAPI.h"
24
25 #include <GDMLPlugin_ConeSegment.h>
26
27 #include <ModelHighAPI_Interface.h>
28 #include <ModelHighAPI_Macro.h>
29
30 class ModelHighAPI_Double;
31
32 /// \class GDMLPlugin_ConeSegment
33 /// \ingroup CPPHighAPI
34 /// \brief Interface for primitive ConeSegment feature.
35 class GDMLAPI_ConeSegment: public ModelHighAPI_Interface
36 {
37 public:
38   /// Constructor without values.
39   GDMLAPI_EXPORT
40   explicit GDMLAPI_ConeSegment(const std::shared_ptr<ModelAPI_Feature>& theFeature);
41
42   /// Constructor with values.
43   GDMLAPI_EXPORT
44   explicit GDMLAPI_ConeSegment(const std::shared_ptr<ModelAPI_Feature>& theFeature,
45                                const ModelHighAPI_Double& theRMin1,
46                                const ModelHighAPI_Double& theRMax1,
47                                const ModelHighAPI_Double& theRMin2,
48                                const ModelHighAPI_Double& theRMax2,
49                                const ModelHighAPI_Double& theZ,
50                                const ModelHighAPI_Double& theStartPhi,
51                                const ModelHighAPI_Double& theDeltaPhi);
52
53   /// Destructor.
54   GDMLAPI_EXPORT
55   virtual ~GDMLAPI_ConeSegment();
56
57   INTERFACE_7(GDMLPlugin_ConeSegment::ID(),
58               rmin1, GDMLPlugin_ConeSegment::RMIN1_ID(),
59               ModelAPI_AttributeDouble, /** Inner radius at base of cone */,
60               rmax1, GDMLPlugin_ConeSegment::RMAX1_ID(),
61               ModelAPI_AttributeDouble, /** Outer radius at base of cone */,
62               rmin2, GDMLPlugin_ConeSegment::RMIN2_ID(),
63               ModelAPI_AttributeDouble, /** Inner radius at top of cone */,
64               rmax2, GDMLPlugin_ConeSegment::RMAX2_ID(),
65               ModelAPI_AttributeDouble, /** Outer radius at top of cone */,
66               z, GDMLPlugin_ConeSegment::Z_ID(),
67               ModelAPI_AttributeDouble, /** Height of the cone segment */,
68               startphi, GDMLPlugin_ConeSegment::STARTPHI_ID(),
69               ModelAPI_AttributeDouble, /** Start angle of the segment */,
70               deltaphi, GDMLPlugin_ConeSegment::DELTAPHI_ID(),
71               ModelAPI_AttributeDouble, /** Angle of the segment */)
72
73   /// Set dimensions
74   GDMLAPI_EXPORT
75   void setAttributes(const ModelHighAPI_Double& theRMin1,
76                      const ModelHighAPI_Double& theRMax1,
77                      const ModelHighAPI_Double& theRMin2,
78                      const ModelHighAPI_Double& theRMax2,
79                      const ModelHighAPI_Double& theZ,
80                      const ModelHighAPI_Double& theStartPhi,
81                      const ModelHighAPI_Double& theDeltaPhi);
82
83   /// Dump wrapped feature
84   GDMLAPI_EXPORT
85   virtual void dump(ModelHighAPI_Dumper& theDumper) const;
86 };
87
88 /// Pointer on primitive ConeSegment object
89 typedef std::shared_ptr<GDMLAPI_ConeSegment> ConeSegmentPtr;
90
91 /// \ingroup CPPHighAPI
92 /// \brief Create GDML ConeSegment feature.
93 GDMLAPI_EXPORT
94 ConeSegmentPtr addConeSegment(const std::shared_ptr<ModelAPI_Document>& thePart,
95                               const ModelHighAPI_Double& theRMin1,
96                               const ModelHighAPI_Double& theRMax1,
97                               const ModelHighAPI_Double& theRMin2,
98                               const ModelHighAPI_Double& theRMax2,
99                               const ModelHighAPI_Double& theZ,
100                               const ModelHighAPI_Double& theStartPhi,
101                               const ModelHighAPI_Double& theDeltaPhi);
102
103 #endif // GDMLAPI_ConeSegment_H_