]> SALOME platform Git repositories - modules/shaper.git/blob - src/PrimitivesAPI/PrimitivesAPI_Cylinder.h
Salome HOME
Task #2924 : Ability to remove a result. Disable ability to remove groups and fields...
[modules/shaper.git] / src / PrimitivesAPI / PrimitivesAPI_Cylinder.h
1 // Copyright (C) 2014-2019  CEA/DEN, EDF R&D
2 //
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License, or (at your option) any later version.
7 //
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
11 // Lesser General Public License for more details.
12 //
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
16 //
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
18 //
19
20 #ifndef PRIMITIVESAPI_CYLINDER_H_
21 #define PRIMITIVESAPI_CYLINDER_H_
22
23 #include "PrimitivesAPI.h"
24
25 #include <PrimitivesPlugin_Cylinder.h>
26
27 #include <ModelHighAPI_Interface.h>
28 #include <ModelHighAPI_Macro.h>
29
30 class ModelHighAPI_Double;
31 class ModelHighAPI_Selection;
32
33 /// \class PrimitivesAPI_Cylinder
34 /// \ingroup CPPHighAPI
35 /// \brief Interface for primitive Cylinder feature.
36 class PrimitivesAPI_Cylinder: public ModelHighAPI_Interface
37 {
38 public:
39   /// Constructor without values.
40   PRIMITIVESAPI_EXPORT
41   explicit PrimitivesAPI_Cylinder(const std::shared_ptr<ModelAPI_Feature>& theFeature);
42
43   /// Constructor with values.
44   PRIMITIVESAPI_EXPORT
45   explicit PrimitivesAPI_Cylinder(const std::shared_ptr<ModelAPI_Feature>& theFeature,
46                                   const ModelHighAPI_Selection& theBasePoint,
47                                   const ModelHighAPI_Selection& theAxis,
48                                   const ModelHighAPI_Double& theRadius,
49                                   const ModelHighAPI_Double& theHeight);
50
51   /// Constructor with values.
52   PRIMITIVESAPI_EXPORT
53   explicit PrimitivesAPI_Cylinder(const std::shared_ptr<ModelAPI_Feature>& theFeature,
54                                   const ModelHighAPI_Selection& theBasePoint,
55                                   const ModelHighAPI_Selection& theAxis,
56                                   const ModelHighAPI_Double& theRadius,
57                                   const ModelHighAPI_Double& theHeight,
58                                   const ModelHighAPI_Double& theAngle);
59
60   /// Destructor.
61   PRIMITIVESAPI_EXPORT
62   virtual ~PrimitivesAPI_Cylinder();
63
64   INTERFACE_6(PrimitivesPlugin_Cylinder::ID(),
65              creationMethod, PrimitivesPlugin_Cylinder::CREATION_METHOD(),
66              ModelAPI_AttributeString, /** Creation method */,
67              basePoint, PrimitivesPlugin_Cylinder::BASE_POINT_ID(),
68              ModelAPI_AttributeSelection, /** Base point */,
69              axis, PrimitivesPlugin_Cylinder::AXIS_ID(),
70              ModelAPI_AttributeSelection, /** Axis */,
71              radius, PrimitivesPlugin_Cylinder::RADIUS_ID(),
72              ModelAPI_AttributeDouble, /** Radius */,
73              height, PrimitivesPlugin_Cylinder::HEIGHT_ID(),
74              ModelAPI_AttributeDouble, /** Height */,
75              angle, PrimitivesPlugin_Cylinder::ANGLE_ID(),
76              ModelAPI_AttributeDouble, /** Angle */)
77
78   /// Set dimensions
79   PRIMITIVESAPI_EXPORT
80   void setSizes(const ModelHighAPI_Double& theRadius,
81                 const ModelHighAPI_Double& theHeight);
82
83   /// Dump wrapped feature
84   PRIMITIVESAPI_EXPORT
85   virtual void dump(ModelHighAPI_Dumper& theDumper) const;
86 };
87
88 /// Pointer on primitive Cylinder 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
100 /// \ingroup CPPHighAPI
101 /// \brief Create primitive Cylinder feature.
102 PRIMITIVESAPI_EXPORT
103 CylinderPtr addCylinder(const std::shared_ptr<ModelAPI_Document>& thePart,
104                         const ModelHighAPI_Selection& theBasePoint,
105                         const ModelHighAPI_Selection& theAxis,
106                         const ModelHighAPI_Double& theRadius,
107                         const ModelHighAPI_Double& theHeight,
108                         const ModelHighAPI_Double& theAngle);
109
110 /// \ingroup CPPHighAPI
111 /// \brief Create primitive Cylinder feature.
112 PRIMITIVESAPI_EXPORT
113 CylinderPtr addCylinder(const std::shared_ptr<ModelAPI_Document>& thePart,
114                         const ModelHighAPI_Double& theRadius,
115                         const ModelHighAPI_Double& theHeight);
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                         const ModelHighAPI_Double& theAngle);
124
125 #endif // PRIMITIVESAPI_CYLINDER_H_