Salome HOME
Update copyrights
[modules/shaper.git] / src / PrimitivesAPI / PrimitivesAPI_Sphere.h
1 // Copyright (C) 2017-2019  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 // 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   /// Destructor.
54   PRIMITIVESAPI_EXPORT
55   virtual ~PrimitivesAPI_Sphere();
56
57   INTERFACE_2(PrimitivesPlugin_Sphere::ID(),
58              centerPoint, PrimitivesPlugin_Sphere::CENTER_POINT_ID(),
59              ModelAPI_AttributeSelection, /** Center point */,
60              radius, PrimitivesPlugin_Sphere::RADIUS_ID(),
61              ModelAPI_AttributeDouble, /** Radius */)
62
63   /// Set center point
64   PRIMITIVESAPI_EXPORT
65   void setCenterPoint(const ModelHighAPI_Selection& theCenterPoint);
66
67   /// Set radius
68   PRIMITIVESAPI_EXPORT
69   void setRadius(const ModelHighAPI_Double& theRadius);
70
71   /// Dump wrapped feature
72   PRIMITIVESAPI_EXPORT
73   virtual void dump(ModelHighAPI_Dumper& theDumper) const;
74 };
75
76 /// Pointer on primitive Sphere object
77 typedef std::shared_ptr<PrimitivesAPI_Sphere> SpherePtr;
78
79 /// \ingroup CPPHighAPI
80 /// \brief Create primitive Sphere feature.
81 PRIMITIVESAPI_EXPORT
82 SpherePtr addSphere(const std::shared_ptr<ModelAPI_Document>& thePart,
83                     const ModelHighAPI_Selection& theCenterPoint,
84                     const ModelHighAPI_Double& theRadius);
85
86 /// \ingroup CPPHighAPI
87 /// \brief Create primitive Sphere feature.
88 PRIMITIVESAPI_EXPORT
89 SpherePtr addSphere(const std::shared_ptr<ModelAPI_Document>& thePart,
90                     const ModelHighAPI_Double& theRadius);
91
92 #endif // PRIMITIVESAPI_SPHERE_H_