Salome HOME
Merge branch 'master' into cgt/devCEA
[modules/shaper.git] / src / PrimitivesAPI / PrimitivesAPI_Sphere.h
1 // Copyright (C) 2014-201x CEA/DEN, EDF R&D -->
2
3 // File:        PrimitivesAPI_Sphere.h
4 // Created:     16 Mar 2017
5 // Author:      Clarisse Genrault
6
7 #ifndef PRIMITIVESAPI_SPHERE_H_
8 #define PRIMITIVESAPI_SPHERE_H_
9
10 #include "PrimitivesAPI.h"
11
12 #include <PrimitivesPlugin_Sphere.h>
13
14 #include <ModelHighAPI_Interface.h>
15 #include <ModelHighAPI_Macro.h>
16
17 class ModelHighAPI_Double;
18 class ModelHighAPI_Selection;
19
20 /// \class PrimitivesAPI_Sphere
21 /// \ingroup CPPHighAPI
22 /// \brief Interface for primitive Sphere feature.
23 class PrimitivesAPI_Sphere: public ModelHighAPI_Interface
24 {
25 public:
26   /// Constructor without values.
27   PRIMITIVESAPI_EXPORT
28   explicit PrimitivesAPI_Sphere(const std::shared_ptr<ModelAPI_Feature>& theFeature);
29
30   /// Constructor with values.
31   PRIMITIVESAPI_EXPORT
32   explicit PrimitivesAPI_Sphere(const std::shared_ptr<ModelAPI_Feature>& theFeature,
33                                 const ModelHighAPI_Selection& theCenterPoint,
34                                 const ModelHighAPI_Double& theRadius);
35
36   /// Destructor.
37   PRIMITIVESAPI_EXPORT
38   virtual ~PrimitivesAPI_Sphere();
39
40   INTERFACE_2(PrimitivesPlugin_Sphere::ID(),
41              centerPoint, PrimitivesPlugin_Sphere::CENTER_POINT_ID(),
42              ModelAPI_AttributeSelection, /** Center point */,
43              radius, PrimitivesPlugin_Sphere::RADIUS_ID(),
44              ModelAPI_AttributeDouble, /** Radius */)
45
46   /// Set center point
47   PRIMITIVESAPI_EXPORT
48   void setCenterPoint(const ModelHighAPI_Selection& theCenterPoint);
49
50   /// Set radius
51   PRIMITIVESAPI_EXPORT
52   void setRadius(const ModelHighAPI_Double& theRadius);
53
54   /// Dump wrapped feature
55   PRIMITIVESAPI_EXPORT
56   virtual void dump(ModelHighAPI_Dumper& theDumper) const;
57 };
58
59 /// Pointer on primitive Sphere object
60 typedef std::shared_ptr<PrimitivesAPI_Sphere> SpherePtr;
61
62 /// \ingroup CPPHighAPI
63 /// \brief Create primitive Sphere feature.
64 PRIMITIVESAPI_EXPORT
65 SpherePtr addSphere(const std::shared_ptr<ModelAPI_Document>& thePart,
66                     const ModelHighAPI_Selection& theCenterPoint,
67                     const ModelHighAPI_Double& theRadius);
68
69 /// \ingroup CPPHighAPI
70 /// \brief Create primitive Sphere feature.
71 PRIMITIVESAPI_EXPORT
72 SpherePtr addSphere(const std::shared_ptr<ModelAPI_Document>& thePart,
73                     const ModelHighAPI_Double& theRadius);
74
75 #endif // PRIMITIVESAPI_SPHERE_H_