1 // Copyright (C) 2014-2022 CEA/DEN, EDF R&D
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.
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.
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
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
20 #ifndef GDMLAPI_Ellipsoid_H_
21 #define GDMLAPI_Ellipsoid_H_
25 #include <GDMLPlugin_Ellipsoid.h>
27 #include <ModelHighAPI_Interface.h>
28 #include <ModelHighAPI_Macro.h>
30 class ModelHighAPI_Double;
32 /// \class GDMLAPI_Ellipsoid
33 /// \ingroup CPPHighAPI
34 /// \brief Interface for primitive Ellipsoid feature.
35 class GDMLAPI_Ellipsoid: public ModelHighAPI_Interface
38 /// Constructor without values.
40 explicit GDMLAPI_Ellipsoid(const std::shared_ptr<ModelAPI_Feature>& theFeature);
42 /// Constructor with values.
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);
49 /// Constructor with values.
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);
60 virtual ~GDMLAPI_Ellipsoid();
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 */)
87 void setSizes(const ModelHighAPI_Double& theAX,
88 const ModelHighAPI_Double& theBY,
89 const ModelHighAPI_Double& theCZ);
93 void setZCut1(const ModelHighAPI_Double& theZCut1);
97 void setZCut2(const ModelHighAPI_Double& theZCut2);
99 /// Dump wrapped feature
101 virtual void dump(ModelHighAPI_Dumper& theDumper) const;
104 /// Pointer on primitive Ellipsoid object
105 typedef std::shared_ptr<GDMLAPI_Ellipsoid> EllipsoidPtr;
107 /// \ingroup CPPHighAPI
108 /// \brief Create GDML Ellipsoid feature.
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);
115 /// \ingroup CPPHighAPI
116 /// \brief Create GDML Ellipsoid feature.
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_