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