1 // Copyright (C) 2014-2019 CEA/DEN, EDF R&D
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.
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.
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
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
20 #ifndef SRC_CONSTRUCTIONAPI_CONSTRUCTIONAPI_PLANE_H_
21 #define SRC_CONSTRUCTIONAPI_CONSTRUCTIONAPI_PLANE_H_
23 #include "ConstructionAPI.h"
25 #include <ConstructionPlugin_Plane.h>
27 #include <ModelHighAPI_Interface.h>
28 #include <ModelHighAPI_Macro.h>
30 class ModelHighAPI_Double;
31 class ModelHighAPI_Selection;
33 /// \class ConstructionAPI_Plane
34 /// \ingroup CPPHighAPI
35 /// \brief Interface for Plane feature
36 class ConstructionAPI_Plane: public ModelHighAPI_Interface
39 /// Constructor without values
40 CONSTRUCTIONAPI_EXPORT
41 explicit ConstructionAPI_Plane(const std::shared_ptr<ModelAPI_Feature>& theFeature);
43 /// Constructor with values
44 CONSTRUCTIONAPI_EXPORT
45 ConstructionAPI_Plane(const std::shared_ptr<ModelAPI_Feature>& theFeature,
46 const ModelHighAPI_Selection& theFace,
47 const ModelHighAPI_Double& theDistance,
48 const bool theIsReverse);
50 /// Constructor with values
51 CONSTRUCTIONAPI_EXPORT
52 ConstructionAPI_Plane(const std::shared_ptr<ModelAPI_Feature>& theFeature,
53 const ModelHighAPI_Double& theA,
54 const ModelHighAPI_Double& theB,
55 const ModelHighAPI_Double& theC,
56 const ModelHighAPI_Double& theD);
58 /// Constructor with values
59 CONSTRUCTIONAPI_EXPORT
60 ConstructionAPI_Plane(const std::shared_ptr<ModelAPI_Feature>& theFeature,
61 const ModelHighAPI_Selection& thePoint1,
62 const ModelHighAPI_Selection& thePoint2,
63 const ModelHighAPI_Selection& thePoint3);
65 /// Constructor with values
66 CONSTRUCTIONAPI_EXPORT
67 ConstructionAPI_Plane(const std::shared_ptr<ModelAPI_Feature>& theFeature,
68 const ModelHighAPI_Selection& theLine,
69 const ModelHighAPI_Selection& thePoint,
70 const bool theIsPerpendicular);
72 /// Constructor with values
73 CONSTRUCTIONAPI_EXPORT
74 ConstructionAPI_Plane(const std::shared_ptr<ModelAPI_Feature>& theFeature,
75 const ModelHighAPI_Selection& theObject1,
76 const ModelHighAPI_Selection& theObject2);
78 /// Constructor with values
79 CONSTRUCTIONAPI_EXPORT
80 ConstructionAPI_Plane(const std::shared_ptr<ModelAPI_Feature>& theFeature,
81 const ModelHighAPI_Selection& thePlane,
82 const ModelHighAPI_Selection& theAxis,
83 const ModelHighAPI_Double& theAngle);
86 CONSTRUCTIONAPI_EXPORT
87 virtual ~ConstructionAPI_Plane();
89 INTERFACE_20(ConstructionPlugin_Plane::ID(),
90 creationMethod, ConstructionPlugin_Plane::CREATION_METHOD(),
91 ModelAPI_AttributeString, /** Creation method */,
92 A, ConstructionPlugin_Plane::A(),
93 ModelAPI_AttributeDouble, /** Parameter A for general equation */,
94 B, ConstructionPlugin_Plane::B(),
95 ModelAPI_AttributeDouble, /** Parameter B for general equation */,
96 C, ConstructionPlugin_Plane::C(),
97 ModelAPI_AttributeDouble, /** Parameter C for general equation */,
98 D, ConstructionPlugin_Plane::D(),
99 ModelAPI_AttributeDouble, /** Parameter D for general equation */,
100 point1, ConstructionPlugin_Plane::POINT1(),
101 ModelAPI_AttributeSelection, /** Point 1 for plane */,
102 point2, ConstructionPlugin_Plane::POINT2(),
103 ModelAPI_AttributeSelection, /** Point 2 for plane */,
104 point3, ConstructionPlugin_Plane::POINT3(),
105 ModelAPI_AttributeSelection, /** Point 3 for plane */,
106 line, ConstructionPlugin_Plane::LINE(),
107 ModelAPI_AttributeSelection, /** Line for plane */,
108 point, ConstructionPlugin_Plane::POINT(),
109 ModelAPI_AttributeSelection, /** Point for plane */,
110 perpendicular, ConstructionPlugin_Plane::PERPENDICULAR(),
111 ModelAPI_AttributeBoolean, /** Perpendicular flag */,
112 creationMethodByOtherPlane,
113 ConstructionPlugin_Plane::CREATION_METHOD_BY_OTHER_PLANE_OPTION(),
114 ModelAPI_AttributeString, /** Creation method by other plane*/,
115 plane, ConstructionPlugin_Plane::PLANE(),
116 ModelAPI_AttributeSelection, /** Plane face */,
117 distance, ConstructionPlugin_Plane::DISTANCE(),
118 ModelAPI_AttributeDouble, /** Distance */,
119 reverse, ConstructionPlugin_Plane::REVERSE(),
120 ModelAPI_AttributeBoolean, /** Reverse flag */,
121 coincidentPoint, ConstructionPlugin_Plane::COINCIDENT_POINT(),
122 ModelAPI_AttributeSelection, /** Coincident point */,
123 axis, ConstructionPlugin_Plane::AXIS(),
124 ModelAPI_AttributeSelection, /** Axis for rotation */,
125 angle, ConstructionPlugin_Plane::ANGLE(),
126 ModelAPI_AttributeDouble, /** Rotation angle */,
127 plane1, ConstructionPlugin_Plane::PLANE1(),
128 ModelAPI_AttributeSelection, /** Plane 1 */,
129 plane2, ConstructionPlugin_Plane::PLANE2(),
130 ModelAPI_AttributeSelection, /** Plane 2 */)
132 /// Set face and distance
133 CONSTRUCTIONAPI_EXPORT
134 void setByFaceAndDistance(const ModelHighAPI_Selection& theFace,
135 const ModelHighAPI_Double& theDistance,
136 const bool theIsReverse);
138 /// Set GeneralEquation parameters of the feature
139 CONSTRUCTIONAPI_EXPORT
140 void setByGeneralEquation(const ModelHighAPI_Double& theA,
141 const ModelHighAPI_Double& theB,
142 const ModelHighAPI_Double& theC,
143 const ModelHighAPI_Double& theD);
145 /// Set by three points.
146 CONSTRUCTIONAPI_EXPORT
147 void setByThreePoints(const ModelHighAPI_Selection& thePoint1,
148 const ModelHighAPI_Selection& thePoint2,
149 const ModelHighAPI_Selection& thePoint3);
151 /// Set by line and point.
152 CONSTRUCTIONAPI_EXPORT
153 void setByLineAndPoint(const ModelHighAPI_Selection& theLine,
154 const ModelHighAPI_Selection& thePoint,
155 const bool theIsPerpendicular);
157 /// Set by two parallel planes.
158 CONSTRUCTIONAPI_EXPORT
159 void setByTwoParallelPlanes(const ModelHighAPI_Selection& thePlane1,
160 const ModelHighAPI_Selection& thePlane2);
162 /// Set by coincident to point.
163 CONSTRUCTIONAPI_EXPORT
164 void setByCoincidentToPoint(const ModelHighAPI_Selection& thePlane,
165 const ModelHighAPI_Selection& thePoint);
168 CONSTRUCTIONAPI_EXPORT
169 void setByRotation(const ModelHighAPI_Selection& thePlane,
170 const ModelHighAPI_Selection& theAxis,
171 const ModelHighAPI_Double& theAngle);
173 /// Dump wrapped feature
174 CONSTRUCTIONAPI_EXPORT
175 virtual void dump(ModelHighAPI_Dumper& theDumper) const;
178 /// Pointer on Plane object
179 typedef std::shared_ptr<ConstructionAPI_Plane> PlanePtr;
181 /// \ingroup CPPHighAPI
182 /// \brief Create Plane feature
183 CONSTRUCTIONAPI_EXPORT
184 PlanePtr addPlane(const std::shared_ptr<ModelAPI_Document>& thePart,
185 const ModelHighAPI_Selection& theFace,
186 const ModelHighAPI_Double& theDistance,
187 const bool theIsReverse);
189 /// \ingroup CPPHighAPI
190 /// \brief Create Plane feature
191 CONSTRUCTIONAPI_EXPORT
192 PlanePtr addPlane(const std::shared_ptr<ModelAPI_Document>& thePart,
193 const ModelHighAPI_Double& theA,
194 const ModelHighAPI_Double& theB,
195 const ModelHighAPI_Double& theC,
196 const ModelHighAPI_Double& theD);
198 /// \ingroup CPPHighAPI
199 /// \brief Create Plane feature
200 CONSTRUCTIONAPI_EXPORT
201 PlanePtr addPlane(const std::shared_ptr<ModelAPI_Document>& thePart,
202 const ModelHighAPI_Selection& thePoint1,
203 const ModelHighAPI_Selection& thePoint2,
204 const ModelHighAPI_Selection& thePoint3);
206 /// \ingroup CPPHighAPI
207 /// \brief Create Plane feature
208 CONSTRUCTIONAPI_EXPORT
209 PlanePtr addPlane(const std::shared_ptr<ModelAPI_Document>& thePart,
210 const ModelHighAPI_Selection& theLine,
211 const ModelHighAPI_Selection& thePoint,
212 const bool theIsPerpendicular);
214 /// \ingroup CPPHighAPI
215 /// \brief Create Plane feature
216 CONSTRUCTIONAPI_EXPORT
217 PlanePtr addPlane(const std::shared_ptr<ModelAPI_Document>& thePart,
218 const ModelHighAPI_Selection& theObject1,
219 const ModelHighAPI_Selection& theObject2);
221 /// \ingroup CPPHighAPI
222 /// \brief Create Plane feature
223 CONSTRUCTIONAPI_EXPORT
224 PlanePtr addPlane(const std::shared_ptr<ModelAPI_Document>& thePart,
225 const ModelHighAPI_Selection& thePlane,
226 const ModelHighAPI_Selection& theAxis,
227 const ModelHighAPI_Double& theAngle);
229 #endif /* SRC_CONSTRUCTIONAPI_CONSTRUCTIONAPI_PLANE_H_ */