Salome HOME
Adding the "Cylinder" primitive (the following).
[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_Box
21 /// \ingroup CPPHighAPI
22 /// \brief Interface for primitive Box 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_Double& theDx,
34                              const ModelHighAPI_Double& theDy,
35                              const ModelHighAPI_Double& theDz);*/
36
37   /// Constructor with values.
38   PRIMITIVESAPI_EXPORT
39   explicit PrimitivesAPI_Cylinder(const std::shared_ptr<ModelAPI_Feature>& theFeature,
40                                   const ModelHighAPI_Selection& theBasePoint,
41                                   const ModelHighAPI_Selection& theAxis,
42                                   const ModelHighAPI_Double& theRadius,
43                                   const ModelHighAPI_Double& theHeight);
44
45   /// Constructor with values.
46   PRIMITIVESAPI_EXPORT
47   explicit PrimitivesAPI_Cylinder(const std::shared_ptr<ModelAPI_Feature>& theFeature,
48                                   const ModelHighAPI_Selection& theBasePoint,
49                                   const ModelHighAPI_Selection& theAxis,
50                                   const ModelHighAPI_Double& theRadius,
51                                   const ModelHighAPI_Double& theHeight,
52                                   const ModelHighAPI_Double& theAngle);
53
54   /// Destructor.
55   PRIMITIVESAPI_EXPORT
56   virtual ~PrimitivesAPI_Cylinder();
57
58   INTERFACE_6(PrimitivesPlugin_Cylinder::ID(),
59              creationMethod, PrimitivesPlugin_Cylinder::CREATION_METHOD(),
60              ModelAPI_AttributeString, /** Creation method */,
61              basePoint, PrimitivesPlugin_Cylinder::BASE_POINT_ID(),
62              ModelAPI_AttributeSelection, /** Dimension in X */,
63              axis, PrimitivesPlugin_Cylinder::AXIS_ID(),
64              ModelAPI_AttributeSelection, /** Dimension in Y */,
65              radius, PrimitivesPlugin_Cylinder::RADIUS_ID(),
66              ModelAPI_AttributeDouble, /** Dimension in Z */,
67              height, PrimitivesPlugin_Cylinder::HEIGHT_ID(),
68              ModelAPI_AttributeDouble, /** First point */,
69              angle, PrimitivesPlugin_Cylinder::ANGLE_ID(),
70              ModelAPI_AttributeDouble, /** Second point */)
71
72   /// Set dimensions
73   PRIMITIVESAPI_EXPORT
74   void setSizes(const ModelHighAPI_Double& theRadius,
75                 const ModelHighAPI_Double& theHeight);
76
77   /// Dump wrapped feature
78   PRIMITIVESAPI_EXPORT
79   virtual void dump(ModelHighAPI_Dumper& theDumper) const;
80 };
81
82 /// Pointer on primitive Box object
83 typedef std::shared_ptr<PrimitivesAPI_Cylinder> CylinderPtr;
84
85 /// \ingroup CPPHighAPI
86 /// \brief Create primitive Box feature.
87 PRIMITIVESAPI_EXPORT
88 CylinderPtr addCylinder(const std::shared_ptr<ModelAPI_Document>& thePart,
89                         const ModelHighAPI_Selection& theBasePoint,
90                         const ModelHighAPI_Selection& theAxis,
91                         const ModelHighAPI_Double& theRadius,
92                         const ModelHighAPI_Double& theHeight);
93
94 /// \ingroup CPPHighAPI
95 /// \brief Create primitive Box feature.
96 PRIMITIVESAPI_EXPORT
97 CylinderPtr addCylinder(const std::shared_ptr<ModelAPI_Document>& thePart,
98                         const ModelHighAPI_Selection& theBasePoint,
99                         const ModelHighAPI_Selection& theAxis,
100                         const ModelHighAPI_Double& theRadius,
101                         const ModelHighAPI_Double& theHeight,
102                         const ModelHighAPI_Double& theAngle);
103
104 /// \ingroup CPPHighAPI
105 /// \brief Create primitive Box 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
111 /// \ingroup CPPHighAPI
112 /// \brief Create primitive Box feature.
113 PRIMITIVESAPI_EXPORT
114 CylinderPtr addCylinder(const std::shared_ptr<ModelAPI_Document>& thePart,
115                         const ModelHighAPI_Double& theRadius,
116                         const ModelHighAPI_Double& theHeight,
117                         const ModelHighAPI_Double& theAngle);
118
119 #endif // PRIMITIVESAPI_CYLINDER_H_