SHAPER  9.12.0
ConstructionAPI_Plane.h
1 // Copyright (C) 2014-2023 CEA, EDF
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 #include <ModelHighAPI_Integer.h>
30 
33 
38 {
39 public:
41  CONSTRUCTIONAPI_EXPORT
42  explicit ConstructionAPI_Plane(const std::shared_ptr<ModelAPI_Feature>& theFeature);
43 
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  const ModelHighAPI_Integer& theNbCopy = ModelHighAPI_Integer(1));
51 
53  CONSTRUCTIONAPI_EXPORT
54  ConstructionAPI_Plane(const std::shared_ptr<ModelAPI_Feature>& theFeature,
55  const ModelHighAPI_Double& theA,
56  const ModelHighAPI_Double& theB,
57  const ModelHighAPI_Double& theC,
58  const ModelHighAPI_Double& theD);
59 
61  CONSTRUCTIONAPI_EXPORT
62  ConstructionAPI_Plane(const std::shared_ptr<ModelAPI_Feature>& theFeature,
63  const ModelHighAPI_Selection& thePoint1,
64  const ModelHighAPI_Selection& thePoint2,
65  const ModelHighAPI_Selection& thePoint3);
66 
68  CONSTRUCTIONAPI_EXPORT
69  ConstructionAPI_Plane(const std::shared_ptr<ModelAPI_Feature>& theFeature,
70  const ModelHighAPI_Selection& theLine,
71  const ModelHighAPI_Selection& thePoint,
72  const bool theIsPerpendicular);
73 
75  CONSTRUCTIONAPI_EXPORT
76  ConstructionAPI_Plane(const std::shared_ptr<ModelAPI_Feature>& theFeature,
77  const ModelHighAPI_Selection& theObject1,
78  const ModelHighAPI_Selection& theObject2);
79 
81  CONSTRUCTIONAPI_EXPORT
82  ConstructionAPI_Plane(const std::shared_ptr<ModelAPI_Feature>& theFeature,
83  const ModelHighAPI_Selection& thePlane,
84  const ModelHighAPI_Selection& theAxis,
85  const ModelHighAPI_Double& theAngle,
86  const ModelHighAPI_Integer& theNbCopy = ModelHighAPI_Integer(1));
87 
89  CONSTRUCTIONAPI_EXPORT
90  virtual ~ConstructionAPI_Plane();
91 
92  INTERFACE_21(ConstructionPlugin_Plane::ID(),
130  plane1, ConstructionPlugin_Plane::PLANE1(),
132  plane2, ConstructionPlugin_Plane::PLANE2(),
134  nbcopy, ConstructionPlugin_Plane::NB_COPIES(),
136 
137 
138  CONSTRUCTIONAPI_EXPORT
139  void setByFaceAndDistance(const ModelHighAPI_Selection& theFace,
140  const ModelHighAPI_Double& theDistance,
141  const bool theIsReverse,
142  const ModelHighAPI_Integer& theNbCopy = ModelHighAPI_Integer(1));
143 
145  CONSTRUCTIONAPI_EXPORT
146  void setByGeneralEquation(const ModelHighAPI_Double& theA,
147  const ModelHighAPI_Double& theB,
148  const ModelHighAPI_Double& theC,
149  const ModelHighAPI_Double& theD);
150 
152  CONSTRUCTIONAPI_EXPORT
153  void setByThreePoints(const ModelHighAPI_Selection& thePoint1,
154  const ModelHighAPI_Selection& thePoint2,
155  const ModelHighAPI_Selection& thePoint3);
156 
158  CONSTRUCTIONAPI_EXPORT
159  void setByLineAndPoint(const ModelHighAPI_Selection& theLine,
160  const ModelHighAPI_Selection& thePoint,
161  const bool theIsPerpendicular);
162 
164  CONSTRUCTIONAPI_EXPORT
165  void setByTwoParallelPlanes(const ModelHighAPI_Selection& thePlane1,
166  const ModelHighAPI_Selection& thePlane2);
167 
169  CONSTRUCTIONAPI_EXPORT
170  void setByCoincidentToPoint(const ModelHighAPI_Selection& thePlane,
171  const ModelHighAPI_Selection& thePoint);
172 
174  CONSTRUCTIONAPI_EXPORT
175  void setByRotation(const ModelHighAPI_Selection& thePlane,
176  const ModelHighAPI_Selection& theAxis,
177  const ModelHighAPI_Double& theAngle,
178  const ModelHighAPI_Integer& theNbCopy = ModelHighAPI_Integer(1));
179 
181  CONSTRUCTIONAPI_EXPORT
182  virtual void dump(ModelHighAPI_Dumper& theDumper) const;
183 };
184 
186 typedef std::shared_ptr<ConstructionAPI_Plane> PlanePtr;
187 
190 CONSTRUCTIONAPI_EXPORT
191 PlanePtr addPlane(const std::shared_ptr<ModelAPI_Document>& thePart,
192  const ModelHighAPI_Selection& theFace,
193  const ModelHighAPI_Double& theDistance,
194  const bool theIsReverse,
195  const ModelHighAPI_Integer& theNbCopy = ModelHighAPI_Integer(1));
196 
199 CONSTRUCTIONAPI_EXPORT
200 PlanePtr addPlane(const std::shared_ptr<ModelAPI_Document>& thePart,
201  const ModelHighAPI_Double& theA,
202  const ModelHighAPI_Double& theB,
203  const ModelHighAPI_Double& theC,
204  const ModelHighAPI_Double& theD);
205 
208 CONSTRUCTIONAPI_EXPORT
209 PlanePtr addPlane(const std::shared_ptr<ModelAPI_Document>& thePart,
210  const ModelHighAPI_Selection& thePoint1,
211  const ModelHighAPI_Selection& thePoint2,
212  const ModelHighAPI_Selection& thePoint3);
213 
216 CONSTRUCTIONAPI_EXPORT
217 PlanePtr addPlane(const std::shared_ptr<ModelAPI_Document>& thePart,
218  const ModelHighAPI_Selection& theLine,
219  const ModelHighAPI_Selection& thePoint,
220  const bool theIsPerpendicular);
221 
224 CONSTRUCTIONAPI_EXPORT
225 PlanePtr addPlane(const std::shared_ptr<ModelAPI_Document>& thePart,
226  const ModelHighAPI_Selection& theObject1,
227  const ModelHighAPI_Selection& theObject2);
228 
231 CONSTRUCTIONAPI_EXPORT
232 PlanePtr addPlane(const std::shared_ptr<ModelAPI_Document>& thePart,
233  const ModelHighAPI_Selection& thePlane,
234  const ModelHighAPI_Selection& theAxis,
235  const ModelHighAPI_Double& theAngle,
236  const ModelHighAPI_Integer& theNbCopy = ModelHighAPI_Integer(1));
237 
238 #endif /* SRC_CONSTRUCTIONAPI_CONSTRUCTIONAPI_PLANE_H_ */
Interface for Plane feature.
Definition: ConstructionAPI_Plane.h:38
ConstructionAPI_Plane(const std::shared_ptr< ModelAPI_Feature > &theFeature)
Constructor without values.
Definition: ConstructionAPI_Plane.cpp:26
virtual ~ConstructionAPI_Plane()
Destructor.
Definition: ConstructionAPI_Plane.cpp:113
virtual std::shared_ptr< ModelAPI_AttributeString > creationMethod() const
Creation method.
Definition: ConstructionAPI_Plane.h:135
virtual std::shared_ptr< ModelAPI_AttributeSelection > plane1() const
Plane 1.
Definition: ConstructionAPI_Plane.h:135
virtual std::shared_ptr< ModelAPI_AttributeSelection > point() const
Point for plane.
Definition: ConstructionAPI_Plane.h:135
virtual void dump(ModelHighAPI_Dumper &theDumper) const
Dump wrapped feature.
Definition: ConstructionAPI_Plane.cpp:218
virtual std::shared_ptr< ModelAPI_AttributeSelection > axis() const
Axis for rotation.
Definition: ConstructionAPI_Plane.h:135
virtual std::shared_ptr< ModelAPI_AttributeDouble > C() const
Parameter C for general equation.
Definition: ConstructionAPI_Plane.h:135
virtual std::shared_ptr< ModelAPI_AttributeBoolean > reverse() const
Reverse flag.
Definition: ConstructionAPI_Plane.h:135
void setByLineAndPoint(const ModelHighAPI_Selection &theLine, const ModelHighAPI_Selection &thePoint, const bool theIsPerpendicular)
Set by line and point.
Definition: ConstructionAPI_Plane.cpp:163
void setByGeneralEquation(const ModelHighAPI_Double &theA, const ModelHighAPI_Double &theB, const ModelHighAPI_Double &theC, const ModelHighAPI_Double &theD)
Set GeneralEquation parameters of the feature.
Definition: ConstructionAPI_Plane.cpp:135
virtual std::shared_ptr< ModelAPI_AttributeSelection > line() const
Line for plane.
Definition: ConstructionAPI_Plane.h:135
virtual std::shared_ptr< ModelAPI_AttributeSelection > plane() const
Plane face.
Definition: ConstructionAPI_Plane.h:135
void setByTwoParallelPlanes(const ModelHighAPI_Selection &thePlane1, const ModelHighAPI_Selection &thePlane2)
Set by two parallel planes.
Definition: ConstructionAPI_Plane.cpp:176
virtual std::shared_ptr< ModelAPI_AttributeBoolean > perpendicular() const
Perpendicular flag.
Definition: ConstructionAPI_Plane.h:135
virtual std::shared_ptr< ModelAPI_AttributeDouble > B() const
Parameter B for general equation.
Definition: ConstructionAPI_Plane.h:135
void setByRotation(const ModelHighAPI_Selection &thePlane, const ModelHighAPI_Selection &theAxis, const ModelHighAPI_Double &theAngle, const ModelHighAPI_Integer &theNbCopy=ModelHighAPI_Integer(1))
Set by rotation.
Definition: ConstructionAPI_Plane.cpp:201
virtual std::shared_ptr< ModelAPI_AttributeSelection > plane2() const
Plane 2.
Definition: ConstructionAPI_Plane.h:135
virtual std::shared_ptr< ModelAPI_AttributeSelection > point3() const
Point 3 for plane.
Definition: ConstructionAPI_Plane.h:135
virtual std::shared_ptr< ModelAPI_AttributeString > creationMethodByOtherPlane() const
Creation method by other plane.
Definition: ConstructionAPI_Plane.h:135
virtual std::shared_ptr< ModelAPI_AttributeInteger > nbcopy() const
Number of copies.
Definition: ConstructionAPI_Plane.h:135
virtual std::shared_ptr< ModelAPI_AttributeDouble > A() const
Parameter A for general equation.
Definition: ConstructionAPI_Plane.h:135
virtual std::shared_ptr< ModelAPI_AttributeSelection > coincidentPoint() const
Coincident point.
Definition: ConstructionAPI_Plane.h:135
virtual std::shared_ptr< ModelAPI_AttributeDouble > angle() const
Rotation angle.
Definition: ConstructionAPI_Plane.h:135
virtual std::shared_ptr< ModelAPI_AttributeSelection > point1() const
Point 1 for plane.
Definition: ConstructionAPI_Plane.h:135
virtual std::shared_ptr< ModelAPI_AttributeSelection > point2() const
Point 2 for plane.
Definition: ConstructionAPI_Plane.h:135
virtual std::shared_ptr< ModelAPI_AttributeDouble > D() const
Parameter D for general equation.
Definition: ConstructionAPI_Plane.h:135
void setByFaceAndDistance(const ModelHighAPI_Selection &theFace, const ModelHighAPI_Double &theDistance, const bool theIsReverse, const ModelHighAPI_Integer &theNbCopy=ModelHighAPI_Integer(1))
Set face and distance.
Definition: ConstructionAPI_Plane.cpp:118
void setByThreePoints(const ModelHighAPI_Selection &thePoint1, const ModelHighAPI_Selection &thePoint2, const ModelHighAPI_Selection &thePoint3)
Set by three points.
Definition: ConstructionAPI_Plane.cpp:150
void setByCoincidentToPoint(const ModelHighAPI_Selection &thePlane, const ModelHighAPI_Selection &thePoint)
Set by coincident to point.
Definition: ConstructionAPI_Plane.cpp:188
virtual std::shared_ptr< ModelAPI_AttributeDouble > distance() const
Distance.
Definition: ConstructionAPI_Plane.h:135
static const std::string & REVERSE()
Attribute name for reverse flag.
Definition: ConstructionPlugin_Plane.h:191
static const std::string & DISTANCE()
Attribute name for distance.
Definition: ConstructionPlugin_Plane.h:184
static const std::string & POINT()
Attribute name for point.
Definition: ConstructionPlugin_Plane.h:163
static const std::string & POINT2()
Attribute name for second point.
Definition: ConstructionPlugin_Plane.h:142
static const std::string & AXIS()
Attribute name for axis.
Definition: ConstructionPlugin_Plane.h:205
static const std::string & ID()
Plane kind.
Definition: ConstructionPlugin_Plane.h:58
static const std::string & CREATION_METHOD_BY_OTHER_PLANE_OPTION()
Attribute name for creation method.
Definition: ConstructionPlugin_Plane.h:100
static const std::string & POINT1()
Attribute name for first point.
Definition: ConstructionPlugin_Plane.h:135
static const std::string & POINT3()
Attribute name for third point.
Definition: ConstructionPlugin_Plane.h:149
static const std::string & A()
Attribute name for a parameter for the general equation of a plane (ax+by+cz+d=0)
Definition: ConstructionPlugin_Plane.h:237
static const std::string & LINE()
Attribute name for line.
Definition: ConstructionPlugin_Plane.h:156
static const std::string & C()
Attribute name for c parameter for the general equation of a plane (ax+by+cz+d=0)
Definition: ConstructionPlugin_Plane.h:249
static const std::string & COINCIDENT_POINT()
Attribute name for coincident point.
Definition: ConstructionPlugin_Plane.h:198
static const std::string & PLANE()
Attribute name for selected plane.
Definition: ConstructionPlugin_Plane.h:177
static const std::string & CREATION_METHOD()
Attribute name for creation method.
Definition: ConstructionPlugin_Plane.h:65
static const std::string & PERPENDICULAR()
Attribute name for perpendicular flag.
Definition: ConstructionPlugin_Plane.h:170
static const std::string & B()
Attribute name for b parameter for the general equation of a plane (ax+by+cz+d=0)
Definition: ConstructionPlugin_Plane.h:243
static const std::string & D()
Attribute name for d parameter for the general equation of a plane (ax+by+cz+d=0)
Definition: ConstructionPlugin_Plane.h:255
static const std::string & ANGLE()
Attribute name for angle.
Definition: ConstructionPlugin_Plane.h:212
Attribute that contains boolean value.
Definition: ModelAPI_AttributeBoolean.h:31
Attribute that contains real value with double precision.
Definition: ModelAPI_AttributeDouble.h:34
API for the attribute that contains integer (int).
Definition: ModelAPI_AttributeInteger.h:34
Attribute that contains reference to the sub-shape of some result, the selected shape.
Definition: ModelAPI_AttributeSelection.h:35
API for the attribute that contains std (null terminated) string.
Definition: ModelAPI_AttributeString.h:33
Document for internal data structure of any object storage.
Definition: ModelAPI_Document.h:52
Class for filling ModelAPI_AttributeDouble.
Definition: ModelHighAPI_Double.h:37
Dump engine for the model.
Definition: ModelHighAPI_Dumper.h:81
Class for filling ModelAPI_AttributeInteger.
Definition: ModelHighAPI_Integer.h:36
Base class for feature interfaces.
Definition: ModelHighAPI_Interface.h:42
Class for filling ModelAPI_AttributeSelection.
Definition: ModelHighAPI_Selection.h:49
PlanePtr addPlane(const std::shared_ptr< ModelAPI_Document > &thePart, const ModelHighAPI_Selection &theFace, const ModelHighAPI_Double &theDistance, const bool theIsReverse, const ModelHighAPI_Integer &theNbCopy=ModelHighAPI_Integer(1))
Create Plane feature.
Definition: ConstructionAPI_Plane.cpp:289