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 #include "ConstructionAPI.h"
15 #include <ConstructionPlugin_Axis.h>
17 #include <ModelHighAPI_Interface.h>
18 #include <ModelHighAPI_Macro.h>
20 class ModelHighAPI_Double;
21 class ModelHighAPI_Selection;
23 /// \class ConstructionAPI_Axis
24 /// \ingroup CPPHighAPI
25 /// \brief Interface for Axis feature
26 class ConstructionAPI_Axis: public ModelHighAPI_Interface
29 /// Constructor without values
30 CONSTRUCTIONAPI_EXPORT
31 explicit ConstructionAPI_Axis(const std::shared_ptr<ModelAPI_Feature>& theFeature);
33 /// Constructor with values
34 CONSTRUCTIONAPI_EXPORT
35 ConstructionAPI_Axis(const std::shared_ptr<ModelAPI_Feature>& theFeature,
36 const ModelHighAPI_Selection& theObject1,
37 const ModelHighAPI_Selection& theObject2);
39 /// Constructor with values
40 CONSTRUCTIONAPI_EXPORT
41 ConstructionAPI_Axis(const std::shared_ptr<ModelAPI_Feature>& theFeature,
42 const ModelHighAPI_Selection& theObject);
44 /// Constructor with values
45 CONSTRUCTIONAPI_EXPORT
46 ConstructionAPI_Axis(const std::shared_ptr<ModelAPI_Feature>& theFeature,
47 const ModelHighAPI_Selection& thePoint,
48 const ModelHighAPI_Double& theX,
49 const ModelHighAPI_Double& theY,
50 const ModelHighAPI_Double& theZ);
52 /// Constructor with values
53 CONSTRUCTIONAPI_EXPORT
54 ConstructionAPI_Axis(const std::shared_ptr<ModelAPI_Feature>& theFeature,
55 const ModelHighAPI_Double& theDX,
56 const ModelHighAPI_Double& theDY,
57 const ModelHighAPI_Double& theDZ);
59 /// Constructor with values
60 CONSTRUCTIONAPI_EXPORT
61 ConstructionAPI_Axis(const std::shared_ptr<ModelAPI_Feature>& theFeature,
62 const ModelHighAPI_Selection& thePlane1,
63 const ModelHighAPI_Double& theOffset1,
64 const bool theReverseOffset1,
65 const ModelHighAPI_Selection& thePlane2,
66 const ModelHighAPI_Double& theOffset2,
67 const bool theReverseOffset2);
69 /// Constructor with values
70 CONSTRUCTIONAPI_EXPORT
71 ConstructionAPI_Axis(const std::shared_ptr<ModelAPI_Feature>& theFeature,
72 const ModelHighAPI_Selection& thePlane1,
73 const ModelHighAPI_Selection& thePlane2,
74 const ModelHighAPI_Double& theOffset2,
75 const bool theReverseOffset2);
77 /// Constructor with values
78 CONSTRUCTIONAPI_EXPORT
79 ConstructionAPI_Axis(const std::shared_ptr<ModelAPI_Feature>& theFeature,
80 const ModelHighAPI_Selection& thePlane1,
81 const ModelHighAPI_Double& theOffset1,
82 const bool theReverseOffset1,
83 const ModelHighAPI_Selection& thePlane2);
86 CONSTRUCTIONAPI_EXPORT
87 virtual ~ConstructionAPI_Axis();
89 INTERFACE_21(ConstructionPlugin_Axis::ID(),
90 creationMethod, ConstructionPlugin_Axis::METHOD(), ModelAPI_AttributeString, /** Creation method */,
91 firstPoint, ConstructionPlugin_Axis::POINT_FIRST(), ModelAPI_AttributeSelection, /** First point */,
92 secondPoint, ConstructionPlugin_Axis::POINT_SECOND(), ModelAPI_AttributeSelection, /** Second point */,
93 cylindricalFace, ConstructionPlugin_Axis::CYLINDRICAL_FACE(), ModelAPI_AttributeSelection, /** Cylindrical face */,
94 xDirection, ConstructionPlugin_Axis::X_DIRECTION(), ModelAPI_AttributeDouble, /** X direction */,
95 yDirection, ConstructionPlugin_Axis::Y_DIRECTION(), ModelAPI_AttributeDouble, /** Y direction */,
96 zDirection, ConstructionPlugin_Axis::Z_DIRECTION(), ModelAPI_AttributeDouble, /** Z direction */,
97 xDimension, ConstructionPlugin_Axis::DX(), ModelAPI_AttributeDouble, /** X dimension */,
98 yDimension, ConstructionPlugin_Axis::DY(), ModelAPI_AttributeDouble, /** Y dimension */,
99 zDimension, ConstructionPlugin_Axis::DZ(), ModelAPI_AttributeDouble, /** Z dimension */,
100 line, ConstructionPlugin_Axis::LINE(), ModelAPI_AttributeSelection, /** Line */,
101 plane, ConstructionPlugin_Axis::PLANE(), ModelAPI_AttributeSelection, /** Plane */,
102 point, ConstructionPlugin_Axis::POINT(), ModelAPI_AttributeSelection, /** Point */,
103 plane1, ConstructionPlugin_Axis::PLANE1(), ModelAPI_AttributeSelection, /** Plane 1 */,
104 useOffset1, ConstructionPlugin_Axis::USE_OFFSET1(), ModelAPI_AttributeString, /** Use offset 1 */,
105 offset1, ConstructionPlugin_Axis::OFFSET1(), ModelAPI_AttributeDouble, /** Offset 1 */,
106 reverseOffset1, ConstructionPlugin_Axis::REVERSE_OFFSET1(), ModelAPI_AttributeBoolean, /** Reverse offset 1 */,
107 plane2, ConstructionPlugin_Axis::PLANE2(), ModelAPI_AttributeSelection, /** Plane 2 */,
108 useOffset2, ConstructionPlugin_Axis::USE_OFFSET2(), ModelAPI_AttributeString, /** Use offset 2 */,
109 offset2, ConstructionPlugin_Axis::OFFSET2(), ModelAPI_AttributeDouble, /** Offset 2 */,
110 reverseOffset2, ConstructionPlugin_Axis::REVERSE_OFFSET2(), ModelAPI_AttributeBoolean, /** Reverse offset 2 */)
113 CONSTRUCTIONAPI_EXPORT
114 void setByPoints(const ModelHighAPI_Selection& thePoint1,
115 const ModelHighAPI_Selection& thePoint2);
117 /// Set cylindrical face
118 CONSTRUCTIONAPI_EXPORT
119 void setByCylindricalFace(const ModelHighAPI_Selection& theCylindricalFace);
122 CONSTRUCTIONAPI_EXPORT
123 void setByPointAndDirection(const ModelHighAPI_Selection& thePoint,
124 const ModelHighAPI_Double& theX,
125 const ModelHighAPI_Double& theY,
126 const ModelHighAPI_Double& theZ);
129 CONSTRUCTIONAPI_EXPORT
130 void setByDimensions(const ModelHighAPI_Double& theDX,
131 const ModelHighAPI_Double& theDY,
132 const ModelHighAPI_Double& theDZ);
135 CONSTRUCTIONAPI_EXPORT
136 void setByLine(const ModelHighAPI_Selection& theCylindricalFace);
138 /// Set by plane and point
139 CONSTRUCTIONAPI_EXPORT
140 void setByPlaneAndPoint(const ModelHighAPI_Selection& thePlane,
141 const ModelHighAPI_Selection& thePoint);
143 /// Set by two planes
144 CONSTRUCTIONAPI_EXPORT
145 void setByTwoPlanes(const ModelHighAPI_Selection& thePlane1,
146 const ModelHighAPI_Selection& thePlane2);
148 /// Set by two planes
149 CONSTRUCTIONAPI_EXPORT
150 void setByTwoPlanes(const ModelHighAPI_Selection& thePlane1,
151 const ModelHighAPI_Double& theOffset1,
152 const bool theReverseOffset1,
153 const ModelHighAPI_Selection& thePlane2,
154 const ModelHighAPI_Double& theOffset2,
155 const bool theReverseOffset2);
157 /// Set by two planes
158 CONSTRUCTIONAPI_EXPORT
159 void setByTwoPlanes(const ModelHighAPI_Selection& thePlane1,
160 const ModelHighAPI_Selection& thePlane2,
161 const ModelHighAPI_Double& theOffset2,
162 const bool theReverseOffset2);
164 /// Set by two planes
165 CONSTRUCTIONAPI_EXPORT
166 void setByTwoPlanes(const ModelHighAPI_Selection& thePlane1,
167 const ModelHighAPI_Double& theOffset1,
168 const bool theReverseOffset1,
169 const ModelHighAPI_Selection& thePlane2);
171 /// Dump wrapped feature
172 CONSTRUCTIONAPI_EXPORT
173 virtual void dump(ModelHighAPI_Dumper& theDumper) const;
176 /// Pointer on Axis object
177 typedef std::shared_ptr<ConstructionAPI_Axis> AxisPtr;
179 /// \ingroup CPPHighAPI
180 /// \brief Create Axis feature
181 CONSTRUCTIONAPI_EXPORT
182 AxisPtr addAxis(const std::shared_ptr<ModelAPI_Document>& thePart,
183 const ModelHighAPI_Selection& theObject1,
184 const ModelHighAPI_Selection& theObject2);
186 /// \ingroup CPPHighAPI
187 /// \brief Create Axis feature
188 CONSTRUCTIONAPI_EXPORT
189 AxisPtr addAxis(const std::shared_ptr<ModelAPI_Document>& thePart,
190 const ModelHighAPI_Selection& theObject);
192 /// \ingroup CPPHighAPI
193 /// \brief Create Axis feature
194 CONSTRUCTIONAPI_EXPORT
195 AxisPtr addAxis(const std::shared_ptr<ModelAPI_Document>& thePart,
196 const ModelHighAPI_Selection& thePoint,
197 const ModelHighAPI_Double& theX,
198 const ModelHighAPI_Double& theY,
199 const ModelHighAPI_Double& theZ);
201 /// \ingroup CPPHighAPI
202 /// \brief Create Axis feature
203 CONSTRUCTIONAPI_EXPORT
204 AxisPtr addAxis(const std::shared_ptr<ModelAPI_Document>& thePart,
205 const ModelHighAPI_Double& theDX,
206 const ModelHighAPI_Double& theDY,
207 const ModelHighAPI_Double& theDZ);
209 /// \ingroup CPPHighAPI
210 /// \brief Create Axis feature
211 CONSTRUCTIONAPI_EXPORT
212 AxisPtr addAxis(const std::shared_ptr<ModelAPI_Document>& thePart,
213 const ModelHighAPI_Selection& thePlane1,
214 const ModelHighAPI_Double& theOffset1,
215 const bool theReverseOffset1,
216 const ModelHighAPI_Selection& thePlane2,
217 const ModelHighAPI_Double& theOffset2,
218 const bool theReverseOffset2);
220 /// \ingroup CPPHighAPI
221 /// \brief Create Axis feature
222 CONSTRUCTIONAPI_EXPORT
223 AxisPtr addAxis(const std::shared_ptr<ModelAPI_Document>& thePart,
224 const ModelHighAPI_Selection& thePlane1,
225 const ModelHighAPI_Selection& thePlane2,
226 const ModelHighAPI_Double& theOffset2,
227 const bool theReverseOffset2);
229 /// \ingroup CPPHighAPI
230 /// \brief Create Axis feature
231 CONSTRUCTIONAPI_EXPORT
232 AxisPtr addAxis(const std::shared_ptr<ModelAPI_Document>& thePart,
233 const ModelHighAPI_Selection& thePlane1,
234 const ModelHighAPI_Double& theOffset1,
235 const bool theReverseOffset1,
236 const ModelHighAPI_Selection& thePlane2);
238 #endif /* SRC_CONSTRUCTIONAPI_CONSTRUCTIONAPI_AXIS_H_ */