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);
70 CONSTRUCTIONAPI_EXPORT
71 virtual ~ConstructionAPI_Axis();
73 INTERFACE_21(ConstructionPlugin_Axis::ID(),
74 creationMethod, ConstructionPlugin_Axis::METHOD(), ModelAPI_AttributeString, /** Creation method */,
75 firstPoint, ConstructionPlugin_Axis::POINT_FIRST(), ModelAPI_AttributeSelection, /** First point */,
76 secondPoint, ConstructionPlugin_Axis::POINT_SECOND(), ModelAPI_AttributeSelection, /** Second point */,
77 cylindricalFace, ConstructionPlugin_Axis::CYLINDRICAL_FACE(), ModelAPI_AttributeSelection, /** Cylindrical face */,
78 xDirection, ConstructionPlugin_Axis::X_DIRECTION(), ModelAPI_AttributeDouble, /** X direction */,
79 yDirection, ConstructionPlugin_Axis::Y_DIRECTION(), ModelAPI_AttributeDouble, /** Y direction */,
80 zDirection, ConstructionPlugin_Axis::Z_DIRECTION(), ModelAPI_AttributeDouble, /** Z direction */,
81 xDimension, ConstructionPlugin_Axis::DX(), ModelAPI_AttributeDouble, /** X dimension */,
82 yDimension, ConstructionPlugin_Axis::DY(), ModelAPI_AttributeDouble, /** Y dimension */,
83 zDimension, ConstructionPlugin_Axis::DZ(), ModelAPI_AttributeDouble, /** Z dimension */,
84 line, ConstructionPlugin_Axis::LINE(), ModelAPI_AttributeSelection, /** Line */,
85 plane, ConstructionPlugin_Axis::PLANE(), ModelAPI_AttributeSelection, /** Plane */,
86 point, ConstructionPlugin_Axis::POINT(), ModelAPI_AttributeSelection, /** Point */,
87 plane1, ConstructionPlugin_Axis::PLANE1(), ModelAPI_AttributeSelection, /** Plane 1 */,
88 useOffset1, ConstructionPlugin_Axis::USE_OFFSET1(), ModelAPI_AttributeString, /** Use offset 1 */,
89 offset1, ConstructionPlugin_Axis::OFFSET1(), ModelAPI_AttributeDouble, /** Offset 1 */,
90 reverseOffset1, ConstructionPlugin_Axis::REVERSE_OFFSET1(), ModelAPI_AttributeBoolean, /** Reverse offset 1 */,
91 plane2, ConstructionPlugin_Axis::PLANE2(), ModelAPI_AttributeSelection, /** Plane 2 */,
92 useOffset2, ConstructionPlugin_Axis::USE_OFFSET2(), ModelAPI_AttributeString, /** Use offset 2 */,
93 offset2, ConstructionPlugin_Axis::OFFSET2(), ModelAPI_AttributeDouble, /** Offset 2 */,
94 reverseOffset2, ConstructionPlugin_Axis::REVERSE_OFFSET2(), ModelAPI_AttributeBoolean, /** Reverse offset 2 */)
97 CONSTRUCTIONAPI_EXPORT
98 void setByPoints(const ModelHighAPI_Selection& thePoint1,
99 const ModelHighAPI_Selection& thePoint2);
101 /// Set cylindrical face
102 CONSTRUCTIONAPI_EXPORT
103 void setByCylindricalFace(const ModelHighAPI_Selection& theCylindricalFace);
106 CONSTRUCTIONAPI_EXPORT
107 void setByPointAndDirection(const ModelHighAPI_Selection& thePoint,
108 const ModelHighAPI_Double& theX,
109 const ModelHighAPI_Double& theY,
110 const ModelHighAPI_Double& theZ);
113 CONSTRUCTIONAPI_EXPORT
114 void setByDimensions(const ModelHighAPI_Double& theDX,
115 const ModelHighAPI_Double& theDY,
116 const ModelHighAPI_Double& theDZ);
119 CONSTRUCTIONAPI_EXPORT
120 void setByLine(const ModelHighAPI_Selection& theCylindricalFace);
122 /// Set by plane and point
123 CONSTRUCTIONAPI_EXPORT
124 void setByPlaneAndPoint(const ModelHighAPI_Selection& thePlane,
125 const ModelHighAPI_Selection& thePoint);
127 /// Set by two planes
128 CONSTRUCTIONAPI_EXPORT
129 void setByTwoPlanes(const ModelHighAPI_Selection& thePlane1,
130 const ModelHighAPI_Selection& thePlane2);
132 /// Set by two planes
133 CONSTRUCTIONAPI_EXPORT
134 void setByTwoPlanes(const ModelHighAPI_Selection& thePlane1,
135 const ModelHighAPI_Double& theOffset1,
136 const bool theReverseOffset1,
137 const ModelHighAPI_Selection& thePlane2,
138 const ModelHighAPI_Double& theOffset2,
139 const bool theReverseOffset2);
141 /// Dump wrapped feature
142 CONSTRUCTIONAPI_EXPORT
143 virtual void dump(ModelHighAPI_Dumper& theDumper) const;
146 /// Pointer on Axis object
147 typedef std::shared_ptr<ConstructionAPI_Axis> AxisPtr;
149 /// \ingroup CPPHighAPI
150 /// \brief Create Axis feature
151 CONSTRUCTIONAPI_EXPORT
152 AxisPtr addAxis(const std::shared_ptr<ModelAPI_Document>& thePart,
153 const ModelHighAPI_Selection& theObject1,
154 const ModelHighAPI_Selection& theObject2);
156 /// \ingroup CPPHighAPI
157 /// \brief Create Axis feature
158 CONSTRUCTIONAPI_EXPORT
159 AxisPtr addAxis(const std::shared_ptr<ModelAPI_Document>& thePart,
160 const ModelHighAPI_Selection& theObject);
162 /// \ingroup CPPHighAPI
163 /// \brief Create Axis feature
164 CONSTRUCTIONAPI_EXPORT
165 AxisPtr addAxis(const std::shared_ptr<ModelAPI_Document>& thePart,
166 const ModelHighAPI_Selection& thePoint,
167 const ModelHighAPI_Double& theX,
168 const ModelHighAPI_Double& theY,
169 const ModelHighAPI_Double& theZ);
171 /// \ingroup CPPHighAPI
172 /// \brief Create Axis feature
173 CONSTRUCTIONAPI_EXPORT
174 AxisPtr addAxis(const std::shared_ptr<ModelAPI_Document>& thePart,
175 const ModelHighAPI_Double& theDX,
176 const ModelHighAPI_Double& theDY,
177 const ModelHighAPI_Double& theDZ);
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& thePlane1,
184 const ModelHighAPI_Double& theOffset1,
185 const bool theReverseOffset1,
186 const ModelHighAPI_Selection& thePlane2,
187 const ModelHighAPI_Double& theOffset2,
188 const bool theReverseOffset2);
190 #endif /* SRC_CONSTRUCTIONAPI_CONSTRUCTIONAPI_AXIS_H_ */