1 // Copyright (C) 2014-2016 CEA/DEN, EDF R&D
3 // Copyright (C) 2014-2016 CEA/DEN, EDF R&D
5 // Name : ConstructionAPI_Axis.h
9 // 15/06/16 - Sergey POKHODENKO - Creation of the file
10 // 24/06/16 - Clarisse GENRAULT (CEA) - Modification of the file
12 #ifndef SRC_CONSTRUCTIONAPI_CONSTRUCTIONAPI_AXIS_H_
13 #define SRC_CONSTRUCTIONAPI_CONSTRUCTIONAPI_AXIS_H_
15 #include "ConstructionAPI.h"
17 #include <ConstructionPlugin_Axis.h>
19 #include <ModelHighAPI_Interface.h>
20 #include <ModelHighAPI_Macro.h>
22 class ModelHighAPI_Double;
23 class ModelHighAPI_Selection;
25 /// \class ConstructionAPI_Axis
26 /// \ingroup CPPHighAPI
27 /// \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);
35 /// Constructor with values
36 CONSTRUCTIONAPI_EXPORT
37 ConstructionAPI_Axis(const std::shared_ptr<ModelAPI_Feature>& theFeature,
38 const ModelHighAPI_Selection& theObject1,
39 const ModelHighAPI_Selection& theObject2);
41 /// Constructor with values
42 CONSTRUCTIONAPI_EXPORT
43 ConstructionAPI_Axis(const std::shared_ptr<ModelAPI_Feature>& theFeature,
44 const ModelHighAPI_Selection& theObject);
46 /// Constructor with values
47 CONSTRUCTIONAPI_EXPORT
48 ConstructionAPI_Axis(const std::shared_ptr<ModelAPI_Feature>& theFeature,
49 const ModelHighAPI_Selection& thePoint,
50 const ModelHighAPI_Double& theX,
51 const ModelHighAPI_Double& theY,
52 const ModelHighAPI_Double& theZ);
54 /// Constructor with values
55 CONSTRUCTIONAPI_EXPORT
56 ConstructionAPI_Axis(const std::shared_ptr<ModelAPI_Feature>& theFeature,
57 const ModelHighAPI_Double& theDX,
58 const ModelHighAPI_Double& theDY,
59 const ModelHighAPI_Double& theDZ);
61 /// Constructor with values
62 CONSTRUCTIONAPI_EXPORT
63 ConstructionAPI_Axis(const std::shared_ptr<ModelAPI_Feature>& theFeature,
64 const ModelHighAPI_Selection& thePlane1,
65 const ModelHighAPI_Double& theOffset1,
66 const bool theReverseOffset1,
67 const ModelHighAPI_Selection& thePlane2,
68 const ModelHighAPI_Double& theOffset2,
69 const bool theReverseOffset2);
71 /// Constructor with values
72 CONSTRUCTIONAPI_EXPORT
73 ConstructionAPI_Axis(const std::shared_ptr<ModelAPI_Feature>& theFeature,
74 const ModelHighAPI_Selection& thePlane1,
75 const ModelHighAPI_Selection& thePlane2,
76 const ModelHighAPI_Double& theOffset2,
77 const bool theReverseOffset2);
79 /// Constructor with values
80 CONSTRUCTIONAPI_EXPORT
81 ConstructionAPI_Axis(const std::shared_ptr<ModelAPI_Feature>& theFeature,
82 const ModelHighAPI_Selection& thePlane1,
83 const ModelHighAPI_Double& theOffset1,
84 const bool theReverseOffset1,
85 const ModelHighAPI_Selection& thePlane2);
88 CONSTRUCTIONAPI_EXPORT
89 virtual ~ConstructionAPI_Axis();
91 INTERFACE_21(ConstructionPlugin_Axis::ID(),
92 creationMethod, ConstructionPlugin_Axis::METHOD(),
93 ModelAPI_AttributeString, /** Creation method */,
94 firstPoint, ConstructionPlugin_Axis::POINT_FIRST(),
95 ModelAPI_AttributeSelection, /** First point */,
96 secondPoint, ConstructionPlugin_Axis::POINT_SECOND(),
97 ModelAPI_AttributeSelection, /** Second point */,
98 cylindricalFace, ConstructionPlugin_Axis::CYLINDRICAL_FACE(),
99 ModelAPI_AttributeSelection, /** Cylindrical face */,
100 xDirection, ConstructionPlugin_Axis::X_DIRECTION(),
101 ModelAPI_AttributeDouble, /** X direction */,
102 yDirection, ConstructionPlugin_Axis::Y_DIRECTION(),
103 ModelAPI_AttributeDouble, /** Y direction */,
104 zDirection, ConstructionPlugin_Axis::Z_DIRECTION(),
105 ModelAPI_AttributeDouble, /** Z direction */,
106 xDimension, ConstructionPlugin_Axis::DX(),
107 ModelAPI_AttributeDouble, /** X dimension */,
108 yDimension, ConstructionPlugin_Axis::DY(),
109 ModelAPI_AttributeDouble, /** Y dimension */,
110 zDimension, ConstructionPlugin_Axis::DZ(),
111 ModelAPI_AttributeDouble, /** Z dimension */,
112 line, ConstructionPlugin_Axis::LINE(),
113 ModelAPI_AttributeSelection, /** Line */,
114 plane, ConstructionPlugin_Axis::PLANE(),
115 ModelAPI_AttributeSelection, /** Plane */,
116 point, ConstructionPlugin_Axis::POINT(),
117 ModelAPI_AttributeSelection, /** Point */,
118 plane1, ConstructionPlugin_Axis::PLANE1(),
119 ModelAPI_AttributeSelection, /** Plane 1 */,
120 useOffset1, ConstructionPlugin_Axis::USE_OFFSET1(),
121 ModelAPI_AttributeString, /** Use offset 1 */,
122 offset1, ConstructionPlugin_Axis::OFFSET1(),
123 ModelAPI_AttributeDouble, /** Offset 1 */,
124 reverseOffset1, ConstructionPlugin_Axis::REVERSE_OFFSET1(),
125 ModelAPI_AttributeBoolean, /** Reverse offset 1 */,
126 plane2, ConstructionPlugin_Axis::PLANE2(),
127 ModelAPI_AttributeSelection, /** Plane 2 */,
128 useOffset2, ConstructionPlugin_Axis::USE_OFFSET2(),
129 ModelAPI_AttributeString, /** Use offset 2 */,
130 offset2, ConstructionPlugin_Axis::OFFSET2(),
131 ModelAPI_AttributeDouble, /** Offset 2 */,
132 reverseOffset2, ConstructionPlugin_Axis::REVERSE_OFFSET2(),
133 ModelAPI_AttributeBoolean, /** Reverse offset 2 */)
136 CONSTRUCTIONAPI_EXPORT
137 void setByPoints(const ModelHighAPI_Selection& thePoint1,
138 const ModelHighAPI_Selection& thePoint2);
140 /// Set cylindrical face
141 CONSTRUCTIONAPI_EXPORT
142 void setByCylindricalFace(const ModelHighAPI_Selection& theCylindricalFace);
145 CONSTRUCTIONAPI_EXPORT
146 void setByPointAndDirection(const ModelHighAPI_Selection& thePoint,
147 const ModelHighAPI_Double& theX,
148 const ModelHighAPI_Double& theY,
149 const ModelHighAPI_Double& theZ);
152 CONSTRUCTIONAPI_EXPORT
153 void setByDimensions(const ModelHighAPI_Double& theDX,
154 const ModelHighAPI_Double& theDY,
155 const ModelHighAPI_Double& theDZ);
158 CONSTRUCTIONAPI_EXPORT
159 void setByLine(const ModelHighAPI_Selection& theCylindricalFace);
161 /// Set by plane and point
162 CONSTRUCTIONAPI_EXPORT
163 void setByPlaneAndPoint(const ModelHighAPI_Selection& thePlane,
164 const ModelHighAPI_Selection& thePoint);
166 /// Set by two planes
167 CONSTRUCTIONAPI_EXPORT
168 void setByTwoPlanes(const ModelHighAPI_Selection& thePlane1,
169 const ModelHighAPI_Selection& thePlane2);
171 /// Set by two planes
172 CONSTRUCTIONAPI_EXPORT
173 void setByTwoPlanes(const ModelHighAPI_Selection& thePlane1,
174 const ModelHighAPI_Double& theOffset1,
175 const bool theReverseOffset1,
176 const ModelHighAPI_Selection& thePlane2,
177 const ModelHighAPI_Double& theOffset2,
178 const bool theReverseOffset2);
180 /// Set by two planes
181 CONSTRUCTIONAPI_EXPORT
182 void setByTwoPlanes(const ModelHighAPI_Selection& thePlane1,
183 const ModelHighAPI_Selection& thePlane2,
184 const ModelHighAPI_Double& theOffset2,
185 const bool theReverseOffset2);
187 /// Set by two planes
188 CONSTRUCTIONAPI_EXPORT
189 void setByTwoPlanes(const ModelHighAPI_Selection& thePlane1,
190 const ModelHighAPI_Double& theOffset1,
191 const bool theReverseOffset1,
192 const ModelHighAPI_Selection& thePlane2);
194 /// Dump wrapped feature
195 CONSTRUCTIONAPI_EXPORT
196 virtual void dump(ModelHighAPI_Dumper& theDumper) const;
199 /// Pointer on Axis object
200 typedef std::shared_ptr<ConstructionAPI_Axis> AxisPtr;
202 /// \ingroup CPPHighAPI
203 /// \brief Create Axis feature
204 CONSTRUCTIONAPI_EXPORT
205 AxisPtr addAxis(const std::shared_ptr<ModelAPI_Document>& thePart,
206 const ModelHighAPI_Selection& theObject1,
207 const ModelHighAPI_Selection& theObject2);
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& theObject);
215 /// \ingroup CPPHighAPI
216 /// \brief Create Axis feature
217 CONSTRUCTIONAPI_EXPORT
218 AxisPtr addAxis(const std::shared_ptr<ModelAPI_Document>& thePart,
219 const ModelHighAPI_Selection& thePoint,
220 const ModelHighAPI_Double& theX,
221 const ModelHighAPI_Double& theY,
222 const ModelHighAPI_Double& theZ);
224 /// \ingroup CPPHighAPI
225 /// \brief Create Axis feature
226 CONSTRUCTIONAPI_EXPORT
227 AxisPtr addAxis(const std::shared_ptr<ModelAPI_Document>& thePart,
228 const ModelHighAPI_Double& theDX,
229 const ModelHighAPI_Double& theDY,
230 const ModelHighAPI_Double& theDZ);
232 /// \ingroup CPPHighAPI
233 /// \brief Create Axis feature
234 CONSTRUCTIONAPI_EXPORT
235 AxisPtr addAxis(const std::shared_ptr<ModelAPI_Document>& thePart,
236 const ModelHighAPI_Selection& thePlane1,
237 const ModelHighAPI_Double& theOffset1,
238 const bool theReverseOffset1,
239 const ModelHighAPI_Selection& thePlane2,
240 const ModelHighAPI_Double& theOffset2,
241 const bool theReverseOffset2);
243 /// \ingroup CPPHighAPI
244 /// \brief Create Axis feature
245 CONSTRUCTIONAPI_EXPORT
246 AxisPtr addAxis(const std::shared_ptr<ModelAPI_Document>& thePart,
247 const ModelHighAPI_Selection& thePlane1,
248 const ModelHighAPI_Selection& thePlane2,
249 const ModelHighAPI_Double& theOffset2,
250 const bool theReverseOffset2);
252 /// \ingroup CPPHighAPI
253 /// \brief Create Axis feature
254 CONSTRUCTIONAPI_EXPORT
255 AxisPtr addAxis(const std::shared_ptr<ModelAPI_Document>& thePart,
256 const ModelHighAPI_Selection& thePlane1,
257 const ModelHighAPI_Double& theOffset1,
258 const bool theReverseOffset1,
259 const ModelHighAPI_Selection& thePlane2);
261 #endif /* SRC_CONSTRUCTIONAPI_CONSTRUCTIONAPI_AXIS_H_ */