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