1 // Copyright (C) 2014-2017 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
18 // email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
21 #ifndef PRIMITIVESAPI_CYLINDER_H_
22 #define PRIMITIVESAPI_CYLINDER_H_
24 #include "PrimitivesAPI.h"
26 #include <PrimitivesPlugin_Cylinder.h>
28 #include <ModelHighAPI_Interface.h>
29 #include <ModelHighAPI_Macro.h>
31 class ModelHighAPI_Double;
32 class ModelHighAPI_Selection;
34 /// \class PrimitivesAPI_Cylinder
35 /// \ingroup CPPHighAPI
36 /// \brief Interface for primitive Cylinder feature.
37 class PrimitivesAPI_Cylinder: public ModelHighAPI_Interface
40 /// Constructor without values.
42 explicit PrimitivesAPI_Cylinder(const std::shared_ptr<ModelAPI_Feature>& theFeature);
44 /// Constructor with values.
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);
52 /// Constructor with values.
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);
63 virtual ~PrimitivesAPI_Cylinder();
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 */)
81 void setSizes(const ModelHighAPI_Double& theRadius,
82 const ModelHighAPI_Double& theHeight);
84 /// Dump wrapped feature
86 virtual void dump(ModelHighAPI_Dumper& theDumper) const;
89 /// Pointer on primitive Cylinder object
90 typedef std::shared_ptr<PrimitivesAPI_Cylinder> CylinderPtr;
92 /// \ingroup CPPHighAPI
93 /// \brief Create primitive Cylinder feature.
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);
101 /// \ingroup CPPHighAPI
102 /// \brief Create primitive Cylinder feature.
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);
111 /// \ingroup CPPHighAPI
112 /// \brief Create primitive Cylinder feature.
114 CylinderPtr addCylinder(const std::shared_ptr<ModelAPI_Document>& thePart,
115 const ModelHighAPI_Double& theRadius,
116 const ModelHighAPI_Double& theHeight);
118 /// \ingroup CPPHighAPI
119 /// \brief Create primitive Cylinder feature.
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);
126 #endif // PRIMITIVESAPI_CYLINDER_H_