Salome HOME
Merge branch 'master' into cgt/devCEA
[modules/shaper.git] / src / PrimitivesAPI / PrimitivesAPI_Cylinder.h
1 // Copyright (C) 2014-2017  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
18 // email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
19 //
20
21 #ifndef PRIMITIVESAPI_CYLINDER_H_
22 #define PRIMITIVESAPI_CYLINDER_H_
23
24 #include "PrimitivesAPI.h"
25
26 #include <PrimitivesPlugin_Cylinder.h>
27
28 #include <ModelHighAPI_Interface.h>
29 #include <ModelHighAPI_Macro.h>
30
31 class ModelHighAPI_Double;
32 class ModelHighAPI_Selection;
33
34 /// \class PrimitivesAPI_Cylinder
35 /// \ingroup CPPHighAPI
36 /// \brief Interface for primitive Cylinder feature.
37 class PrimitivesAPI_Cylinder: public ModelHighAPI_Interface
38 {
39 public:
40   /// Constructor without values.
41   PRIMITIVESAPI_EXPORT
42   explicit PrimitivesAPI_Cylinder(const std::shared_ptr<ModelAPI_Feature>& theFeature);
43
44   /// Constructor with values.
45   PRIMITIVESAPI_EXPORT
46   explicit PrimitivesAPI_Cylinder(const std::shared_ptr<ModelAPI_Feature>& theFeature,
47                                   const ModelHighAPI_Selection& theBasePoint,
48                                   const ModelHighAPI_Selection& theAxis,
49                                   const ModelHighAPI_Double& theRadius,
50                                   const ModelHighAPI_Double& theHeight);
51
52   /// Constructor with values.
53   PRIMITIVESAPI_EXPORT
54   explicit PrimitivesAPI_Cylinder(const std::shared_ptr<ModelAPI_Feature>& theFeature,
55                                   const ModelHighAPI_Selection& theBasePoint,
56                                   const ModelHighAPI_Selection& theAxis,
57                                   const ModelHighAPI_Double& theRadius,
58                                   const ModelHighAPI_Double& theHeight,
59                                   const ModelHighAPI_Double& theAngle);
60
61   /// Destructor.
62   PRIMITIVESAPI_EXPORT
63   virtual ~PrimitivesAPI_Cylinder();
64
65   INTERFACE_6(PrimitivesPlugin_Cylinder::ID(),
66              creationMethod, PrimitivesPlugin_Cylinder::CREATION_METHOD(),
67              ModelAPI_AttributeString, /** Creation method */,
68              basePoint, PrimitivesPlugin_Cylinder::BASE_POINT_ID(),
69              ModelAPI_AttributeSelection, /** Base point */,
70              axis, PrimitivesPlugin_Cylinder::AXIS_ID(),
71              ModelAPI_AttributeSelection, /** Axis */,
72              radius, PrimitivesPlugin_Cylinder::RADIUS_ID(),
73              ModelAPI_AttributeDouble, /** Radius */,
74              height, PrimitivesPlugin_Cylinder::HEIGHT_ID(),
75              ModelAPI_AttributeDouble, /** Height */,
76              angle, PrimitivesPlugin_Cylinder::ANGLE_ID(),
77              ModelAPI_AttributeDouble, /** Angle */)
78
79   /// Set dimensions
80   PRIMITIVESAPI_EXPORT
81   void setSizes(const ModelHighAPI_Double& theRadius,
82                 const ModelHighAPI_Double& theHeight);
83
84   /// Dump wrapped feature
85   PRIMITIVESAPI_EXPORT
86   virtual void dump(ModelHighAPI_Dumper& theDumper) const;
87 };
88
89 /// Pointer on primitive Cylinder object
90 typedef std::shared_ptr<PrimitivesAPI_Cylinder> CylinderPtr;
91
92 /// \ingroup CPPHighAPI
93 /// \brief Create primitive Cylinder feature.
94 PRIMITIVESAPI_EXPORT
95 CylinderPtr addCylinder(const std::shared_ptr<ModelAPI_Document>& thePart,
96                         const ModelHighAPI_Selection& theBasePoint,
97                         const ModelHighAPI_Selection& theAxis,
98                         const ModelHighAPI_Double& theRadius,
99                         const ModelHighAPI_Double& theHeight);
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                         const ModelHighAPI_Double& theAngle);
110
111 /// \ingroup CPPHighAPI
112 /// \brief Create primitive Cylinder 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
118 /// \ingroup CPPHighAPI
119 /// \brief Create primitive Cylinder feature.
120 PRIMITIVESAPI_EXPORT
121 CylinderPtr addCylinder(const std::shared_ptr<ModelAPI_Document>& thePart,
122                         const ModelHighAPI_Double& theRadius,
123                         const ModelHighAPI_Double& theHeight,
124                         const ModelHighAPI_Double& theAngle);
125
126 #endif // PRIMITIVESAPI_CYLINDER_H_