1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D -->
3 // File: PrimitivesAPI_Cylinder.h
4 // Created: 12 Jan 2017
5 // Author: Clarisse Genrault (CEA)
7 #ifndef PRIMITIVESAPI_CYLINDER_H_
8 #define PRIMITIVESAPI_CYLINDER_H_
10 #include "PrimitivesAPI.h"
12 #include <PrimitivesPlugin_Cylinder.h>
14 #include <ModelHighAPI_Interface.h>
15 #include <ModelHighAPI_Macro.h>
17 class ModelHighAPI_Double;
18 class ModelHighAPI_Selection;
20 /// \class PrimitivesAPI_Cylinder
21 /// \ingroup CPPHighAPI
22 /// \brief Interface for primitive Cylinder feature.
23 class PrimitivesAPI_Cylinder: public ModelHighAPI_Interface
26 /// Constructor without values.
28 explicit PrimitivesAPI_Cylinder(const std::shared_ptr<ModelAPI_Feature>& theFeature);
30 /// Constructor with values.
32 explicit PrimitivesAPI_Cylinder(const std::shared_ptr<ModelAPI_Feature>& theFeature,
33 const ModelHighAPI_Selection& theBasePoint,
34 const ModelHighAPI_Selection& theAxis,
35 const ModelHighAPI_Double& theRadius,
36 const ModelHighAPI_Double& theHeight);
38 explicit PrimitivesAPI_Cylinder(const std::shared_ptr<ModelAPI_Feature>& theFeature,
39 const ModelHighAPI_Selection& theBasePoint,
40 const ModelHighAPI_Selection& theAxis,
41 const ModelHighAPI_Double& theRadius,
42 const ModelHighAPI_Double& theHeight,
43 const ModelHighAPI_Double& theAngle);
45 /// Constructor with values.
46 /*PRIMITIVESAPI_EXPORT
47 explicit PrimitivesAPI_Cylinder(const std::shared_ptr<ModelAPI_Feature>& theFeature,
48 const ModelHighAPI_Selection& theFirstPoint,
49 const ModelHighAPI_Selection& theSecondPoint);*/
53 virtual ~PrimitivesAPI_Cylinder();
55 INTERFACE_6(PrimitivesPlugin_Cylinder::ID(),
56 creationMethod, PrimitivesPlugin_Cylinder::CREATION_METHOD(),
57 ModelAPI_AttributeString, /** Creation method */,
58 basePoint, PrimitivesPlugin_Cylinder::BASE_POINT_ID(),
59 ModelAPI_AttributeSelection, /** Base point */,
60 axis, PrimitivesPlugin_Cylinder::AXIS_ID(),
61 ModelAPI_AttributeSelection, /** Axis */,
62 radius, PrimitivesPlugin_Cylinder::RADIUS_ID(),
63 ModelAPI_AttributeDouble, /** Radius */,
64 height, PrimitivesPlugin_Cylinder::HEIGHT_ID(),
65 ModelAPI_AttributeDouble, /** Height */,
66 angle, PrimitivesPlugin_Cylinder::ANGLE_ID(),
67 ModelAPI_AttributeDouble, /** Angle */)
69 /// Set base point and axis
71 void setObjects(const ModelHighAPI_Selection& theBasePoint,
72 const ModelHighAPI_Selection& theAxis);
74 /// Set radius and height
76 void setSizes(const ModelHighAPI_Double& theRadius,
77 const ModelHighAPI_Double& theHeight);
81 void setAngle(const ModelHighAPI_Double& theAngle);
83 /// Dump wrapped feature
85 virtual void dump(ModelHighAPI_Dumper& theDumper) const;
88 /// Pointer on primitive Box 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,
99 const ModelHighAPI_Double& theAngle);
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 /// \ingroup CPPHighAPI
110 /// \brief Create primitive Cylinder feature.
112 CylinderPtr addCylinder(const std::shared_ptr<ModelAPI_Document>& thePart,
113 const ModelHighAPI_Double& theRadius,
114 const ModelHighAPI_Double& theHeight,
115 const ModelHighAPI_Double& theAngle);
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);
124 #endif // PRIMITIVESAPI_CYLINDER_H_