]> SALOME platform Git repositories - modules/shaper.git/blob - src/PrimitivesAPI/PrimitivesAPI_Cylinder.h
Salome HOME
Add copyright header according to request of CEA from 06.06.2017
[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_Box
35 /// \ingroup CPPHighAPI
36 /// \brief Interface for primitive Box 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_Double& theDx,
48                              const ModelHighAPI_Double& theDy,
49                              const ModelHighAPI_Double& theDz);*/
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
59   /// Constructor with values.
60   PRIMITIVESAPI_EXPORT
61   explicit PrimitivesAPI_Cylinder(const std::shared_ptr<ModelAPI_Feature>& theFeature,
62                                   const ModelHighAPI_Selection& theBasePoint,
63                                   const ModelHighAPI_Selection& theAxis,
64                                   const ModelHighAPI_Double& theRadius,
65                                   const ModelHighAPI_Double& theHeight,
66                                   const ModelHighAPI_Double& theAngle);
67
68   /// Destructor.
69   PRIMITIVESAPI_EXPORT
70   virtual ~PrimitivesAPI_Cylinder();
71
72   INTERFACE_6(PrimitivesPlugin_Cylinder::ID(),
73              creationMethod, PrimitivesPlugin_Cylinder::CREATION_METHOD(),
74              ModelAPI_AttributeString, /** Creation method */,
75              basePoint, PrimitivesPlugin_Cylinder::BASE_POINT_ID(),
76              ModelAPI_AttributeSelection, /** Dimension in X */,
77              axis, PrimitivesPlugin_Cylinder::AXIS_ID(),
78              ModelAPI_AttributeSelection, /** Dimension in Y */,
79              radius, PrimitivesPlugin_Cylinder::RADIUS_ID(),
80              ModelAPI_AttributeDouble, /** Dimension in Z */,
81              height, PrimitivesPlugin_Cylinder::HEIGHT_ID(),
82              ModelAPI_AttributeDouble, /** First point */,
83              angle, PrimitivesPlugin_Cylinder::ANGLE_ID(),
84              ModelAPI_AttributeDouble, /** Second point */)
85
86   /// Set dimensions
87   PRIMITIVESAPI_EXPORT
88   void setSizes(const ModelHighAPI_Double& theRadius,
89                 const ModelHighAPI_Double& theHeight);
90
91   /// Dump wrapped feature
92   PRIMITIVESAPI_EXPORT
93   virtual void dump(ModelHighAPI_Dumper& theDumper) const;
94 };
95
96 /// Pointer on primitive Box object
97 typedef std::shared_ptr<PrimitivesAPI_Cylinder> CylinderPtr;
98
99 /// \ingroup CPPHighAPI
100 /// \brief Create primitive Box feature.
101 PRIMITIVESAPI_EXPORT
102 CylinderPtr addCylinder(const std::shared_ptr<ModelAPI_Document>& thePart,
103                         const ModelHighAPI_Selection& theBasePoint,
104                         const ModelHighAPI_Selection& theAxis,
105                         const ModelHighAPI_Double& theRadius,
106                         const ModelHighAPI_Double& theHeight);
107
108 /// \ingroup CPPHighAPI
109 /// \brief Create primitive Box feature.
110 PRIMITIVESAPI_EXPORT
111 CylinderPtr addCylinder(const std::shared_ptr<ModelAPI_Document>& thePart,
112                         const ModelHighAPI_Selection& theBasePoint,
113                         const ModelHighAPI_Selection& theAxis,
114                         const ModelHighAPI_Double& theRadius,
115                         const ModelHighAPI_Double& theHeight,
116                         const ModelHighAPI_Double& theAngle);
117
118 /// \ingroup CPPHighAPI
119 /// \brief Create primitive Box 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
125 /// \ingroup CPPHighAPI
126 /// \brief Create primitive Box feature.
127 PRIMITIVESAPI_EXPORT
128 CylinderPtr addCylinder(const std::shared_ptr<ModelAPI_Document>& thePart,
129                         const ModelHighAPI_Double& theRadius,
130                         const ModelHighAPI_Double& theHeight,
131                         const ModelHighAPI_Double& theAngle);
132
133 #endif // PRIMITIVESAPI_CYLINDER_H_