1 // Copyright (C) 2014-2016 CEA/DEN, EDF R&D
3 // Name : ConstructionAPI_Axis.h
7 // 15/06/16 - Sergey POKHODENKO - Creation of the file
8 // 24/06/16 - Clarisse GENRAULT (CEA) - Modification of the file
10 #ifndef SRC_CONSTRUCTIONAPI_CONSTRUCTIONAPI_AXIS_H_
11 #define SRC_CONSTRUCTIONAPI_CONSTRUCTIONAPI_AXIS_H_
13 //--------------------------------------------------------------------------------------
14 #include "ConstructionAPI.h"
16 #include <ConstructionPlugin_Axis.h>
18 #include <ModelHighAPI_Interface.h>
19 #include <ModelHighAPI_Macro.h>
20 //--------------------------------------------------------------------------------------
21 class ModelHighAPI_Double;
22 class ModelHighAPI_Selection;
23 //--------------------------------------------------------------------------------------
24 /**\class ConstructionAPI_Axis
26 * \brief Interface for Axis feature
28 class ConstructionAPI_Axis : public ModelHighAPI_Interface
31 /// Constructor without values
32 CONSTRUCTIONAPI_EXPORT
33 explicit ConstructionAPI_Axis(const std::shared_ptr<ModelAPI_Feature> & theFeature);
34 /// Constructor with values
35 CONSTRUCTIONAPI_EXPORT
36 ConstructionAPI_Axis(const std::shared_ptr<ModelAPI_Feature> & theFeature,
37 const ModelHighAPI_Selection & thePoint1,
38 const ModelHighAPI_Selection & thePoint2);
39 /// Constructor with values
40 CONSTRUCTIONAPI_EXPORT
41 ConstructionAPI_Axis(const std::shared_ptr<ModelAPI_Feature> & theFeature,
42 const ModelHighAPI_Selection & theCylindricalFace);
43 /// Constructor with values
44 CONSTRUCTIONAPI_EXPORT
45 ConstructionAPI_Axis(const std::shared_ptr<ModelAPI_Feature> & theFeature,
46 const ModelHighAPI_Selection & thePoint,
47 const ModelHighAPI_Double & theX,
48 const ModelHighAPI_Double & theY,
49 const ModelHighAPI_Double & theZ);
50 /// Constructor with values
51 CONSTRUCTIONAPI_EXPORT
52 ConstructionAPI_Axis(const std::shared_ptr<ModelAPI_Feature> & theFeature,
53 const ModelHighAPI_Double & theDX,
54 const ModelHighAPI_Double & theDY,
55 const ModelHighAPI_Double & theDZ);
57 CONSTRUCTIONAPI_EXPORT
58 virtual ~ConstructionAPI_Axis();
60 INTERFACE_10(ConstructionPlugin_Axis::ID(),
61 creationMethod, ConstructionPlugin_Axis::METHOD(), ModelAPI_AttributeString, /** Creation method */,
62 firstPoint, ConstructionPlugin_Axis::POINT_FIRST(), ModelAPI_AttributeSelection, /** First point */,
63 secondPoint, ConstructionPlugin_Axis::POINT_SECOND(), ModelAPI_AttributeSelection, /** Second point */,
64 cylindricalFace, ConstructionPlugin_Axis::CYLINDRICAL_FACE(), ModelAPI_AttributeSelection, /** Cylindrical face */,
65 xDirection, ConstructionPlugin_Axis::X_DIRECTION(), ModelAPI_AttributeDouble, /** X direction */,
66 yDirection, ConstructionPlugin_Axis::Y_DIRECTION(), ModelAPI_AttributeDouble, /** Y direction */,
67 zDirection, ConstructionPlugin_Axis::Z_DIRECTION(), ModelAPI_AttributeDouble, /** Z direction */,
68 xDimension, ConstructionPlugin_Axis::DX(), ModelAPI_AttributeDouble, /** X dimension */,
69 yDimension, ConstructionPlugin_Axis::DY(), ModelAPI_AttributeDouble, /** Y dimension */,
70 zDimension, ConstructionPlugin_Axis::DZ(), ModelAPI_AttributeDouble, /** Z dimension */
74 CONSTRUCTIONAPI_EXPORT
75 void setPoints(const ModelHighAPI_Selection & thePoint1,
76 const ModelHighAPI_Selection & thePoint2);
78 /// Set cylindrical face
79 CONSTRUCTIONAPI_EXPORT
80 void setCylindricalFace(const ModelHighAPI_Selection & theCylindricalFace);
83 CONSTRUCTIONAPI_EXPORT
84 void setPointAndDirection(const ModelHighAPI_Selection & thePoint,
85 const ModelHighAPI_Double & theX,
86 const ModelHighAPI_Double & theY,
87 const ModelHighAPI_Double & theZ);
90 CONSTRUCTIONAPI_EXPORT
91 void setDimensions(const ModelHighAPI_Double & theDX,
92 const ModelHighAPI_Double & theDY,
93 const ModelHighAPI_Double & theDZ);
96 //! Pointer on Axis object
97 typedef std::shared_ptr<ConstructionAPI_Axis> AxisPtr;
99 /**\ingroup CPPHighAPI
100 * \brief Create Axis feature
102 CONSTRUCTIONAPI_EXPORT
103 AxisPtr addAxis(const std::shared_ptr<ModelAPI_Document> & thePart,
104 const ModelHighAPI_Selection & thePoint1,
105 const ModelHighAPI_Selection & thePoint2);
107 /**\ingroup CPPHighAPI
108 * \brief Create Axis feature
110 CONSTRUCTIONAPI_EXPORT
111 AxisPtr addAxis(const std::shared_ptr<ModelAPI_Document> & thePart,
112 const ModelHighAPI_Selection & theCylindricalFace);
114 /**\ingroup CPPHighAPI
115 * \brief Create Axis feature
117 CONSTRUCTIONAPI_EXPORT
118 AxisPtr addAxis(const std::shared_ptr<ModelAPI_Document> & thePart,
119 const ModelHighAPI_Selection & thePoint,
120 const ModelHighAPI_Double & theX,
121 const ModelHighAPI_Double & theY,
122 const ModelHighAPI_Double & theZ);
124 /**\ingroup CPPHighAPI
125 * \brief Create Axis feature
127 CONSTRUCTIONAPI_EXPORT
128 AxisPtr addAxis(const std::shared_ptr<ModelAPI_Document> & thePart,
129 const ModelHighAPI_Double & theDX,
130 const ModelHighAPI_Double & theDY,
131 const ModelHighAPI_Double & theDZ);
133 //--------------------------------------------------------------------------------------
134 //--------------------------------------------------------------------------------------
135 #endif /* SRC_CONSTRUCTIONAPI_CONSTRUCTIONAPI_AXIS_H_ */