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 email : webmaster.salome@opencascade.com<mailto: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_Box
34 /// \ingroup CPPHighAPI
35 /// \brief Interface for primitive Box 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.
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);*/
50 /// Constructor with values.
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);
58 /// Constructor with values.
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);
69 virtual ~PrimitivesAPI_Cylinder();
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 */)
87 void setSizes(const ModelHighAPI_Double& theRadius,
88 const ModelHighAPI_Double& theHeight);
90 /// Dump wrapped feature
92 virtual void dump(ModelHighAPI_Dumper& theDumper) const;
95 /// Pointer on primitive Box object
96 typedef std::shared_ptr<PrimitivesAPI_Cylinder> CylinderPtr;
98 /// \ingroup CPPHighAPI
99 /// \brief Create primitive Box feature.
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);
107 /// \ingroup CPPHighAPI
108 /// \brief Create primitive Box feature.
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);
117 /// \ingroup CPPHighAPI
118 /// \brief Create primitive Box feature.
120 CylinderPtr addCylinder(const std::shared_ptr<ModelAPI_Document>& thePart,
121 const ModelHighAPI_Double& theRadius,
122 const ModelHighAPI_Double& theHeight);
124 /// \ingroup CPPHighAPI
125 /// \brief Create primitive Box feature.
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);
132 #endif // PRIMITIVESAPI_CYLINDER_H_