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);
139 /// Dump wrapped feature
140 CONSTRUCTIONAPI_EXPORT
141 virtual void dump(ModelHighAPI_Dumper& theDumper) const;
144 /// Pointer on Plane object
145 typedef std::shared_ptr<ConstructionAPI_Plane> PlanePtr;
147 /// \ingroup CPPHighAPI
148 /// \brief Create Plane feature
149 CONSTRUCTIONAPI_EXPORT
150 PlanePtr addPlane(const std::shared_ptr<ModelAPI_Document>& thePart,
151 const ModelHighAPI_Selection& theFace,
152 const ModelHighAPI_Double& theDistance,
153 const bool theIsReverse);
155 /// \ingroup CPPHighAPI
156 /// \brief Create Plane feature
157 CONSTRUCTIONAPI_EXPORT
158 PlanePtr addPlane(const std::shared_ptr<ModelAPI_Document>& thePart,
159 const ModelHighAPI_Double& theA,
160 const ModelHighAPI_Double& theB,
161 const ModelHighAPI_Double& theC,
162 const ModelHighAPI_Double& theD);
164 /// \ingroup CPPHighAPI
165 /// \brief Create Plane feature
166 CONSTRUCTIONAPI_EXPORT
167 PlanePtr addPlane(const std::shared_ptr<ModelAPI_Document>& thePart,
168 const ModelHighAPI_Selection& thePoint1,
169 const ModelHighAPI_Selection& thePoint2,
170 const ModelHighAPI_Selection& thePoint3);
172 /// \ingroup CPPHighAPI
173 /// \brief Create Plane feature
174 CONSTRUCTIONAPI_EXPORT
175 PlanePtr addPlane(const std::shared_ptr<ModelAPI_Document>& thePart,
176 const ModelHighAPI_Selection& theLine,
177 const ModelHighAPI_Selection& thePoint,
178 const bool theIsPerpendicular);
180 /// \ingroup CPPHighAPI
181 /// \brief Create Plane feature
182 CONSTRUCTIONAPI_EXPORT
183 PlanePtr addPlane(const std::shared_ptr<ModelAPI_Document>& thePart,
184 const ModelHighAPI_Selection& theObject1,
185 const ModelHighAPI_Selection& theObject2);
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& thePlane,
192 const ModelHighAPI_Selection& theAxis,
193 const ModelHighAPI_Double& theAngle);
195 #endif /* SRC_CONSTRUCTIONAPI_CONSTRUCTIONAPI_PLANE_H_ */