]> SALOME platform Git repositories - modules/shaper.git/blob - src/PrimitivesAPI/PrimitivesAPI_Cylinder.h
Salome HOME
Merge branch 'master' into cgt/devCEA
[modules/shaper.git] / src / PrimitivesAPI / PrimitivesAPI_Cylinder.h
1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D -->
2
3 // File:        PrimitivesAPI_Cylinder.h
4 // Created:     12 Jan 2017
5 // Author:      Clarisse Genrault (CEA)
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   PRIMITIVESAPI_EXPORT
38   explicit PrimitivesAPI_Cylinder(const std::shared_ptr<ModelAPI_Feature>& theFeature,
39                                   const ModelHighAPI_Selection& theBasePoint,
40                                   const ModelHighAPI_Selection& theAxis,
41                                   const ModelHighAPI_Double& theRadius,
42                                   const ModelHighAPI_Double& theHeight,
43                                   const ModelHighAPI_Double& theAngle);
44
45   /// Constructor with values.
46   /*PRIMITIVESAPI_EXPORT
47   explicit PrimitivesAPI_Cylinder(const std::shared_ptr<ModelAPI_Feature>& theFeature,
48                                   const ModelHighAPI_Selection& theFirstPoint,
49                                   const ModelHighAPI_Selection& theSecondPoint);*/
50
51   /// Destructor.
52   PRIMITIVESAPI_EXPORT
53   virtual ~PrimitivesAPI_Cylinder();
54
55   INTERFACE_6(PrimitivesPlugin_Cylinder::ID(),
56               creationMethod, PrimitivesPlugin_Cylinder::CREATION_METHOD(),
57               ModelAPI_AttributeString, /** Creation method */,
58               basePoint, PrimitivesPlugin_Cylinder::BASE_POINT_ID(),
59               ModelAPI_AttributeSelection, /** Base point */,
60               axis, PrimitivesPlugin_Cylinder::AXIS_ID(),
61               ModelAPI_AttributeSelection, /** Axis */,
62               radius, PrimitivesPlugin_Cylinder::RADIUS_ID(),
63               ModelAPI_AttributeDouble, /** Radius */,
64               height, PrimitivesPlugin_Cylinder::HEIGHT_ID(),
65               ModelAPI_AttributeDouble, /** Height */,
66               angle, PrimitivesPlugin_Cylinder::ANGLE_ID(),
67               ModelAPI_AttributeDouble, /** Angle */)
68   
69   /// Set base point and axis
70   PRIMITIVESAPI_EXPORT
71   void setObjects(const ModelHighAPI_Selection& theBasePoint,
72                   const ModelHighAPI_Selection& theAxis);
73
74   /// Set radius and height
75   PRIMITIVESAPI_EXPORT
76   void setSizes(const ModelHighAPI_Double& theRadius,
77                 const ModelHighAPI_Double& theHeight);
78
79   /// Set angle
80   PRIMITIVESAPI_EXPORT
81   void setAngle(const ModelHighAPI_Double& theAngle);
82
83   /// Dump wrapped feature
84   PRIMITIVESAPI_EXPORT
85   virtual void dump(ModelHighAPI_Dumper& theDumper) const;
86 };
87
88 /// Pointer on primitive Box object
89 typedef std::shared_ptr<PrimitivesAPI_Cylinder> CylinderPtr;
90
91 /// \ingroup CPPHighAPI
92 /// \brief Create primitive Cylinder feature.
93 PRIMITIVESAPI_EXPORT
94 CylinderPtr addCylinder(const std::shared_ptr<ModelAPI_Document>& thePart,
95                         const ModelHighAPI_Selection& theBasePoint,
96                         const ModelHighAPI_Selection& theAxis,
97                         const ModelHighAPI_Double& theRadius,
98                         const ModelHighAPI_Double& theHeight,
99                         const ModelHighAPI_Double& theAngle);
100
101 /// \ingroup CPPHighAPI
102 /// \brief Create primitive Cylinder feature.
103 PRIMITIVESAPI_EXPORT
104 CylinderPtr addCylinder(const std::shared_ptr<ModelAPI_Document>& thePart,
105                         const ModelHighAPI_Selection& theBasePoint,
106                         const ModelHighAPI_Selection& theAxis,
107                         const ModelHighAPI_Double& theRadius,
108                         const ModelHighAPI_Double& theHeight);
109 /// \ingroup CPPHighAPI
110 /// \brief Create primitive Cylinder feature.
111 PRIMITIVESAPI_EXPORT
112 CylinderPtr addCylinder(const std::shared_ptr<ModelAPI_Document>& thePart,
113                         const ModelHighAPI_Double& theRadius,
114                         const ModelHighAPI_Double& theHeight,
115                         const ModelHighAPI_Double& theAngle);
116
117 /// \ingroup CPPHighAPI
118 /// \brief Create primitive Cylinder feature.
119 PRIMITIVESAPI_EXPORT
120 CylinderPtr addCylinder(const std::shared_ptr<ModelAPI_Document>& thePart,
121                         const ModelHighAPI_Double& theRadius,
122                         const ModelHighAPI_Double& theHeight);
123
124 #endif // PRIMITIVESAPI_CYLINDER_H_