1 // Name : ConstructionAPI_Plane.h
5 // 27/05/16 - Sergey POKHODENKO - Creation of the file
7 #ifndef SRC_CONSTRUCTIONAPI_CONSTRUCTIONAPI_PLANE_H_
8 #define SRC_CONSTRUCTIONAPI_CONSTRUCTIONAPI_PLANE_H_
10 #include "ConstructionAPI.h"
12 #include <ConstructionPlugin_Plane.h>
14 #include <ModelHighAPI_Interface.h>
15 #include <ModelHighAPI_Macro.h>
17 class ModelHighAPI_Double;
18 class ModelHighAPI_Selection;
20 /// \class ConstructionAPI_Plane
21 /// \ingroup CPPHighAPI
22 /// \brief Interface for Plane feature
23 class ConstructionAPI_Plane: public ModelHighAPI_Interface
26 /// Constructor without values
27 CONSTRUCTIONAPI_EXPORT
28 explicit ConstructionAPI_Plane(const std::shared_ptr<ModelAPI_Feature>& theFeature);
30 /// Constructor with values
31 CONSTRUCTIONAPI_EXPORT
32 ConstructionAPI_Plane(const std::shared_ptr<ModelAPI_Feature>& theFeature,
33 const ModelHighAPI_Selection& theFace,
34 const ModelHighAPI_Double& theDistance,
35 const bool theIsReverse);
37 /// Constructor with values
38 CONSTRUCTIONAPI_EXPORT
39 ConstructionAPI_Plane(const std::shared_ptr<ModelAPI_Feature>& theFeature,
40 const ModelHighAPI_Double& theA,
41 const ModelHighAPI_Double& theB,
42 const ModelHighAPI_Double& theC,
43 const ModelHighAPI_Double& theD);
45 /// Constructor with values
46 CONSTRUCTIONAPI_EXPORT
47 ConstructionAPI_Plane(const std::shared_ptr<ModelAPI_Feature>& theFeature,
48 const ModelHighAPI_Selection& thePoint1,
49 const ModelHighAPI_Selection& thePoint2,
50 const ModelHighAPI_Selection& thePoint3);
52 /// Constructor with values
53 CONSTRUCTIONAPI_EXPORT
54 ConstructionAPI_Plane(const std::shared_ptr<ModelAPI_Feature>& theFeature,
55 const ModelHighAPI_Selection& theLine,
56 const ModelHighAPI_Selection& thePoint,
57 const bool theIsPerpendicular);
59 /// Constructor with values
60 CONSTRUCTIONAPI_EXPORT
61 ConstructionAPI_Plane(const std::shared_ptr<ModelAPI_Feature>& theFeature,
62 const ModelHighAPI_Selection& theObject1,
63 const ModelHighAPI_Selection& theObject2);
65 /// Constructor with values
66 CONSTRUCTIONAPI_EXPORT
67 ConstructionAPI_Plane(const std::shared_ptr<ModelAPI_Feature>& theFeature,
68 const ModelHighAPI_Selection& thePlane,
69 const ModelHighAPI_Selection& theAxis,
70 const ModelHighAPI_Double& theAngle);
73 CONSTRUCTIONAPI_EXPORT
74 virtual ~ConstructionAPI_Plane();
76 INTERFACE_20(ConstructionPlugin_Plane::ID(),
77 creationMethod, ConstructionPlugin_Plane::CREATION_METHOD(), ModelAPI_AttributeString, /** Creation method */,
78 A, ConstructionPlugin_Plane::A(), ModelAPI_AttributeDouble, /** Parameter A for general equation */,
79 B, ConstructionPlugin_Plane::B(), ModelAPI_AttributeDouble, /** Parameter B for general equation */,
80 C, ConstructionPlugin_Plane::C(), ModelAPI_AttributeDouble, /** Parameter C for general equation */,
81 D, ConstructionPlugin_Plane::D(), ModelAPI_AttributeDouble, /** Parameter D for general equation */,
82 point1, ConstructionPlugin_Plane::POINT1(), ModelAPI_AttributeSelection, /** Point 1 for plane */,
83 point2, ConstructionPlugin_Plane::POINT2(), ModelAPI_AttributeSelection, /** Point 2 for plane */,
84 point3, ConstructionPlugin_Plane::POINT3(), ModelAPI_AttributeSelection, /** Point 3 for plane */,
85 line, ConstructionPlugin_Plane::LINE(), ModelAPI_AttributeSelection, /** Line for plane */,
86 point, ConstructionPlugin_Plane::POINT(), ModelAPI_AttributeSelection, /** Point for plane */,
87 perpendicular, ConstructionPlugin_Plane::PERPENDICULAR(), ModelAPI_AttributeBoolean, /** Perpendicular flag */,
88 creationMethodByOtherPlane, ConstructionPlugin_Plane::CREATION_METHOD_BY_OTHER_PLANE_OPTION(), ModelAPI_AttributeString, /** Creation method by other plane*/,
89 plane, ConstructionPlugin_Plane::PLANE(), ModelAPI_AttributeSelection, /** Plane face */,
90 distance, ConstructionPlugin_Plane::DISTANCE(), ModelAPI_AttributeDouble, /** Distance */,
91 reverse, ConstructionPlugin_Plane::REVERSE(), ModelAPI_AttributeBoolean, /** Reverse flag */,
92 coincidentPoint, ConstructionPlugin_Plane::COINCIDENT_POINT(), ModelAPI_AttributeSelection, /** Coincident point */,
93 axis, ConstructionPlugin_Plane::AXIS(), ModelAPI_AttributeSelection, /** Axis for rotation */,
94 angle, ConstructionPlugin_Plane::ANGLE(), ModelAPI_AttributeDouble, /** Rotation angle */,
95 plane1, ConstructionPlugin_Plane::PLANE1(), ModelAPI_AttributeSelection, /** Plane 1 */,
96 plane2, ConstructionPlugin_Plane::PLANE2(), ModelAPI_AttributeSelection, /** Plane 2 */)
98 /// Set face and distance
99 CONSTRUCTIONAPI_EXPORT
100 void setByFaceAndDistance(const ModelHighAPI_Selection& theFace,
101 const ModelHighAPI_Double& theDistance,
102 const bool theIsReverse);
104 /// Set GeneralEquation parameters of the feature
105 CONSTRUCTIONAPI_EXPORT
106 void setByGeneralEquation(const ModelHighAPI_Double& theA,
107 const ModelHighAPI_Double& theB,
108 const ModelHighAPI_Double& theC,
109 const ModelHighAPI_Double& theD);
111 /// Set by three points.
112 CONSTRUCTIONAPI_EXPORT
113 void setByThreePoints(const ModelHighAPI_Selection& thePoint1,
114 const ModelHighAPI_Selection& thePoint2,
115 const ModelHighAPI_Selection& thePoint3);
117 /// Set by line and point.
118 CONSTRUCTIONAPI_EXPORT
119 void setByLineAndPoint(const ModelHighAPI_Selection& theLine,
120 const ModelHighAPI_Selection& thePoint,
121 const bool theIsPerpendicular);
123 /// Set by two parallel planes.
124 CONSTRUCTIONAPI_EXPORT
125 void setByTwoParallelPlanes(const ModelHighAPI_Selection& thePlane1,
126 const ModelHighAPI_Selection& thePlane2);
128 /// Set by coincident to point.
129 CONSTRUCTIONAPI_EXPORT
130 void setByCoincidentToPoint(const ModelHighAPI_Selection& thePlane,
131 const ModelHighAPI_Selection& thePoint);
134 CONSTRUCTIONAPI_EXPORT
135 void setByRotation(const ModelHighAPI_Selection& thePlane,
136 const ModelHighAPI_Selection& theAxis,
137 const ModelHighAPI_Double& theAngle);
141 /// Pointer on Plane object
142 typedef std::shared_ptr<ConstructionAPI_Plane> PlanePtr;
144 /// \ingroup CPPHighAPI
145 /// \brief Create Plane feature
146 CONSTRUCTIONAPI_EXPORT
147 PlanePtr addPlane(const std::shared_ptr<ModelAPI_Document>& thePart,
148 const ModelHighAPI_Selection& theFace,
149 const ModelHighAPI_Double& theDistance,
150 const bool theIsReverse);
152 /// \ingroup CPPHighAPI
153 /// \brief Create Plane feature
154 CONSTRUCTIONAPI_EXPORT
155 PlanePtr addPlane(const std::shared_ptr<ModelAPI_Document>& thePart,
156 const ModelHighAPI_Double& theA,
157 const ModelHighAPI_Double& theB,
158 const ModelHighAPI_Double& theC,
159 const ModelHighAPI_Double& theD);
161 /// \ingroup CPPHighAPI
162 /// \brief Create Plane feature
163 CONSTRUCTIONAPI_EXPORT
164 PlanePtr addPlane(const std::shared_ptr<ModelAPI_Document>& thePart,
165 const ModelHighAPI_Selection& thePoint1,
166 const ModelHighAPI_Selection& thePoint2,
167 const ModelHighAPI_Selection& thePoint3);
169 /// \ingroup CPPHighAPI
170 /// \brief Create Plane feature
171 CONSTRUCTIONAPI_EXPORT
172 PlanePtr addPlane(const std::shared_ptr<ModelAPI_Document>& thePart,
173 const ModelHighAPI_Selection& theLine,
174 const ModelHighAPI_Selection& thePoint,
175 const bool theIsPerpendicular);
177 /// \ingroup CPPHighAPI
178 /// \brief Create Plane feature
179 CONSTRUCTIONAPI_EXPORT
180 PlanePtr addPlane(const std::shared_ptr<ModelAPI_Document>& thePart,
181 const ModelHighAPI_Selection& theObject1,
182 const ModelHighAPI_Selection& theObject2);
184 /// \ingroup CPPHighAPI
185 /// \brief Create Plane feature
186 CONSTRUCTIONAPI_EXPORT
187 PlanePtr addPlane(const std::shared_ptr<ModelAPI_Document>& thePart,
188 const ModelHighAPI_Selection& thePlane,
189 const ModelHighAPI_Selection& theAxis,
190 const ModelHighAPI_Double& theAngle);
192 #endif /* SRC_CONSTRUCTIONAPI_CONSTRUCTIONAPI_PLANE_H_ */