1 // Copyright (C) 2014-2017 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
18 // email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
21 #ifndef GDMLAPI_Ellipsoid_H_
22 #define GDMLAPI_Ellipsoid_H_
26 #include <GDMLPlugin_Ellipsoid.h>
28 #include <ModelHighAPI_Interface.h>
29 #include <ModelHighAPI_Macro.h>
31 class ModelHighAPI_Double;
33 /// \class GDMLAPI_Ellipsoid
34 /// \ingroup CPPHighAPI
35 /// \brief Interface for primitive Ellipsoid feature.
36 class GDMLAPI_Ellipsoid: public ModelHighAPI_Interface
39 /// Constructor without values.
41 explicit GDMLAPI_Ellipsoid(const std::shared_ptr<ModelAPI_Feature>& theFeature);
43 /// Constructor with values.
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);
50 /// Constructor with values.
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);
61 virtual ~GDMLAPI_Ellipsoid();
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 */)
88 void setSizes(const ModelHighAPI_Double& theAX,
89 const ModelHighAPI_Double& theBY,
90 const ModelHighAPI_Double& theCZ);
94 void setZCut1(const ModelHighAPI_Double& theZCut1);
98 void setZCut2(const ModelHighAPI_Double& theZCut2);
100 /// Dump wrapped feature
102 virtual void dump(ModelHighAPI_Dumper& theDumper) const;
105 /// Pointer on primitive Ellipsoid object
106 typedef std::shared_ptr<GDMLAPI_Ellipsoid> EllipsoidPtr;
108 /// \ingroup CPPHighAPI
109 /// \brief Create GDML Ellipsoid feature.
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);
116 /// \ingroup CPPHighAPI
117 /// \brief Create GDML Ellipsoid feature.
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_