Salome HOME
23a06a312ed54962b3b255b9c0c63d8844606aa2
[modules/shaper.git] / src / GDMLAPI / GDMLAPI_Ellipsoid.h
1 // Copyright (C) 2014-2021  CEA/DEN, EDF R&D
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_Ellipsoid_H_
21 #define GDMLAPI_Ellipsoid_H_
22
23 #include "GDMLAPI.h"
24
25 #include <GDMLPlugin_Ellipsoid.h>
26
27 #include <ModelHighAPI_Interface.h>
28 #include <ModelHighAPI_Macro.h>
29
30 class ModelHighAPI_Double;
31
32 /// \class GDMLAPI_Ellipsoid
33 /// \ingroup CPPHighAPI
34 /// \brief Interface for primitive Ellipsoid feature.
35 class GDMLAPI_Ellipsoid: public ModelHighAPI_Interface
36 {
37 public:
38   /// Constructor without values.
39   GDMLAPI_EXPORT
40   explicit GDMLAPI_Ellipsoid(const std::shared_ptr<ModelAPI_Feature>& theFeature);
41
42   /// Constructor with values.
43   GDMLAPI_EXPORT
44   explicit GDMLAPI_Ellipsoid(const std::shared_ptr<ModelAPI_Feature>& theFeature,
45                              const ModelHighAPI_Double& theAX,
46                              const ModelHighAPI_Double& theBY,
47                              const ModelHighAPI_Double& theCZ);
48
49   /// Constructor with values.
50   GDMLAPI_EXPORT
51   explicit GDMLAPI_Ellipsoid(const std::shared_ptr<ModelAPI_Feature>& theFeature,
52                              const ModelHighAPI_Double& theAX,
53                              const ModelHighAPI_Double& theBY,
54                              const ModelHighAPI_Double& theCZ,
55                              const ModelHighAPI_Double& theZCut1,
56                              const ModelHighAPI_Double& theZCut2);
57
58   /// Destructor.
59   GDMLAPI_EXPORT
60   virtual ~GDMLAPI_Ellipsoid();
61
62   INTERFACE_7(GDMLPlugin_Ellipsoid::ID(),
63               ax, GDMLPlugin_Ellipsoid::AX_ID(),
64                   ModelAPI_AttributeDouble,
65                   /** Ellipsoid size along X axis */,
66               by, GDMLPlugin_Ellipsoid::BY_ID(),
67                   ModelAPI_AttributeDouble,
68                   /** Ellipsoid size along Y axis */,
69               cz, GDMLPlugin_Ellipsoid::CZ_ID(),
70                   ModelAPI_AttributeDouble,
71                   /** Ellipsoid size along Z axis */,
72               useZCut1, GDMLPlugin_Ellipsoid::USE_ZCUT1_ID(),
73                   ModelAPI_AttributeString,
74                   /** First cut of the ellipsoid along Z axis */,
75               zCut1, GDMLPlugin_Ellipsoid::ZCUT1_ID(),
76                   ModelAPI_AttributeDouble,
77                   /** Position of the first cut */,
78               useZCut2, GDMLPlugin_Ellipsoid::USE_ZCUT2_ID(),
79                   ModelAPI_AttributeString,
80                   /** Second cut of the ellipsoid along Z axis */,
81               zCut2, GDMLPlugin_Ellipsoid::ZCUT2_ID(),
82                   ModelAPI_AttributeDouble,
83                   /** Position of the second cut */)
84
85   /// Set dimensions
86   GDMLAPI_EXPORT
87   void setSizes(const ModelHighAPI_Double& theAX,
88                 const ModelHighAPI_Double& theBY,
89                 const ModelHighAPI_Double& theCZ);
90
91   /// Set Z cut no.1
92   GDMLAPI_EXPORT
93   void setZCut1(const ModelHighAPI_Double& theZCut1);
94
95   /// Set Z cut no.2
96   GDMLAPI_EXPORT
97   void setZCut2(const ModelHighAPI_Double& theZCut2);
98
99   /// Dump wrapped feature
100   GDMLAPI_EXPORT
101   virtual void dump(ModelHighAPI_Dumper& theDumper) const;
102 };
103
104 /// Pointer on primitive Ellipsoid object
105 typedef std::shared_ptr<GDMLAPI_Ellipsoid> EllipsoidPtr;
106
107 /// \ingroup CPPHighAPI
108 /// \brief Create GDML Ellipsoid feature.
109 GDMLAPI_EXPORT
110 EllipsoidPtr addEllipsoid(const std::shared_ptr<ModelAPI_Document>& thePart,
111                           const ModelHighAPI_Double& theAX,
112                           const ModelHighAPI_Double& theBY,
113                           const ModelHighAPI_Double& theCZ);
114
115 /// \ingroup CPPHighAPI
116 /// \brief Create GDML Ellipsoid feature.
117 GDMLAPI_EXPORT
118 EllipsoidPtr addEllipsoid(const std::shared_ptr<ModelAPI_Document>& thePart,
119                           const ModelHighAPI_Double& theAX,
120                           const ModelHighAPI_Double& theBY,
121                           const ModelHighAPI_Double& theCZ,
122                           const ModelHighAPI_Double& theZCut1,
123                           const ModelHighAPI_Double& theZCut2);
124 #endif // GDMLAPI_Ellipsoid_H_