1 // Created on: 1992-08-26
2 // Created by: Remi GILET
3 // Copyright (c) 1992-1999 Matra Datavision
4 // Copyright (c) 1999-2014 OPEN CASCADE SAS
6 // This file is part of Open CASCADE Technology software library.
8 // This library is free software; you can redistribute it and/or modify it under
9 // the terms of the GNU Lesser General Public License version 2.1 as published
10 // by the Free Software Foundation, with special exception defined in the file
11 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
12 // distribution for complete text of the license and disclaimer of any warranty.
14 // Alternatively, this file may be used under the terms of Open CASCADE
15 // commercial license or contractual agreement.
17 #ifndef _gce_MakePln_HeaderFile
18 #define _gce_MakePln_HeaderFile
20 #include <Standard.hxx>
21 #include <Standard_DefineAlloc.hxx>
22 #include <Standard_Handle.hxx>
25 #include <gce_Root.hxx>
26 #include <Standard_Real.hxx>
27 class StdFail_NotDone;
35 //! This class implements the following algorithms used
36 //! to create a Plane from gp.
37 //! * Create a Pln parallel to another and passing
39 //! * Create a Pln passing through 3 points.
40 //! * Create a Pln by its normal.
41 //! Defines a non-persistent plane.
42 //! The plane is located in 3D space with an axis placement
43 //! two axis. It is the local coordinate system of the plane.
45 //! The "Location" point and the main direction of this axis
46 //! placement define the "Axis" of the plane. It is the axis
47 //! normal to the plane which gives the orientation of the
50 //! The "XDirection" and the "YDirection" of the axis
51 //! placement define the plane ("XAxis" and "YAxis") .
52 class gce_MakePln : public gce_Root
60 //! The coordinate system of the plane is defined with the axis
62 //! The "Direction" of A2 defines the normal to the plane.
63 //! The "Location" of A2 defines the location (origin) of the plane.
64 //! The "XDirection" and "YDirection" of A2 define the "XAxis" and
65 //! the "YAxis" of the plane used to parametrize the plane.
66 Standard_EXPORT gce_MakePln(const gp_Ax2& A2);
69 //! Creates a plane with the "Location" point <P>
70 //! and the normal direction <V>.
71 Standard_EXPORT gce_MakePln(const gp_Pnt& P, const gp_Dir& V);
74 //! Creates a plane from its cartesian equation :
75 //! A * X + B * Y + C * Z + D = 0.0
77 //! the status is "BadEquation" if Sqrt (A*A + B*B + C*C) <=
78 //! Resolution from gp.
79 Standard_EXPORT gce_MakePln(const Standard_Real A, const Standard_Real B, const Standard_Real C, const Standard_Real D);
81 //! Make a Pln from gp <ThePln> parallel to another
82 //! Pln <Pln> and passing through a Pnt <Point>.
83 Standard_EXPORT gce_MakePln(const gp_Pln& Pln, const gp_Pnt& Point);
85 //! Make a Pln from gp <ThePln> parallel to another
86 //! Pln <Pln> at the distance <Dist> which can be greater
87 //! or less than zero.
88 //! In the first case the result is at the distance
89 //! <Dist> to the plane <Pln> in the direction of the
91 //! Otherwize it is in the opposite direction.
92 Standard_EXPORT gce_MakePln(const gp_Pln& Pln, const Standard_Real Dist);
94 //! Make a Pln from gp <ThePln> passing through 3
95 //! Pnt <P1>,<P2>,<P3>.
96 //! It returns false if <P1> <P2> <P3> are confused.
97 Standard_EXPORT gce_MakePln(const gp_Pnt& P1, const gp_Pnt& P2, const gp_Pnt& P3);
99 //! Make a Pln from gp <ThePln> perpendicular to the line
100 //! passing through <P1>,<P2>.
101 //! The status is "ConfusedPoints" if <P1> <P2> are confused.
102 Standard_EXPORT gce_MakePln(const gp_Pnt& P1, const gp_Pnt& P2);
104 //! Make a pln passing through the location of <Axis>and
105 //! normal to the Direction of <Axis>.
106 //! Warning - If an error occurs (that is, when IsDone returns
107 //! false), the Status function returns:
108 //! - gce_BadEquation if Sqrt(A*A + B*B +
109 //! C*C) is less than or equal to gp::Resolution(),
110 //! - gce_ConfusedPoints if P1 and P2 are coincident, or
111 //! - gce_ColinearPoints if P1, P2 and P3 are collinear.
112 Standard_EXPORT gce_MakePln(const gp_Ax1& Axis);
114 //! Returns the constructed plane.
115 //! Exceptions StdFail_NotDone if no plane is constructed.
116 Standard_EXPORT const gp_Pln& Value() const;
118 Standard_EXPORT const gp_Pln& Operator() const;
119 Standard_EXPORT operator gp_Pln() const;
145 #endif // _gce_MakePln_HeaderFile