SHAPER 9.16.0
ConstructionAPI_Axis.h
1// Copyright (C) 2014-2026 CEA, EDF
2//
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.
7//
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.
12//
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
16//
17// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
18//
19
20#ifndef SRC_CONSTRUCTIONAPI_CONSTRUCTIONAPI_AXIS_H_
21#define SRC_CONSTRUCTIONAPI_CONSTRUCTIONAPI_AXIS_H_
22
23#include "ConstructionAPI.h"
24
25#include <ConstructionPlugin_Axis.h>
26
27#include <ModelHighAPI_Interface.h>
28#include <ModelHighAPI_Macro.h>
29
32
37{
38public:
40 CONSTRUCTIONAPI_EXPORT
41 explicit ConstructionAPI_Axis(const std::shared_ptr<ModelAPI_Feature>& theFeature);
42
44 CONSTRUCTIONAPI_EXPORT
45 ConstructionAPI_Axis(const std::shared_ptr<ModelAPI_Feature>& theFeature,
46 const ModelHighAPI_Selection& theObject1,
47 const ModelHighAPI_Selection& theObject2);
48
50 CONSTRUCTIONAPI_EXPORT
51 ConstructionAPI_Axis(const std::shared_ptr<ModelAPI_Feature>& theFeature,
52 const ModelHighAPI_Selection& theObject);
53
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);
61
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);
68
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);
78
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);
86
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);
94
96 CONSTRUCTIONAPI_EXPORT
97 virtual ~ConstructionAPI_Axis();
98
99 INTERFACE_21(ConstructionPlugin_Axis::ID(),
142
143
144 CONSTRUCTIONAPI_EXPORT
145 void setByPoints(const ModelHighAPI_Selection& thePoint1,
146 const ModelHighAPI_Selection& thePoint2);
147
149 CONSTRUCTIONAPI_EXPORT
150 void setByCylindricalFace(const ModelHighAPI_Selection& theCylindricalFace);
151
153 CONSTRUCTIONAPI_EXPORT
155 const ModelHighAPI_Double& theX,
156 const ModelHighAPI_Double& theY,
157 const ModelHighAPI_Double& theZ);
158
160 CONSTRUCTIONAPI_EXPORT
161 void setByDimensions(const ModelHighAPI_Double& theDX,
162 const ModelHighAPI_Double& theDY,
163 const ModelHighAPI_Double& theDZ);
164
166 CONSTRUCTIONAPI_EXPORT
167 void setByLine(const ModelHighAPI_Selection& theCylindricalFace);
168
170 CONSTRUCTIONAPI_EXPORT
171 void setByPlaneAndPoint(const ModelHighAPI_Selection& thePlane,
172 const ModelHighAPI_Selection& thePoint);
173
175 CONSTRUCTIONAPI_EXPORT
176 void setByTwoPlanes(const ModelHighAPI_Selection& thePlane1,
177 const ModelHighAPI_Selection& thePlane2);
178
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);
187
189 CONSTRUCTIONAPI_EXPORT
190 void setByTwoPlanes(const ModelHighAPI_Selection& thePlane1,
191 const ModelHighAPI_Selection& thePlane2,
192 const ModelHighAPI_Double& theOffset2,
193 const bool theReverseOffset2);
194
196 CONSTRUCTIONAPI_EXPORT
197 void setByTwoPlanes(const ModelHighAPI_Selection& thePlane1,
198 const ModelHighAPI_Double& theOffset1,
199 const bool theReverseOffset1,
200 const ModelHighAPI_Selection& thePlane2);
201
203 CONSTRUCTIONAPI_EXPORT
204 virtual void dump(ModelHighAPI_Dumper& theDumper) const;
205};
206
208typedef std::shared_ptr<ConstructionAPI_Axis> AxisPtr;
209
212CONSTRUCTIONAPI_EXPORT
213AxisPtr addAxis(const std::shared_ptr<ModelAPI_Document>& thePart,
214 const ModelHighAPI_Selection& theObject1,
215 const ModelHighAPI_Selection& theObject2);
216
219CONSTRUCTIONAPI_EXPORT
220AxisPtr addAxis(const std::shared_ptr<ModelAPI_Document>& thePart,
221 const ModelHighAPI_Selection& theObject);
222
225CONSTRUCTIONAPI_EXPORT
226AxisPtr 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);
231
234CONSTRUCTIONAPI_EXPORT
235AxisPtr addAxis(const std::shared_ptr<ModelAPI_Document>& thePart,
236 const ModelHighAPI_Double& theDX,
237 const ModelHighAPI_Double& theDY,
238 const ModelHighAPI_Double& theDZ);
239
242CONSTRUCTIONAPI_EXPORT
243AxisPtr 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);
250
253CONSTRUCTIONAPI_EXPORT
254AxisPtr 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);
259
262CONSTRUCTIONAPI_EXPORT
263AxisPtr 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);
268
269#endif /* SRC_CONSTRUCTIONAPI_CONSTRUCTIONAPI_AXIS_H_ */
Interface for Axis feature.
Definition: ConstructionAPI_Axis.h:37
void setByDimensions(const ModelHighAPI_Double &theDX, const ModelHighAPI_Double &theDY, const ModelHighAPI_Double &theDZ)
Set dimensions.
Definition: ConstructionAPI_Axis.cpp:175
virtual std::shared_ptr< ModelAPI_AttributeBoolean > reverseOffset2() const
Reverse offset 2.
Definition: ConstructionAPI_Axis.h:141
void setByTwoPlanes(const ModelHighAPI_Selection &thePlane1, const ModelHighAPI_Selection &thePlane2)
Set by two planes.
Definition: ConstructionAPI_Axis.cpp:208
void setByPlaneAndPoint(const ModelHighAPI_Selection &thePlane, const ModelHighAPI_Selection &thePoint)
Set by plane and point.
Definition: ConstructionAPI_Axis.cpp:197
virtual std::shared_ptr< ModelAPI_AttributeDouble > xDirection() const
X direction.
Definition: ConstructionAPI_Axis.h:141
void setByPoints(const ModelHighAPI_Selection &thePoint1, const ModelHighAPI_Selection &thePoint2)
Set points.
Definition: ConstructionAPI_Axis.cpp:139
void setByLine(const ModelHighAPI_Selection &theCylindricalFace)
Set by line.
Definition: ConstructionAPI_Axis.cpp:188
virtual std::shared_ptr< ModelAPI_AttributeDouble > zDimension() const
Z dimension.
Definition: ConstructionAPI_Axis.h:141
virtual std::shared_ptr< ModelAPI_AttributeDouble > offset1() const
Offset 1.
Definition: ConstructionAPI_Axis.h:141
virtual std::shared_ptr< ModelAPI_AttributeSelection > line() const
Line.
Definition: ConstructionAPI_Axis.h:141
virtual std::shared_ptr< ModelAPI_AttributeSelection > plane1() const
Plane 1.
Definition: ConstructionAPI_Axis.h:141
virtual ~ConstructionAPI_Axis()
Destructor.
Definition: ConstructionAPI_Axis.cpp:134
virtual std::shared_ptr< ModelAPI_AttributeSelection > cylindricalFace() const
Cylindrical face.
Definition: ConstructionAPI_Axis.h:141
virtual std::shared_ptr< ModelAPI_AttributeString > creationMethod() const
Creation method.
Definition: ConstructionAPI_Axis.h:141
virtual std::shared_ptr< ModelAPI_AttributeDouble > offset2() const
Offset 2.
Definition: ConstructionAPI_Axis.h:141
virtual std::shared_ptr< ModelAPI_AttributeString > useOffset1() const
Use offset 1.
Definition: ConstructionAPI_Axis.h:141
virtual std::shared_ptr< ModelAPI_AttributeSelection > plane() const
Plane.
Definition: ConstructionAPI_Axis.h:141
virtual std::shared_ptr< ModelAPI_AttributeDouble > zDirection() const
Z direction.
Definition: ConstructionAPI_Axis.h:141
virtual std::shared_ptr< ModelAPI_AttributeDouble > yDirection() const
Y direction.
Definition: ConstructionAPI_Axis.h:141
void setByCylindricalFace(const ModelHighAPI_Selection &theCylindricalFace)
Set cylindrical face.
Definition: ConstructionAPI_Axis.cpp:150
virtual std::shared_ptr< ModelAPI_AttributeString > useOffset2() const
Use offset 2.
Definition: ConstructionAPI_Axis.h:141
ConstructionAPI_Axis(const std::shared_ptr< ModelAPI_Feature > &theFeature)
Constructor without values.
Definition: ConstructionAPI_Axis.cpp:26
virtual std::shared_ptr< ModelAPI_AttributeSelection > firstPoint() const
First point.
Definition: ConstructionAPI_Axis.h:141
void setByPointAndDirection(const ModelHighAPI_Selection &thePoint, const ModelHighAPI_Double &theX, const ModelHighAPI_Double &theY, const ModelHighAPI_Double &theZ)
Set direction.
Definition: ConstructionAPI_Axis.cpp:159
virtual std::shared_ptr< ModelAPI_AttributeDouble > yDimension() const
Y dimension.
Definition: ConstructionAPI_Axis.h:141
virtual std::shared_ptr< ModelAPI_AttributeSelection > secondPoint() const
Second point.
Definition: ConstructionAPI_Axis.h:141
virtual std::shared_ptr< ModelAPI_AttributeSelection > plane2() const
Plane 2.
Definition: ConstructionAPI_Axis.h:141
virtual std::shared_ptr< ModelAPI_AttributeBoolean > reverseOffset1() const
Reverse offset 1.
Definition: ConstructionAPI_Axis.h:141
virtual std::shared_ptr< ModelAPI_AttributeDouble > xDimension() const
X dimension.
Definition: ConstructionAPI_Axis.h:141
virtual void dump(ModelHighAPI_Dumper &theDumper) const
Dump wrapped feature.
Definition: ConstructionAPI_Axis.cpp:276
virtual std::shared_ptr< ModelAPI_AttributeSelection > point() const
Point.
Definition: ConstructionAPI_Axis.h:141
static const std::string & ID()
Axis kind.
Definition: ConstructionPlugin_Axis.h:43
static const std::string & PLANE2()
Attribute name for plane 2.
Definition: ConstructionPlugin_Axis.h:213
static const std::string & USE_OFFSET1()
Attribute name for use offset for plane 1.
Definition: ConstructionPlugin_Axis.h:192
static const std::string & METHOD()
attribute name for first point
Definition: ConstructionPlugin_Axis.h:50
static const std::string & PLANE1()
Attribute name for plane 1.
Definition: ConstructionPlugin_Axis.h:185
static const std::string & DY()
attribute name for the Y dimension
Definition: ConstructionPlugin_Axis.h:130
static const std::string & X_DIRECTION()
attribute name for X direction
Definition: ConstructionPlugin_Axis.h:143
static const std::string & POINT_FIRST()
attribute name for first point
Definition: ConstructionPlugin_Axis.h:106
static const std::string & DX()
attribute name for the X dimension
Definition: ConstructionPlugin_Axis.h:124
static const std::string & PLANE()
Attribute name for plane.
Definition: ConstructionPlugin_Axis.h:171
static const std::string & OFFSET2()
Attribute name for offset for plane 2.
Definition: ConstructionPlugin_Axis.h:227
static const std::string & OFFSET1()
Attribute name for offset for plane 1.
Definition: ConstructionPlugin_Axis.h:199
static const std::string & REVERSE_OFFSET2()
Attribute name for reverse offset for plane 2.
Definition: ConstructionPlugin_Axis.h:234
static const std::string & LINE()
Attribute name for line.
Definition: ConstructionPlugin_Axis.h:164
static const std::string & POINT()
Attribute name for point.
Definition: ConstructionPlugin_Axis.h:178
static const std::string & CYLINDRICAL_FACE()
attribute name for second point
Definition: ConstructionPlugin_Axis.h:118
static const std::string & POINT_SECOND()
attribute name for second point
Definition: ConstructionPlugin_Axis.h:112
static const std::string & REVERSE_OFFSET1()
Attribute name for reverse offset for plane 1.
Definition: ConstructionPlugin_Axis.h:206
static const std::string & Y_DIRECTION()
attribute name for Y direction
Definition: ConstructionPlugin_Axis.h:150
static const std::string & Z_DIRECTION()
attribute name for Y direction
Definition: ConstructionPlugin_Axis.h:157
static const std::string & USE_OFFSET2()
Attribute name for use offset for plane 2.
Definition: ConstructionPlugin_Axis.h:220
static const std::string & DZ()
attribute name for the Z dimension
Definition: ConstructionPlugin_Axis.h:136
Attribute that contains boolean value.
Definition: ModelAPI_AttributeBoolean.h:31
Attribute that contains real value with double precision.
Definition: ModelAPI_AttributeDouble.h:34
Attribute that contains reference to the sub-shape of some result, the selected shape.
Definition: ModelAPI_AttributeSelection.h:35
API for the attribute that contains std (null terminated) string.
Definition: ModelAPI_AttributeString.h:33
Document for internal data structure of any object storage.
Definition: ModelAPI_Document.h:53
Class for filling ModelAPI_AttributeDouble.
Definition: ModelHighAPI_Double.h:37
Dump engine for the model.
Definition: ModelHighAPI_Dumper.h:81
Base class for feature interfaces.
Definition: ModelHighAPI_Interface.h:46
Class for filling ModelAPI_AttributeSelection.
Definition: ModelHighAPI_Selection.h:49
AxisPtr addAxis(const std::shared_ptr< ModelAPI_Document > &thePart, const ModelHighAPI_Selection &theObject1, const ModelHighAPI_Selection &theObject2)
Create Axis feature.
Definition: ConstructionAPI_Axis.cpp:346