1 // Copyright (C) 2014-201x CEA/DEN, EDF R&D
3 // File: PrimitivesPlugin_Cylinder.h
4 // Created: 09 Jan 2017
5 // Author: Clarisse Genrault (CEA)
7 #ifndef PRIMITIVESPLUGIN_CYLINDER_H_
8 #define PRIMITIVESPLUGIN_CYLINDER_H_
10 #include <PrimitivesPlugin.h>
11 #include <ModelAPI_Feature.h>
12 #include <GeomAlgoAPI_Cylinder.h>
15 class ModelAPI_ResultBody;
17 /**\class PrimitivesPlugin_Cylinder
19 * \brief Feature for creation of a cylinder.
21 * Creates a cylinder from a radius, a height, an angle, a center point defaulting to
22 * the origin and an axis defaulting to OZ
24 class PrimitivesPlugin_Cylinder : public ModelAPI_Feature
28 inline static const std::string& ID()
30 static const std::string MY_CYLINDER_ID("Cylinder");
31 return MY_CYLINDER_ID;
34 /// Attribute name for creation method
35 inline static const std::string& CREATION_METHOD()
37 static const std::string MY_CREATION_METHOD_ID("CreationMethod");
38 return MY_CREATION_METHOD_ID;
41 /// Attribute name for creation method
42 inline static const std::string& CREATION_METHOD_CYLINDER()
44 static const std::string MY_CREATION_METHOD_ID("Cylinder");
45 return MY_CREATION_METHOD_ID;
48 /// Attribute name for creation method
49 inline static const std::string& CREATION_METHOD_CYLINDER_PORTION()
51 static const std::string MY_CREATION_METHOD_ID("CylinderPortion");
52 return MY_CREATION_METHOD_ID;
55 /// Attribute name of the base point
56 inline static const std::string& BASE_POINT_ID()
58 static const std::string MY_BASE_POINT_ID("base_point");
59 return MY_BASE_POINT_ID;
62 /// Attribute name of the axis
63 inline static const std::string& AXIS_ID()
65 static const std::string MY_AXIS_ID("axis");
69 /// Attribute name of the radius
70 inline static const std::string& RADIUS_ID()
72 static const std::string MY_RADIUS_ID("radius");
76 /// Attribute name of the height
77 inline static const std::string& HEIGHT_ID()
79 static const std::string MY_HEIGHT_ID("height");
83 /// Attribute name of the angle
84 inline static const std::string& ANGLE_ID()
86 static const std::string MY_ANGLE_ID("angle");
90 /// Returns the kind of a feature
91 PRIMITIVESPLUGIN_EXPORT virtual const std::string& getKind()
93 static std::string MY_KIND = PrimitivesPlugin_Cylinder::ID();
97 /// Creates a new part document if needed
98 PRIMITIVESPLUGIN_EXPORT virtual void execute();
100 /// Request for initialization of data model of the feature: adding all attributes
101 PRIMITIVESPLUGIN_EXPORT virtual void initAttributes();
103 /// Use plugin manager for features creation
104 PrimitivesPlugin_Cylinder();
107 /// Load Naming data structure of the feature to the document
108 void loadNamingDS(std::shared_ptr<GeomAlgoAPI_Cylinder> theCylinderAlgo,
109 std::shared_ptr<ModelAPI_ResultBody> theResultCylinder);
111 ///Perform the creation of a cylinder
112 void createCylinder(bool withAngle);
116 #endif // PRIMITIVESPLUGIN_CYLINDER_H_