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