Salome HOME
Merge branch 'master' into cgt/devCEA
[modules/shaper.git] / src / PrimitivesAPI / PrimitivesAPI_Torus.h
1 // Copyright (C) 2014-201x CEA/DEN, EDF R&D -->
2
3 // File:        PrimitivesAPI_Torus.h
4 // Created:     20 Mar 2017
5 // Author:      Clarisse Genrault
6
7 #ifndef PRIMITIVESAPI_TORUS_H_
8 #define PRIMITIVESAPI_TORUS_H_
9
10 #include "PrimitivesAPI.h"
11
12 #include <PrimitivesPlugin_Torus.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_Torus
21 /// \ingroup CPPHighAPI
22 /// \brief Interface for primitive Cone feature.
23 class PrimitivesAPI_Torus: public ModelHighAPI_Interface
24 {
25 public:
26   /// Constructor without values.
27   PRIMITIVESAPI_EXPORT
28   explicit PrimitivesAPI_Torus(const std::shared_ptr<ModelAPI_Feature>& theFeature);
29
30   /// Constructor with values.
31   PRIMITIVESAPI_EXPORT
32   explicit PrimitivesAPI_Torus(const std::shared_ptr<ModelAPI_Feature>& theFeature,
33                                const ModelHighAPI_Selection& theBasePoint,
34                                const ModelHighAPI_Selection& theAxis,
35                                const ModelHighAPI_Double& theRadius,
36                                const ModelHighAPI_Double& theRingRadius);
37
38   /// Destructor.
39   PRIMITIVESAPI_EXPORT
40   virtual ~PrimitivesAPI_Torus();
41
42   INTERFACE_4(PrimitivesPlugin_Torus::ID(),
43              basePoint, PrimitivesPlugin_Torus::BASE_POINT_ID(),
44              ModelAPI_AttributeSelection, /** Base point */,
45              axis, PrimitivesPlugin_Torus::AXIS_ID(),
46              ModelAPI_AttributeSelection, /** Axis */,
47              radius, PrimitivesPlugin_Torus::RADIUS_ID(),
48              ModelAPI_AttributeDouble, /** Radius */,
49              ringRadius, PrimitivesPlugin_Torus::RING_RADIUS_ID(),
50              ModelAPI_AttributeDouble, /** Ring radius */)
51
52   /// Set radius
53   PRIMITIVESAPI_EXPORT
54   void setRadius(const ModelHighAPI_Double& theRadius,
55                  const ModelHighAPI_Double& theRingRadius);
56
57   /// Dump wrapped feature
58   PRIMITIVESAPI_EXPORT
59   virtual void dump(ModelHighAPI_Dumper& theDumper) const;
60 };
61
62 /// Pointer on primitive Cone object
63 typedef std::shared_ptr<PrimitivesAPI_Torus> TorusPtr;
64
65 /// \ingroup CPPHighAPI
66 /// \brief Create primitive Cone feature.
67 PRIMITIVESAPI_EXPORT
68 TorusPtr addTorus(const std::shared_ptr<ModelAPI_Document>& thePart,
69                   const ModelHighAPI_Selection& theBasePoint,
70                   const ModelHighAPI_Selection& theAxis,
71                   const ModelHighAPI_Double& theRadius,
72                   const ModelHighAPI_Double& theRingRadius);
73
74 /// \ingroup CPPHighAPI
75 /// \brief Create primitive Cone feature.
76 PRIMITIVESAPI_EXPORT
77 TorusPtr addTorus(const std::shared_ptr<ModelAPI_Document>& thePart,
78                   const ModelHighAPI_Double& theRadius,
79                   const ModelHighAPI_Double& theRingRadius);
80
81 #endif // PRIMITIVESAPI_TORUS_H_