Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-09-09 09:15:23

0001 // Created on: 1992-08-26
0002 // Created by: Remi GILET
0003 // Copyright (c) 1992-1999 Matra Datavision
0004 // Copyright (c) 1999-2014 OPEN CASCADE SAS
0005 //
0006 // This file is part of Open CASCADE Technology software library.
0007 //
0008 // This library is free software; you can redistribute it and/or modify it under
0009 // the terms of the GNU Lesser General Public License version 2.1 as published
0010 // by the Free Software Foundation, with special exception defined in the file
0011 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
0012 // distribution for complete text of the license and disclaimer of any warranty.
0013 //
0014 // Alternatively, this file may be used under the terms of Open CASCADE
0015 // commercial license or contractual agreement.
0016 
0017 #ifndef _gce_MakePln_HeaderFile
0018 #define _gce_MakePln_HeaderFile
0019 
0020 #include <Standard.hxx>
0021 #include <Standard_DefineAlloc.hxx>
0022 #include <Standard_Handle.hxx>
0023 
0024 #include <gp_Pln.hxx>
0025 #include <gce_Root.hxx>
0026 class gp_Ax2;
0027 class gp_Pnt;
0028 class gp_Dir;
0029 class gp_Ax1;
0030 
0031 //! This class implements the following algorithms used
0032 //! to create a Plane from gp.
0033 //! * Create a Pln parallel to another and passing
0034 //! through a point.
0035 //! * Create a Pln passing through 3 points.
0036 //! * Create a Pln by its normal.
0037 //! Defines a non-persistent plane.
0038 //! The plane is located in 3D space with an axis placement
0039 //! two axis. It is the local coordinate system of the plane.
0040 //!
0041 //! The "Location" point and the main direction of this axis
0042 //! placement define the "Axis" of the plane. It is the axis
0043 //! normal to the plane which gives the orientation of the
0044 //! plane.
0045 //!
0046 //! The "XDirection" and the "YDirection" of the axis
0047 //! placement define the plane ("XAxis" and "YAxis") .
0048 class gce_MakePln : public gce_Root
0049 {
0050 public:
0051   DEFINE_STANDARD_ALLOC
0052 
0053   //! The coordinate system of the plane is defined with the axis
0054   //! placement A2.
0055   //! The "Direction" of A2 defines the normal to the plane.
0056   //! The "Location" of A2 defines the location (origin) of the plane.
0057   //! The "XDirection" and "YDirection" of A2 define the "XAxis" and
0058   //! the "YAxis" of the plane used to parametrize the plane.
0059   Standard_EXPORT gce_MakePln(const gp_Ax2& A2);
0060 
0061   //! Creates a plane with the  "Location" point <P>
0062   //! and the normal direction <V>.
0063   Standard_EXPORT gce_MakePln(const gp_Pnt& P, const gp_Dir& V);
0064 
0065   //! Creates a plane from its cartesian equation :
0066   //! A * X + B * Y + C * Z + D = 0.0
0067   //!
0068   //! the status is "BadEquation" if Sqrt (A*A + B*B + C*C) <=
0069   //! Resolution from gp.
0070   Standard_EXPORT gce_MakePln(const Standard_Real A,
0071                               const Standard_Real B,
0072                               const Standard_Real C,
0073                               const Standard_Real D);
0074 
0075   //! Make a Pln from gp <ThePln> parallel to another
0076   //! Pln <Pln> and passing through a Pnt <Point>.
0077   Standard_EXPORT gce_MakePln(const gp_Pln& Pln, const gp_Pnt& Point);
0078 
0079   //! Make a Pln from gp <ThePln> parallel to another
0080   //! Pln <Pln> at the distance <Dist> which can be greater
0081   //! or less than zero.
0082   //! In the first case the result is at the distance
0083   //! <Dist> to the plane <Pln> in the direction of the
0084   //! normal to <Pln>.
0085   //! Otherwise it is in the opposite direction.
0086   Standard_EXPORT gce_MakePln(const gp_Pln& Pln, const Standard_Real Dist);
0087 
0088   //! Make a Pln from gp <ThePln> passing through 3
0089   //! Pnt <P1>,<P2>,<P3>.
0090   //! It returns false if <P1> <P2> <P3> are confused.
0091   Standard_EXPORT gce_MakePln(const gp_Pnt& P1, const gp_Pnt& P2, const gp_Pnt& P3);
0092 
0093   //! Make a Pln from gp <ThePln> perpendicular to the line
0094   //! passing through <P1>,<P2>.
0095   //! The status is "ConfusedPoints" if <P1> <P2> are confused.
0096   Standard_EXPORT gce_MakePln(const gp_Pnt& P1, const gp_Pnt& P2);
0097 
0098   //! Make a pln  passing through the location of <Axis>and
0099   //! normal to the Direction of <Axis>.
0100   //! Warning -  If an error occurs (that is, when IsDone returns
0101   //! false), the Status function returns:
0102   //! -   gce_BadEquation if Sqrt(A*A + B*B +
0103   //! C*C) is less than or equal to gp::Resolution(),
0104   //! -   gce_ConfusedPoints if P1 and P2 are coincident, or
0105   //! -   gce_ColinearPoints if P1, P2 and P3 are collinear.
0106   Standard_EXPORT gce_MakePln(const gp_Ax1& Axis);
0107 
0108   //! Returns the constructed plane.
0109   //! Exceptions StdFail_NotDone if no plane is constructed.
0110   Standard_EXPORT const gp_Pln& Value() const;
0111 
0112   Standard_EXPORT const gp_Pln& Operator() const;
0113   Standard_EXPORT               operator gp_Pln() const;
0114 
0115 protected:
0116 private:
0117   gp_Pln ThePln;
0118 };
0119 
0120 #endif // _gce_MakePln_HeaderFile