1 // Copyright (C) 2014-2017 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
18 // email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
21 #ifndef SRC_CONSTRUCTIONAPI_CONSTRUCTIONAPI_AXIS_H_
22 #define SRC_CONSTRUCTIONAPI_CONSTRUCTIONAPI_AXIS_H_
24 #include "ConstructionAPI.h"
26 #include <ConstructionPlugin_Axis.h>
28 #include <ModelHighAPI_Interface.h>
29 #include <ModelHighAPI_Macro.h>
31 class ModelHighAPI_Double;
32 class ModelHighAPI_Selection;
34 /// \class ConstructionAPI_Axis
35 /// \ingroup CPPHighAPI
36 /// \brief Interface for Axis feature
37 class ConstructionAPI_Axis: public ModelHighAPI_Interface
40 /// Constructor without values
41 CONSTRUCTIONAPI_EXPORT
42 explicit ConstructionAPI_Axis(const std::shared_ptr<ModelAPI_Feature>& theFeature);
44 /// Constructor with values
45 CONSTRUCTIONAPI_EXPORT
46 ConstructionAPI_Axis(const std::shared_ptr<ModelAPI_Feature>& theFeature,
47 const ModelHighAPI_Selection& theObject1,
48 const ModelHighAPI_Selection& theObject2);
50 /// Constructor with values
51 CONSTRUCTIONAPI_EXPORT
52 ConstructionAPI_Axis(const std::shared_ptr<ModelAPI_Feature>& theFeature,
53 const ModelHighAPI_Selection& theObject);
55 /// Constructor with values
56 CONSTRUCTIONAPI_EXPORT
57 ConstructionAPI_Axis(const std::shared_ptr<ModelAPI_Feature>& theFeature,
58 const ModelHighAPI_Selection& thePoint,
59 const ModelHighAPI_Double& theX,
60 const ModelHighAPI_Double& theY,
61 const ModelHighAPI_Double& theZ);
63 /// Constructor with values
64 CONSTRUCTIONAPI_EXPORT
65 ConstructionAPI_Axis(const std::shared_ptr<ModelAPI_Feature>& theFeature,
66 const ModelHighAPI_Double& theDX,
67 const ModelHighAPI_Double& theDY,
68 const ModelHighAPI_Double& theDZ);
70 /// Constructor with values
71 CONSTRUCTIONAPI_EXPORT
72 ConstructionAPI_Axis(const std::shared_ptr<ModelAPI_Feature>& theFeature,
73 const ModelHighAPI_Selection& thePlane1,
74 const ModelHighAPI_Double& theOffset1,
75 const bool theReverseOffset1,
76 const ModelHighAPI_Selection& thePlane2,
77 const ModelHighAPI_Double& theOffset2,
78 const bool theReverseOffset2);
80 /// Constructor with values
81 CONSTRUCTIONAPI_EXPORT
82 ConstructionAPI_Axis(const std::shared_ptr<ModelAPI_Feature>& theFeature,
83 const ModelHighAPI_Selection& thePlane1,
84 const ModelHighAPI_Selection& thePlane2,
85 const ModelHighAPI_Double& theOffset2,
86 const bool theReverseOffset2);
88 /// Constructor with values
89 CONSTRUCTIONAPI_EXPORT
90 ConstructionAPI_Axis(const std::shared_ptr<ModelAPI_Feature>& theFeature,
91 const ModelHighAPI_Selection& thePlane1,
92 const ModelHighAPI_Double& theOffset1,
93 const bool theReverseOffset1,
94 const ModelHighAPI_Selection& thePlane2);
97 CONSTRUCTIONAPI_EXPORT
98 virtual ~ConstructionAPI_Axis();
100 INTERFACE_21(ConstructionPlugin_Axis::ID(),
101 creationMethod, ConstructionPlugin_Axis::METHOD(),
102 ModelAPI_AttributeString, /** Creation method */,
103 firstPoint, ConstructionPlugin_Axis::POINT_FIRST(),
104 ModelAPI_AttributeSelection, /** First point */,
105 secondPoint, ConstructionPlugin_Axis::POINT_SECOND(),
106 ModelAPI_AttributeSelection, /** Second point */,
107 cylindricalFace, ConstructionPlugin_Axis::CYLINDRICAL_FACE(),
108 ModelAPI_AttributeSelection, /** Cylindrical face */,
109 xDirection, ConstructionPlugin_Axis::X_DIRECTION(),
110 ModelAPI_AttributeDouble, /** X direction */,
111 yDirection, ConstructionPlugin_Axis::Y_DIRECTION(),
112 ModelAPI_AttributeDouble, /** Y direction */,
113 zDirection, ConstructionPlugin_Axis::Z_DIRECTION(),
114 ModelAPI_AttributeDouble, /** Z direction */,
115 xDimension, ConstructionPlugin_Axis::DX(),
116 ModelAPI_AttributeDouble, /** X dimension */,
117 yDimension, ConstructionPlugin_Axis::DY(),
118 ModelAPI_AttributeDouble, /** Y dimension */,
119 zDimension, ConstructionPlugin_Axis::DZ(),
120 ModelAPI_AttributeDouble, /** Z dimension */,
121 line, ConstructionPlugin_Axis::LINE(),
122 ModelAPI_AttributeSelection, /** Line */,
123 plane, ConstructionPlugin_Axis::PLANE(),
124 ModelAPI_AttributeSelection, /** Plane */,
125 point, ConstructionPlugin_Axis::POINT(),
126 ModelAPI_AttributeSelection, /** Point */,
127 plane1, ConstructionPlugin_Axis::PLANE1(),
128 ModelAPI_AttributeSelection, /** Plane 1 */,
129 useOffset1, ConstructionPlugin_Axis::USE_OFFSET1(),
130 ModelAPI_AttributeString, /** Use offset 1 */,
131 offset1, ConstructionPlugin_Axis::OFFSET1(),
132 ModelAPI_AttributeDouble, /** Offset 1 */,
133 reverseOffset1, ConstructionPlugin_Axis::REVERSE_OFFSET1(),
134 ModelAPI_AttributeBoolean, /** Reverse offset 1 */,
135 plane2, ConstructionPlugin_Axis::PLANE2(),
136 ModelAPI_AttributeSelection, /** Plane 2 */,
137 useOffset2, ConstructionPlugin_Axis::USE_OFFSET2(),
138 ModelAPI_AttributeString, /** Use offset 2 */,
139 offset2, ConstructionPlugin_Axis::OFFSET2(),
140 ModelAPI_AttributeDouble, /** Offset 2 */,
141 reverseOffset2, ConstructionPlugin_Axis::REVERSE_OFFSET2(),
142 ModelAPI_AttributeBoolean, /** Reverse offset 2 */)
145 CONSTRUCTIONAPI_EXPORT
146 void setByPoints(const ModelHighAPI_Selection& thePoint1,
147 const ModelHighAPI_Selection& thePoint2);
149 /// Set cylindrical face
150 CONSTRUCTIONAPI_EXPORT
151 void setByCylindricalFace(const ModelHighAPI_Selection& theCylindricalFace);
154 CONSTRUCTIONAPI_EXPORT
155 void setByPointAndDirection(const ModelHighAPI_Selection& thePoint,
156 const ModelHighAPI_Double& theX,
157 const ModelHighAPI_Double& theY,
158 const ModelHighAPI_Double& theZ);
161 CONSTRUCTIONAPI_EXPORT
162 void setByDimensions(const ModelHighAPI_Double& theDX,
163 const ModelHighAPI_Double& theDY,
164 const ModelHighAPI_Double& theDZ);
167 CONSTRUCTIONAPI_EXPORT
168 void setByLine(const ModelHighAPI_Selection& theCylindricalFace);
170 /// Set by plane and point
171 CONSTRUCTIONAPI_EXPORT
172 void setByPlaneAndPoint(const ModelHighAPI_Selection& thePlane,
173 const ModelHighAPI_Selection& thePoint);
175 /// Set by two planes
176 CONSTRUCTIONAPI_EXPORT
177 void setByTwoPlanes(const ModelHighAPI_Selection& thePlane1,
178 const ModelHighAPI_Selection& thePlane2);
180 /// Set by two planes
181 CONSTRUCTIONAPI_EXPORT
182 void setByTwoPlanes(const ModelHighAPI_Selection& thePlane1,
183 const ModelHighAPI_Double& theOffset1,
184 const bool theReverseOffset1,
185 const ModelHighAPI_Selection& thePlane2,
186 const ModelHighAPI_Double& theOffset2,
187 const bool theReverseOffset2);
189 /// Set by two planes
190 CONSTRUCTIONAPI_EXPORT
191 void setByTwoPlanes(const ModelHighAPI_Selection& thePlane1,
192 const ModelHighAPI_Selection& thePlane2,
193 const ModelHighAPI_Double& theOffset2,
194 const bool theReverseOffset2);
196 /// Set by two planes
197 CONSTRUCTIONAPI_EXPORT
198 void setByTwoPlanes(const ModelHighAPI_Selection& thePlane1,
199 const ModelHighAPI_Double& theOffset1,
200 const bool theReverseOffset1,
201 const ModelHighAPI_Selection& thePlane2);
203 /// Dump wrapped feature
204 CONSTRUCTIONAPI_EXPORT
205 virtual void dump(ModelHighAPI_Dumper& theDumper) const;
208 /// Pointer on Axis object
209 typedef std::shared_ptr<ConstructionAPI_Axis> AxisPtr;
211 /// \ingroup CPPHighAPI
212 /// \brief Create Axis feature
213 CONSTRUCTIONAPI_EXPORT
214 AxisPtr addAxis(const std::shared_ptr<ModelAPI_Document>& thePart,
215 const ModelHighAPI_Selection& theObject1,
216 const ModelHighAPI_Selection& theObject2);
218 /// \ingroup CPPHighAPI
219 /// \brief Create Axis feature
220 CONSTRUCTIONAPI_EXPORT
221 AxisPtr addAxis(const std::shared_ptr<ModelAPI_Document>& thePart,
222 const ModelHighAPI_Selection& theObject);
224 /// \ingroup CPPHighAPI
225 /// \brief Create Axis feature
226 CONSTRUCTIONAPI_EXPORT
227 AxisPtr addAxis(const std::shared_ptr<ModelAPI_Document>& thePart,
228 const ModelHighAPI_Selection& thePoint,
229 const ModelHighAPI_Double& theX,
230 const ModelHighAPI_Double& theY,
231 const ModelHighAPI_Double& theZ);
233 /// \ingroup CPPHighAPI
234 /// \brief Create Axis feature
235 CONSTRUCTIONAPI_EXPORT
236 AxisPtr addAxis(const std::shared_ptr<ModelAPI_Document>& thePart,
237 const ModelHighAPI_Double& theDX,
238 const ModelHighAPI_Double& theDY,
239 const ModelHighAPI_Double& theDZ);
241 /// \ingroup CPPHighAPI
242 /// \brief Create Axis feature
243 CONSTRUCTIONAPI_EXPORT
244 AxisPtr addAxis(const std::shared_ptr<ModelAPI_Document>& thePart,
245 const ModelHighAPI_Selection& thePlane1,
246 const ModelHighAPI_Double& theOffset1,
247 const bool theReverseOffset1,
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_Selection& thePlane2,
258 const ModelHighAPI_Double& theOffset2,
259 const bool theReverseOffset2);
261 /// \ingroup CPPHighAPI
262 /// \brief Create Axis feature
263 CONSTRUCTIONAPI_EXPORT
264 AxisPtr addAxis(const std::shared_ptr<ModelAPI_Document>& thePart,
265 const ModelHighAPI_Selection& thePlane1,
266 const ModelHighAPI_Double& theOffset1,
267 const bool theReverseOffset1,
268 const ModelHighAPI_Selection& thePlane2);
270 #endif /* SRC_CONSTRUCTIONAPI_CONSTRUCTIONAPI_AXIS_H_ */