1 // Copyright (C) 2014-2019 CEA/DEN, EDF R&D
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.
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.
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
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
20 #ifndef PRIMITIVESAPI_CYLINDER_H_
21 #define PRIMITIVESAPI_CYLINDER_H_
23 #include "PrimitivesAPI.h"
25 #include <PrimitivesPlugin_Cylinder.h>
27 #include <ModelHighAPI_Interface.h>
28 #include <ModelHighAPI_Macro.h>
30 class ModelHighAPI_Double;
31 class ModelHighAPI_Selection;
33 /// \class PrimitivesAPI_Cylinder
34 /// \ingroup CPPHighAPI
35 /// \brief Interface for primitive Cylinder feature.
36 class PrimitivesAPI_Cylinder: public ModelHighAPI_Interface
39 /// Constructor without values.
41 explicit PrimitivesAPI_Cylinder(const std::shared_ptr<ModelAPI_Feature>& theFeature);
43 /// Constructor with values.
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);
51 /// Constructor with values.
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);
62 virtual ~PrimitivesAPI_Cylinder();
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 */)
80 void setSizes(const ModelHighAPI_Double& theRadius,
81 const ModelHighAPI_Double& theHeight);
83 /// Dump wrapped feature
85 virtual void dump(ModelHighAPI_Dumper& theDumper) const;
88 /// Pointer on primitive Cylinder object
89 typedef std::shared_ptr<PrimitivesAPI_Cylinder> CylinderPtr;
91 /// \ingroup CPPHighAPI
92 /// \brief Create primitive Cylinder feature.
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);
100 /// \ingroup CPPHighAPI
101 /// \brief Create primitive Cylinder feature.
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);
110 /// \ingroup CPPHighAPI
111 /// \brief Create primitive Cylinder feature.
113 CylinderPtr addCylinder(const std::shared_ptr<ModelAPI_Document>& thePart,
114 const ModelHighAPI_Double& theRadius,
115 const ModelHighAPI_Double& theHeight);
117 /// \ingroup CPPHighAPI
118 /// \brief Create primitive Cylinder feature.
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);
125 #endif // PRIMITIVESAPI_CYLINDER_H_