1 // Copyright (C) 2014-2016 CEA/DEN, EDF R&D
3 // Name : ConstructionAPI_Plane.h
7 // 27/05/16 - Sergey POKHODENKO - Creation of the file
9 #ifndef SRC_CONSTRUCTIONAPI_CONSTRUCTIONAPI_PLANE_H_
10 #define SRC_CONSTRUCTIONAPI_CONSTRUCTIONAPI_PLANE_H_
12 #include "ConstructionAPI.h"
14 #include <ConstructionPlugin_Plane.h>
16 #include <ModelHighAPI_Interface.h>
17 #include <ModelHighAPI_Macro.h>
19 class ModelHighAPI_Double;
20 class ModelHighAPI_Selection;
22 /// \class ConstructionAPI_Plane
23 /// \ingroup CPPHighAPI
24 /// \brief Interface for Plane feature
25 class ConstructionAPI_Plane: public ModelHighAPI_Interface
28 /// Constructor without values
29 CONSTRUCTIONAPI_EXPORT
30 explicit ConstructionAPI_Plane(const std::shared_ptr<ModelAPI_Feature>& theFeature);
32 /// Constructor with values
33 CONSTRUCTIONAPI_EXPORT
34 ConstructionAPI_Plane(const std::shared_ptr<ModelAPI_Feature>& theFeature,
35 const ModelHighAPI_Selection& theFace,
36 const ModelHighAPI_Double& theDistance,
37 const bool theIsReverse);
39 /// Constructor with values
40 CONSTRUCTIONAPI_EXPORT
41 ConstructionAPI_Plane(const std::shared_ptr<ModelAPI_Feature>& theFeature,
42 const ModelHighAPI_Double& theA,
43 const ModelHighAPI_Double& theB,
44 const ModelHighAPI_Double& theC,
45 const ModelHighAPI_Double& theD);
47 /// Constructor with values
48 CONSTRUCTIONAPI_EXPORT
49 ConstructionAPI_Plane(const std::shared_ptr<ModelAPI_Feature>& theFeature,
50 const ModelHighAPI_Selection& thePoint1,
51 const ModelHighAPI_Selection& thePoint2,
52 const ModelHighAPI_Selection& thePoint3);
54 /// Constructor with values
55 CONSTRUCTIONAPI_EXPORT
56 ConstructionAPI_Plane(const std::shared_ptr<ModelAPI_Feature>& theFeature,
57 const ModelHighAPI_Selection& theLine,
58 const ModelHighAPI_Selection& thePoint,
59 const bool theIsPerpendicular);
61 /// Constructor with values
62 CONSTRUCTIONAPI_EXPORT
63 ConstructionAPI_Plane(const std::shared_ptr<ModelAPI_Feature>& theFeature,
64 const ModelHighAPI_Selection& theObject1,
65 const ModelHighAPI_Selection& theObject2);
67 /// Constructor with values
68 CONSTRUCTIONAPI_EXPORT
69 ConstructionAPI_Plane(const std::shared_ptr<ModelAPI_Feature>& theFeature,
70 const ModelHighAPI_Selection& thePlane,
71 const ModelHighAPI_Selection& theAxis,
72 const ModelHighAPI_Double& theAngle);
75 CONSTRUCTIONAPI_EXPORT
76 virtual ~ConstructionAPI_Plane();
78 INTERFACE_20(ConstructionPlugin_Plane::ID(),
79 creationMethod, ConstructionPlugin_Plane::CREATION_METHOD(),
80 ModelAPI_AttributeString, /** Creation method */,
81 A, ConstructionPlugin_Plane::A(),
82 ModelAPI_AttributeDouble, /** Parameter A for general equation */,
83 B, ConstructionPlugin_Plane::B(),
84 ModelAPI_AttributeDouble, /** Parameter B for general equation */,
85 C, ConstructionPlugin_Plane::C(),
86 ModelAPI_AttributeDouble, /** Parameter C for general equation */,
87 D, ConstructionPlugin_Plane::D(),
88 ModelAPI_AttributeDouble, /** Parameter D for general equation */,
89 point1, ConstructionPlugin_Plane::POINT1(),
90 ModelAPI_AttributeSelection, /** Point 1 for plane */,
91 point2, ConstructionPlugin_Plane::POINT2(),
92 ModelAPI_AttributeSelection, /** Point 2 for plane */,
93 point3, ConstructionPlugin_Plane::POINT3(),
94 ModelAPI_AttributeSelection, /** Point 3 for plane */,
95 line, ConstructionPlugin_Plane::LINE(),
96 ModelAPI_AttributeSelection, /** Line for plane */,
97 point, ConstructionPlugin_Plane::POINT(),
98 ModelAPI_AttributeSelection, /** Point for plane */,
99 perpendicular, ConstructionPlugin_Plane::PERPENDICULAR(),
100 ModelAPI_AttributeBoolean, /** Perpendicular flag */,
101 creationMethodByOtherPlane,
102 ConstructionPlugin_Plane::CREATION_METHOD_BY_OTHER_PLANE_OPTION(),
103 ModelAPI_AttributeString, /** Creation method by other plane*/,
104 plane, ConstructionPlugin_Plane::PLANE(),
105 ModelAPI_AttributeSelection, /** Plane face */,
106 distance, ConstructionPlugin_Plane::DISTANCE(),
107 ModelAPI_AttributeDouble, /** Distance */,
108 reverse, ConstructionPlugin_Plane::REVERSE(),
109 ModelAPI_AttributeBoolean, /** Reverse flag */,
110 coincidentPoint, ConstructionPlugin_Plane::COINCIDENT_POINT(),
111 ModelAPI_AttributeSelection, /** Coincident point */,
112 axis, ConstructionPlugin_Plane::AXIS(),
113 ModelAPI_AttributeSelection, /** Axis for rotation */,
114 angle, ConstructionPlugin_Plane::ANGLE(),
115 ModelAPI_AttributeDouble, /** Rotation angle */,
116 plane1, ConstructionPlugin_Plane::PLANE1(),
117 ModelAPI_AttributeSelection, /** Plane 1 */,
118 plane2, ConstructionPlugin_Plane::PLANE2(),
119 ModelAPI_AttributeSelection, /** Plane 2 */)
121 /// Set face and distance
122 CONSTRUCTIONAPI_EXPORT
123 void setByFaceAndDistance(const ModelHighAPI_Selection& theFace,
124 const ModelHighAPI_Double& theDistance,
125 const bool theIsReverse);
127 /// Set GeneralEquation parameters of the feature
128 CONSTRUCTIONAPI_EXPORT
129 void setByGeneralEquation(const ModelHighAPI_Double& theA,
130 const ModelHighAPI_Double& theB,
131 const ModelHighAPI_Double& theC,
132 const ModelHighAPI_Double& theD);
134 /// Set by three points.
135 CONSTRUCTIONAPI_EXPORT
136 void setByThreePoints(const ModelHighAPI_Selection& thePoint1,
137 const ModelHighAPI_Selection& thePoint2,
138 const ModelHighAPI_Selection& thePoint3);
140 /// Set by line and point.
141 CONSTRUCTIONAPI_EXPORT
142 void setByLineAndPoint(const ModelHighAPI_Selection& theLine,
143 const ModelHighAPI_Selection& thePoint,
144 const bool theIsPerpendicular);
146 /// Set by two parallel planes.
147 CONSTRUCTIONAPI_EXPORT
148 void setByTwoParallelPlanes(const ModelHighAPI_Selection& thePlane1,
149 const ModelHighAPI_Selection& thePlane2);
151 /// Set by coincident to point.
152 CONSTRUCTIONAPI_EXPORT
153 void setByCoincidentToPoint(const ModelHighAPI_Selection& thePlane,
154 const ModelHighAPI_Selection& thePoint);
157 CONSTRUCTIONAPI_EXPORT
158 void setByRotation(const ModelHighAPI_Selection& thePlane,
159 const ModelHighAPI_Selection& theAxis,
160 const ModelHighAPI_Double& theAngle);
162 /// Dump wrapped feature
163 CONSTRUCTIONAPI_EXPORT
164 virtual void dump(ModelHighAPI_Dumper& theDumper) const;
167 /// Pointer on Plane object
168 typedef std::shared_ptr<ConstructionAPI_Plane> PlanePtr;
170 /// \ingroup CPPHighAPI
171 /// \brief Create Plane feature
172 CONSTRUCTIONAPI_EXPORT
173 PlanePtr addPlane(const std::shared_ptr<ModelAPI_Document>& thePart,
174 const ModelHighAPI_Selection& theFace,
175 const ModelHighAPI_Double& theDistance,
176 const bool theIsReverse);
178 /// \ingroup CPPHighAPI
179 /// \brief Create Plane feature
180 CONSTRUCTIONAPI_EXPORT
181 PlanePtr addPlane(const std::shared_ptr<ModelAPI_Document>& thePart,
182 const ModelHighAPI_Double& theA,
183 const ModelHighAPI_Double& theB,
184 const ModelHighAPI_Double& theC,
185 const ModelHighAPI_Double& theD);
187 /// \ingroup CPPHighAPI
188 /// \brief Create Plane feature
189 CONSTRUCTIONAPI_EXPORT
190 PlanePtr addPlane(const std::shared_ptr<ModelAPI_Document>& thePart,
191 const ModelHighAPI_Selection& thePoint1,
192 const ModelHighAPI_Selection& thePoint2,
193 const ModelHighAPI_Selection& thePoint3);
195 /// \ingroup CPPHighAPI
196 /// \brief Create Plane feature
197 CONSTRUCTIONAPI_EXPORT
198 PlanePtr addPlane(const std::shared_ptr<ModelAPI_Document>& thePart,
199 const ModelHighAPI_Selection& theLine,
200 const ModelHighAPI_Selection& thePoint,
201 const bool theIsPerpendicular);
203 /// \ingroup CPPHighAPI
204 /// \brief Create Plane feature
205 CONSTRUCTIONAPI_EXPORT
206 PlanePtr addPlane(const std::shared_ptr<ModelAPI_Document>& thePart,
207 const ModelHighAPI_Selection& theObject1,
208 const ModelHighAPI_Selection& theObject2);
210 /// \ingroup CPPHighAPI
211 /// \brief Create Plane feature
212 CONSTRUCTIONAPI_EXPORT
213 PlanePtr addPlane(const std::shared_ptr<ModelAPI_Document>& thePart,
214 const ModelHighAPI_Selection& thePlane,
215 const ModelHighAPI_Selection& theAxis,
216 const ModelHighAPI_Double& theAngle);
218 #endif /* SRC_CONSTRUCTIONAPI_CONSTRUCTIONAPI_PLANE_H_ */