Salome HOME
Merge branch 'master' into cgt/devCEA
[modules/shaper.git] / src / PrimitivesAPI / PrimitivesAPI_Cylinder.h
1 // Copyright (C) 2014-201x CEA/DEN, EDF R&D -->
2
3 // File:        PrimitivesAPI_Cylinder.h
4 // Created:     12 Jan 2017
5 // Author:      Clarisse Genrault
6
7 #ifndef PRIMITIVESAPI_CYLINDER_H_
8 #define PRIMITIVESAPI_CYLINDER_H_
9
10 #include "PrimitivesAPI.h"
11
12 #include <PrimitivesPlugin_Cylinder.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_Cylinder
21 /// \ingroup CPPHighAPI
22 /// \brief Interface for primitive Cylinder feature.
23 class PrimitivesAPI_Cylinder: public ModelHighAPI_Interface
24 {
25 public:
26   /// Constructor without values.
27   PRIMITIVESAPI_EXPORT
28   explicit PrimitivesAPI_Cylinder(const std::shared_ptr<ModelAPI_Feature>& theFeature);
29
30   /// Constructor with values.
31   PRIMITIVESAPI_EXPORT
32   explicit PrimitivesAPI_Cylinder(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& theHeight);
37
38   /// Constructor with values.
39   PRIMITIVESAPI_EXPORT
40   explicit PrimitivesAPI_Cylinder(const std::shared_ptr<ModelAPI_Feature>& theFeature,
41                                   const ModelHighAPI_Selection& theBasePoint,
42                                   const ModelHighAPI_Selection& theAxis,
43                                   const ModelHighAPI_Double& theRadius,
44                                   const ModelHighAPI_Double& theHeight,
45                                   const ModelHighAPI_Double& theAngle);
46
47   /// Destructor.
48   PRIMITIVESAPI_EXPORT
49   virtual ~PrimitivesAPI_Cylinder();
50
51   INTERFACE_6(PrimitivesPlugin_Cylinder::ID(),
52              creationMethod, PrimitivesPlugin_Cylinder::CREATION_METHOD(),
53              ModelAPI_AttributeString, /** Creation method */,
54              basePoint, PrimitivesPlugin_Cylinder::BASE_POINT_ID(),
55              ModelAPI_AttributeSelection, /** Base point */,
56              axis, PrimitivesPlugin_Cylinder::AXIS_ID(),
57              ModelAPI_AttributeSelection, /** Axis */,
58              radius, PrimitivesPlugin_Cylinder::RADIUS_ID(),
59              ModelAPI_AttributeDouble, /** Radius */,
60              height, PrimitivesPlugin_Cylinder::HEIGHT_ID(),
61              ModelAPI_AttributeDouble, /** Height */,
62              angle, PrimitivesPlugin_Cylinder::ANGLE_ID(),
63              ModelAPI_AttributeDouble, /** Angle */)
64
65   /// Set dimensions
66   PRIMITIVESAPI_EXPORT
67   void setSizes(const ModelHighAPI_Double& theRadius,
68                 const ModelHighAPI_Double& theHeight);
69
70   /// Dump wrapped feature
71   PRIMITIVESAPI_EXPORT
72   virtual void dump(ModelHighAPI_Dumper& theDumper) const;
73 };
74
75 /// Pointer on primitive Cylinder object
76 typedef std::shared_ptr<PrimitivesAPI_Cylinder> CylinderPtr;
77
78 /// \ingroup CPPHighAPI
79 /// \brief Create primitive Cylinder feature.
80 PRIMITIVESAPI_EXPORT
81 CylinderPtr addCylinder(const std::shared_ptr<ModelAPI_Document>& thePart,
82                         const ModelHighAPI_Selection& theBasePoint,
83                         const ModelHighAPI_Selection& theAxis,
84                         const ModelHighAPI_Double& theRadius,
85                         const ModelHighAPI_Double& theHeight);
86
87 /// \ingroup CPPHighAPI
88 /// \brief Create primitive Cylinder feature.
89 PRIMITIVESAPI_EXPORT
90 CylinderPtr addCylinder(const std::shared_ptr<ModelAPI_Document>& thePart,
91                         const ModelHighAPI_Selection& theBasePoint,
92                         const ModelHighAPI_Selection& theAxis,
93                         const ModelHighAPI_Double& theRadius,
94                         const ModelHighAPI_Double& theHeight,
95                         const ModelHighAPI_Double& theAngle);
96
97 /// \ingroup CPPHighAPI
98 /// \brief Create primitive Cylinder feature.
99 PRIMITIVESAPI_EXPORT
100 CylinderPtr addCylinder(const std::shared_ptr<ModelAPI_Document>& thePart,
101                         const ModelHighAPI_Double& theRadius,
102                         const ModelHighAPI_Double& theHeight);
103
104 /// \ingroup CPPHighAPI
105 /// \brief Create primitive Cylinder feature.
106 PRIMITIVESAPI_EXPORT
107 CylinderPtr addCylinder(const std::shared_ptr<ModelAPI_Document>& thePart,
108                         const ModelHighAPI_Double& theRadius,
109                         const ModelHighAPI_Double& theHeight,
110                         const ModelHighAPI_Double& theAngle);
111
112 #endif // PRIMITIVESAPI_CYLINDER_H_