Salome HOME
updated copyright message
[modules/shaper.git] / src / PrimitivesAPI / PrimitivesAPI_Sphere.h
1 // Copyright (C) 2017-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 // File:        PrimitivesAPI_Sphere.h
21 // Created:     16 Mar 2017
22 // Author:      Clarisse Genrault
23
24 #ifndef PRIMITIVESAPI_SPHERE_H_
25 #define PRIMITIVESAPI_SPHERE_H_
26
27 #include "PrimitivesAPI.h"
28
29 #include <PrimitivesPlugin_Sphere.h>
30
31 #include <ModelHighAPI_Interface.h>
32 #include <ModelHighAPI_Macro.h>
33
34 class ModelHighAPI_Double;
35 class ModelHighAPI_Selection;
36
37 /// \class PrimitivesAPI_Sphere
38 /// \ingroup CPPHighAPI
39 /// \brief Interface for primitive Sphere feature.
40 class PrimitivesAPI_Sphere: public ModelHighAPI_Interface
41 {
42 public:
43   /// Constructor without values.
44   PRIMITIVESAPI_EXPORT
45   explicit PrimitivesAPI_Sphere(const std::shared_ptr<ModelAPI_Feature>& theFeature);
46
47   /// Constructor with values.
48   PRIMITIVESAPI_EXPORT
49   explicit PrimitivesAPI_Sphere(const std::shared_ptr<ModelAPI_Feature>& theFeature,
50                                 const ModelHighAPI_Selection& theCenterPoint,
51                                 const ModelHighAPI_Double& theRadius);
52
53   /// Constructor with values.
54   PRIMITIVESAPI_EXPORT
55   explicit PrimitivesAPI_Sphere(const std::shared_ptr<ModelAPI_Feature>& theFeature,
56                                 const ModelHighAPI_Double& theRMin,
57                                 const ModelHighAPI_Double& theRMax,
58                                 const ModelHighAPI_Double& thePhiMin,
59                                 const ModelHighAPI_Double& thePhiMax,
60                                 const ModelHighAPI_Double& theThetaMin,
61                                 const ModelHighAPI_Double& theThetaMax);
62
63   /// Destructor.
64   PRIMITIVESAPI_EXPORT
65   virtual ~PrimitivesAPI_Sphere();
66
67   INTERFACE_9(PrimitivesPlugin_Sphere::ID(),
68              creationMethod, PrimitivesPlugin_Sphere::CREATION_METHOD(),
69              ModelAPI_AttributeString, /** Creation method */,
70              centerPoint, PrimitivesPlugin_Sphere::CENTER_POINT_ID(),
71              ModelAPI_AttributeSelection, /** Center point */,
72              radius, PrimitivesPlugin_Sphere::RADIUS_ID(),
73              ModelAPI_AttributeDouble, /** Radius */,
74              rmin, PrimitivesPlugin_Sphere::RMIN_ID(),
75              ModelAPI_AttributeDouble, /** The minimum radius*/,
76              rmax, PrimitivesPlugin_Sphere::RMAX_ID(),
77              ModelAPI_AttributeDouble, /** The maximum radius*/,
78              phimin, PrimitivesPlugin_Sphere::PHIMIN_ID(),
79              ModelAPI_AttributeDouble, /** The minimum phi*/,
80              phimax, PrimitivesPlugin_Sphere::PHIMAX_ID(),
81              ModelAPI_AttributeDouble, /** The maximum phi*/,
82              thetamin, PrimitivesPlugin_Sphere::THETAMIN_ID(),
83              ModelAPI_AttributeDouble, /** The minimum theta*/,
84              thetamax,PrimitivesPlugin_Sphere::THETAMAX_ID(),
85              ModelAPI_AttributeDouble, /** The maximum theta*/)
86
87   /// Set center point
88   PRIMITIVESAPI_EXPORT
89   void setCenterPoint(const ModelHighAPI_Selection& theCenterPoint);
90
91   /// Set radius
92   PRIMITIVESAPI_EXPORT
93   void setRadius(const ModelHighAPI_Double& theRadius);
94
95   /// Set minimum and maximum radius
96   PRIMITIVESAPI_EXPORT
97   void setRadius(const ModelHighAPI_Double& theRMin, const ModelHighAPI_Double& theRMax);
98
99   /// Set minimum and maximum phi
100   PRIMITIVESAPI_EXPORT
101   void setPhi(const ModelHighAPI_Double& thePhiMin, const ModelHighAPI_Double& thePhiMax);
102
103   /// Set minimum and maximum theta
104   PRIMITIVESAPI_EXPORT
105   void setTheta(const ModelHighAPI_Double& theThetaMin, const ModelHighAPI_Double& theThetaMax);
106
107   /// Dump wrapped feature
108   PRIMITIVESAPI_EXPORT
109   virtual void dump(ModelHighAPI_Dumper& theDumper) const;
110 };
111
112 /// Pointer on primitive Sphere object
113 typedef std::shared_ptr<PrimitivesAPI_Sphere> SpherePtr;
114
115 /// \ingroup CPPHighAPI
116 /// \brief Create primitive Sphere feature.
117 PRIMITIVESAPI_EXPORT
118 SpherePtr addSphere(const std::shared_ptr<ModelAPI_Document>& thePart,
119                     const ModelHighAPI_Selection& theCenterPoint,
120                     const ModelHighAPI_Double& theRadius);
121
122 /// \ingroup CPPHighAPI
123 /// \brief Create primitive Sphere feature.
124 PRIMITIVESAPI_EXPORT
125 SpherePtr addSphere(const std::shared_ptr<ModelAPI_Document>& thePart,
126                     const ModelHighAPI_Double& theRadius);
127
128 /// \ingroup CPPHighAPI
129 /// \brief Create primitive Sphere feature.
130 PRIMITIVESAPI_EXPORT
131 SpherePtr addSphere(const std::shared_ptr<ModelAPI_Document>& thePart,
132                     const ModelHighAPI_Double& theRMin,
133                     const ModelHighAPI_Double& theRMax,
134                     const ModelHighAPI_Double& thePhiMin,
135                     const ModelHighAPI_Double& thePhiMax,
136                     const ModelHighAPI_Double& theThetaMin,
137                     const ModelHighAPI_Double& theThetaMax);
138
139 #endif // PRIMITIVESAPI_SPHERE_H_