1 // Copyright (C) 2014-2019 CEA/DEN, EDF R&D
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License, or (at your option) any later version.
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 // Lesser General Public License for more details.
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
20 #ifndef SRC_CONSTRUCTIONAPI_CONSTRUCTIONAPI_AXIS_H_
21 #define SRC_CONSTRUCTIONAPI_CONSTRUCTIONAPI_AXIS_H_
23 #include "ConstructionAPI.h"
25 #include <ConstructionPlugin_Axis.h>
27 #include <ModelHighAPI_Interface.h>
28 #include <ModelHighAPI_Macro.h>
30 class ModelHighAPI_Double;
31 class ModelHighAPI_Selection;
33 /// \class ConstructionAPI_Axis
34 /// \ingroup CPPHighAPI
35 /// \brief Interface for Axis feature
36 class ConstructionAPI_Axis: public ModelHighAPI_Interface
39 /// Constructor without values
40 CONSTRUCTIONAPI_EXPORT
41 explicit ConstructionAPI_Axis(const std::shared_ptr<ModelAPI_Feature>& theFeature);
43 /// Constructor with values
44 CONSTRUCTIONAPI_EXPORT
45 ConstructionAPI_Axis(const std::shared_ptr<ModelAPI_Feature>& theFeature,
46 const ModelHighAPI_Selection& theObject1,
47 const ModelHighAPI_Selection& theObject2);
49 /// Constructor with values
50 CONSTRUCTIONAPI_EXPORT
51 ConstructionAPI_Axis(const std::shared_ptr<ModelAPI_Feature>& theFeature,
52 const ModelHighAPI_Selection& theObject);
54 /// Constructor with values
55 CONSTRUCTIONAPI_EXPORT
56 ConstructionAPI_Axis(const std::shared_ptr<ModelAPI_Feature>& theFeature,
57 const ModelHighAPI_Selection& thePoint,
58 const ModelHighAPI_Double& theX,
59 const ModelHighAPI_Double& theY,
60 const ModelHighAPI_Double& theZ);
62 /// Constructor with values
63 CONSTRUCTIONAPI_EXPORT
64 ConstructionAPI_Axis(const std::shared_ptr<ModelAPI_Feature>& theFeature,
65 const ModelHighAPI_Double& theDX,
66 const ModelHighAPI_Double& theDY,
67 const ModelHighAPI_Double& theDZ);
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_Double& theOffset1,
74 const bool theReverseOffset1,
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_Selection& thePlane2,
84 const ModelHighAPI_Double& theOffset2,
85 const bool theReverseOffset2);
87 /// Constructor with values
88 CONSTRUCTIONAPI_EXPORT
89 ConstructionAPI_Axis(const std::shared_ptr<ModelAPI_Feature>& theFeature,
90 const ModelHighAPI_Selection& thePlane1,
91 const ModelHighAPI_Double& theOffset1,
92 const bool theReverseOffset1,
93 const ModelHighAPI_Selection& thePlane2);
96 CONSTRUCTIONAPI_EXPORT
97 virtual ~ConstructionAPI_Axis();
99 INTERFACE_21(ConstructionPlugin_Axis::ID(),
100 creationMethod, ConstructionPlugin_Axis::METHOD(),
101 ModelAPI_AttributeString, /** Creation method */,
102 firstPoint, ConstructionPlugin_Axis::POINT_FIRST(),
103 ModelAPI_AttributeSelection, /** First point */,
104 secondPoint, ConstructionPlugin_Axis::POINT_SECOND(),
105 ModelAPI_AttributeSelection, /** Second point */,
106 cylindricalFace, ConstructionPlugin_Axis::CYLINDRICAL_FACE(),
107 ModelAPI_AttributeSelection, /** Cylindrical face */,
108 xDirection, ConstructionPlugin_Axis::X_DIRECTION(),
109 ModelAPI_AttributeDouble, /** X direction */,
110 yDirection, ConstructionPlugin_Axis::Y_DIRECTION(),
111 ModelAPI_AttributeDouble, /** Y direction */,
112 zDirection, ConstructionPlugin_Axis::Z_DIRECTION(),
113 ModelAPI_AttributeDouble, /** Z direction */,
114 xDimension, ConstructionPlugin_Axis::DX(),
115 ModelAPI_AttributeDouble, /** X dimension */,
116 yDimension, ConstructionPlugin_Axis::DY(),
117 ModelAPI_AttributeDouble, /** Y dimension */,
118 zDimension, ConstructionPlugin_Axis::DZ(),
119 ModelAPI_AttributeDouble, /** Z dimension */,
120 line, ConstructionPlugin_Axis::LINE(),
121 ModelAPI_AttributeSelection, /** Line */,
122 plane, ConstructionPlugin_Axis::PLANE(),
123 ModelAPI_AttributeSelection, /** Plane */,
124 point, ConstructionPlugin_Axis::POINT(),
125 ModelAPI_AttributeSelection, /** Point */,
126 plane1, ConstructionPlugin_Axis::PLANE1(),
127 ModelAPI_AttributeSelection, /** Plane 1 */,
128 useOffset1, ConstructionPlugin_Axis::USE_OFFSET1(),
129 ModelAPI_AttributeString, /** Use offset 1 */,
130 offset1, ConstructionPlugin_Axis::OFFSET1(),
131 ModelAPI_AttributeDouble, /** Offset 1 */,
132 reverseOffset1, ConstructionPlugin_Axis::REVERSE_OFFSET1(),
133 ModelAPI_AttributeBoolean, /** Reverse offset 1 */,
134 plane2, ConstructionPlugin_Axis::PLANE2(),
135 ModelAPI_AttributeSelection, /** Plane 2 */,
136 useOffset2, ConstructionPlugin_Axis::USE_OFFSET2(),
137 ModelAPI_AttributeString, /** Use offset 2 */,
138 offset2, ConstructionPlugin_Axis::OFFSET2(),
139 ModelAPI_AttributeDouble, /** Offset 2 */,
140 reverseOffset2, ConstructionPlugin_Axis::REVERSE_OFFSET2(),
141 ModelAPI_AttributeBoolean, /** Reverse offset 2 */)
144 CONSTRUCTIONAPI_EXPORT
145 void setByPoints(const ModelHighAPI_Selection& thePoint1,
146 const ModelHighAPI_Selection& thePoint2);
148 /// Set cylindrical face
149 CONSTRUCTIONAPI_EXPORT
150 void setByCylindricalFace(const ModelHighAPI_Selection& theCylindricalFace);
153 CONSTRUCTIONAPI_EXPORT
154 void setByPointAndDirection(const ModelHighAPI_Selection& thePoint,
155 const ModelHighAPI_Double& theX,
156 const ModelHighAPI_Double& theY,
157 const ModelHighAPI_Double& theZ);
160 CONSTRUCTIONAPI_EXPORT
161 void setByDimensions(const ModelHighAPI_Double& theDX,
162 const ModelHighAPI_Double& theDY,
163 const ModelHighAPI_Double& theDZ);
166 CONSTRUCTIONAPI_EXPORT
167 void setByLine(const ModelHighAPI_Selection& theCylindricalFace);
169 /// Set by plane and point
170 CONSTRUCTIONAPI_EXPORT
171 void setByPlaneAndPoint(const ModelHighAPI_Selection& thePlane,
172 const ModelHighAPI_Selection& thePoint);
174 /// Set by two planes
175 CONSTRUCTIONAPI_EXPORT
176 void setByTwoPlanes(const ModelHighAPI_Selection& thePlane1,
177 const ModelHighAPI_Selection& thePlane2);
179 /// Set by two planes
180 CONSTRUCTIONAPI_EXPORT
181 void setByTwoPlanes(const ModelHighAPI_Selection& thePlane1,
182 const ModelHighAPI_Double& theOffset1,
183 const bool theReverseOffset1,
184 const ModelHighAPI_Selection& thePlane2,
185 const ModelHighAPI_Double& theOffset2,
186 const bool theReverseOffset2);
188 /// Set by two planes
189 CONSTRUCTIONAPI_EXPORT
190 void setByTwoPlanes(const ModelHighAPI_Selection& thePlane1,
191 const ModelHighAPI_Selection& thePlane2,
192 const ModelHighAPI_Double& theOffset2,
193 const bool theReverseOffset2);
195 /// Set by two planes
196 CONSTRUCTIONAPI_EXPORT
197 void setByTwoPlanes(const ModelHighAPI_Selection& thePlane1,
198 const ModelHighAPI_Double& theOffset1,
199 const bool theReverseOffset1,
200 const ModelHighAPI_Selection& thePlane2);
202 /// Dump wrapped feature
203 CONSTRUCTIONAPI_EXPORT
204 virtual void dump(ModelHighAPI_Dumper& theDumper) const;
207 /// Pointer on Axis object
208 typedef std::shared_ptr<ConstructionAPI_Axis> AxisPtr;
210 /// \ingroup CPPHighAPI
211 /// \brief Create Axis feature
212 CONSTRUCTIONAPI_EXPORT
213 AxisPtr addAxis(const std::shared_ptr<ModelAPI_Document>& thePart,
214 const ModelHighAPI_Selection& theObject1,
215 const ModelHighAPI_Selection& theObject2);
217 /// \ingroup CPPHighAPI
218 /// \brief Create Axis feature
219 CONSTRUCTIONAPI_EXPORT
220 AxisPtr addAxis(const std::shared_ptr<ModelAPI_Document>& thePart,
221 const ModelHighAPI_Selection& theObject);
223 /// \ingroup CPPHighAPI
224 /// \brief Create Axis feature
225 CONSTRUCTIONAPI_EXPORT
226 AxisPtr addAxis(const std::shared_ptr<ModelAPI_Document>& thePart,
227 const ModelHighAPI_Selection& thePoint,
228 const ModelHighAPI_Double& theX,
229 const ModelHighAPI_Double& theY,
230 const ModelHighAPI_Double& theZ);
232 /// \ingroup CPPHighAPI
233 /// \brief Create Axis feature
234 CONSTRUCTIONAPI_EXPORT
235 AxisPtr addAxis(const std::shared_ptr<ModelAPI_Document>& thePart,
236 const ModelHighAPI_Double& theDX,
237 const ModelHighAPI_Double& theDY,
238 const ModelHighAPI_Double& theDZ);
240 /// \ingroup CPPHighAPI
241 /// \brief Create Axis feature
242 CONSTRUCTIONAPI_EXPORT
243 AxisPtr addAxis(const std::shared_ptr<ModelAPI_Document>& thePart,
244 const ModelHighAPI_Selection& thePlane1,
245 const ModelHighAPI_Double& theOffset1,
246 const bool theReverseOffset1,
247 const ModelHighAPI_Selection& thePlane2,
248 const ModelHighAPI_Double& theOffset2,
249 const bool theReverseOffset2);
251 /// \ingroup CPPHighAPI
252 /// \brief Create Axis feature
253 CONSTRUCTIONAPI_EXPORT
254 AxisPtr addAxis(const std::shared_ptr<ModelAPI_Document>& thePart,
255 const ModelHighAPI_Selection& thePlane1,
256 const ModelHighAPI_Selection& thePlane2,
257 const ModelHighAPI_Double& theOffset2,
258 const bool theReverseOffset2);
260 /// \ingroup CPPHighAPI
261 /// \brief Create Axis feature
262 CONSTRUCTIONAPI_EXPORT
263 AxisPtr addAxis(const std::shared_ptr<ModelAPI_Document>& thePart,
264 const ModelHighAPI_Selection& thePlane1,
265 const ModelHighAPI_Double& theOffset1,
266 const bool theReverseOffset1,
267 const ModelHighAPI_Selection& thePlane2);
269 #endif /* SRC_CONSTRUCTIONAPI_CONSTRUCTIONAPI_AXIS_H_ */