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