Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:03:31

0001 // Created on: 1992-09-28
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 _GC_MakePlane_HeaderFile
0018 #define _GC_MakePlane_HeaderFile
0019 
0020 #include <Standard.hxx>
0021 #include <Standard_DefineAlloc.hxx>
0022 #include <Standard_Handle.hxx>
0023 
0024 #include <GC_Root.hxx>
0025 #include <Geom_Plane.hxx>
0026 
0027 class gp_Pln;
0028 class gp_Pnt;
0029 class gp_Dir;
0030 class gp_Ax1;
0031 
0032 
0033 //! This class implements the following algorithms used
0034 //! to create a Plane from gp.
0035 //! * Create a Plane parallel to another and passing
0036 //! through a point.
0037 //! * Create a Plane passing through 3 points.
0038 //! * Create a Plane by its normal
0039 //! A MakePlane object provides a framework for:
0040 //! -   defining the construction of the plane,
0041 //! -   implementing the construction algorithm, and
0042 //! -   consulting the results. In particular, the Value
0043 //! function returns the constructed plane.
0044 class GC_MakePlane  : public GC_Root
0045 {
0046 public:
0047 
0048   DEFINE_STANDARD_ALLOC
0049 
0050   //! Creates a plane from a non persistent plane from package gp.
0051   Standard_EXPORT GC_MakePlane(const gp_Pln& Pl);
0052   
0053 
0054   //! P is the "Location" point or origin of the plane.
0055   //! V is the direction normal to the plane.
0056   Standard_EXPORT GC_MakePlane(const gp_Pnt& P, const gp_Dir& V);
0057   
0058 
0059   //! Creates a plane from its cartesian equation :
0060   //! Ax + By + Cz + D = 0.0
0061   //! Status is "BadEquation" if Sqrt (A*A + B*B + C*C)
0062   //! <= Resolution from gp
0063   Standard_EXPORT GC_MakePlane(const Standard_Real A, const Standard_Real B, const Standard_Real C, const Standard_Real D);
0064   
0065   //! Make a Plane from Geom <ThePlane> parallel to another
0066   //! Pln <Pln> and passing through a Pnt <Point>.
0067   Standard_EXPORT GC_MakePlane(const gp_Pln& Pln, const gp_Pnt& Point);
0068   
0069   //! Make a Plane from Geom <ThePlane> parallel to another
0070   //! Pln <Pln> at the distance <Dist> which can be greater
0071   //! or lower than zero.
0072   //! In the first case the result is at the distance
0073   //! <Dist> to the plane <Pln> in the direction of the
0074   //! normal to <Pln>.
0075   //! Otherwise it is in the opposite direction.
0076   Standard_EXPORT GC_MakePlane(const gp_Pln& Pln, const Standard_Real Dist);
0077   
0078   //! Make a Plane from Geom <ThePlane> passing through 3
0079   //! Pnt <P1>,<P2>,<P3>.
0080   //! It returns false if <P1> <P2> <P3> are confused.
0081   Standard_EXPORT GC_MakePlane(const gp_Pnt& P1, const gp_Pnt& P2, const gp_Pnt& P3);
0082   
0083   //! Make a Plane  passing through the location of <Axis>and
0084   //! normal to the Direction of <Axis>.
0085   Standard_EXPORT GC_MakePlane(const gp_Ax1& Axis);
0086   
0087   //! Returns the constructed plane.
0088   //! Exceptions StdFail_NotDone if no plane is constructed.
0089   Standard_EXPORT const Handle(Geom_Plane)& Value() const;
0090 
0091   operator const Handle(Geom_Plane)& () const { return Value(); }
0092 
0093 private:
0094   Handle(Geom_Plane) ThePlane;
0095 };
0096 
0097 #endif // _GC_MakePlane_HeaderFile