]> SALOME platform Git repositories - modules/shaper.git/blob - src/ConstructionAPI/ConstructionAPI_Plane.h
Salome HOME
Task #2924 : Ability to remove a result. Disable ability to remove groups and fields...
[modules/shaper.git] / src / ConstructionAPI / ConstructionAPI_Plane.h
1 // Copyright (C) 2014-2019  CEA/DEN, EDF R&D
2 //
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.
7 //
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.
12 //
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
16 //
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
18 //
19
20 #ifndef SRC_CONSTRUCTIONAPI_CONSTRUCTIONAPI_PLANE_H_
21 #define SRC_CONSTRUCTIONAPI_CONSTRUCTIONAPI_PLANE_H_
22
23 #include "ConstructionAPI.h"
24
25 #include <ConstructionPlugin_Plane.h>
26
27 #include <ModelHighAPI_Interface.h>
28 #include <ModelHighAPI_Macro.h>
29
30 class ModelHighAPI_Double;
31 class ModelHighAPI_Selection;
32
33 /// \class ConstructionAPI_Plane
34 /// \ingroup CPPHighAPI
35 /// \brief Interface for Plane feature
36 class ConstructionAPI_Plane: public ModelHighAPI_Interface
37 {
38 public:
39   /// Constructor without values
40   CONSTRUCTIONAPI_EXPORT
41   explicit ConstructionAPI_Plane(const std::shared_ptr<ModelAPI_Feature>& theFeature);
42
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);
49
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);
57
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);
64
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);
71
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);
77
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);
84
85   /// Destructor
86   CONSTRUCTIONAPI_EXPORT
87   virtual ~ConstructionAPI_Plane();
88
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 */)
131
132   /// Set face and distance
133   CONSTRUCTIONAPI_EXPORT
134   void setByFaceAndDistance(const ModelHighAPI_Selection& theFace,
135                             const ModelHighAPI_Double& theDistance,
136                             const bool theIsReverse);
137
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);
144
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);
150
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);
156
157   /// Set by two parallel planes.
158   CONSTRUCTIONAPI_EXPORT
159   void setByTwoParallelPlanes(const ModelHighAPI_Selection& thePlane1,
160                               const ModelHighAPI_Selection& thePlane2);
161
162   /// Set by coincident to point.
163   CONSTRUCTIONAPI_EXPORT
164   void setByCoincidentToPoint(const ModelHighAPI_Selection& thePlane,
165                               const ModelHighAPI_Selection& thePoint);
166
167   /// Set by rotation.
168   CONSTRUCTIONAPI_EXPORT
169   void setByRotation(const ModelHighAPI_Selection& thePlane,
170                      const ModelHighAPI_Selection& theAxis,
171                      const ModelHighAPI_Double& theAngle);
172
173   /// Dump wrapped feature
174   CONSTRUCTIONAPI_EXPORT
175   virtual void dump(ModelHighAPI_Dumper& theDumper) const;
176 };
177
178 /// Pointer on Plane object
179 typedef std::shared_ptr<ConstructionAPI_Plane> PlanePtr;
180
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);
188
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);
197
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);
205
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);
213
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);
220
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);
228
229 #endif /* SRC_CONSTRUCTIONAPI_CONSTRUCTIONAPI_PLANE_H_ */