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_Box
35 /// \ingroup CPPHighAPI
36 /// \brief Interface for primitive Box 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.
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);*/
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);
59 /// Constructor with values.
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);
70 virtual ~PrimitivesAPI_Cylinder();
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 */)
88 void setSizes(const ModelHighAPI_Double& theRadius,
89 const ModelHighAPI_Double& theHeight);
91 /// Dump wrapped feature
93 virtual void dump(ModelHighAPI_Dumper& theDumper) const;
96 /// Pointer on primitive Box object
97 typedef std::shared_ptr<PrimitivesAPI_Cylinder> CylinderPtr;
99 /// \ingroup CPPHighAPI
100 /// \brief Create primitive Box feature.
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);
108 /// \ingroup CPPHighAPI
109 /// \brief Create primitive Box feature.
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);
118 /// \ingroup CPPHighAPI
119 /// \brief Create primitive Box feature.
121 CylinderPtr addCylinder(const std::shared_ptr<ModelAPI_Document>& thePart,
122 const ModelHighAPI_Double& theRadius,
123 const ModelHighAPI_Double& theHeight);
125 /// \ingroup CPPHighAPI
126 /// \brief Create primitive Box feature.
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);
133 #endif // PRIMITIVESAPI_CYLINDER_H_