Back to home page

EIC code displayed by LXR

 
 

    


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

0001 // Created on: 1991-02-21
0002 // Created by: Isabelle GRIGNON
0003 // Copyright (c) 1991-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 _Extrema_ExtPElS_HeaderFile
0018 #define _Extrema_ExtPElS_HeaderFile
0019 
0020 #include <Standard.hxx>
0021 #include <Standard_DefineAlloc.hxx>
0022 
0023 #include <Standard_Integer.hxx>
0024 #include <Extrema_POnSurf.hxx>
0025 class gp_Pnt;
0026 class gp_Cylinder;
0027 class gp_Pln;
0028 class gp_Cone;
0029 class gp_Torus;
0030 class gp_Sphere;
0031 
0032 
0033 //! It calculates all the extremum distances
0034 //! between a point and a surface.
0035 //! These distances can be minimum or maximum.
0036 class Extrema_ExtPElS 
0037 {
0038 public:
0039 
0040   DEFINE_STANDARD_ALLOC
0041 
0042   
0043   Standard_EXPORT Extrema_ExtPElS();
0044   
0045   //! It calculates all the distances between a point
0046   //! and a cylinder from gp.
0047   //! Tol is used to test if the point is on the axis.
0048   Standard_EXPORT Extrema_ExtPElS(const gp_Pnt& P, const gp_Cylinder& S, const Standard_Real Tol);
0049   
0050   Standard_EXPORT void Perform (const gp_Pnt& P, const gp_Cylinder& S, const Standard_Real Tol);
0051   
0052   //! It calculates all the distances between a point
0053   //! and a plane from gp.
0054   //! Tol is used to test if the point is on the plane.
0055   Standard_EXPORT Extrema_ExtPElS(const gp_Pnt& P, const gp_Pln& S, const Standard_Real Tol);
0056   
0057   Standard_EXPORT void Perform (const gp_Pnt& P, const gp_Pln& S, const Standard_Real Tol);
0058   
0059   //! It calculates all the distances between a point
0060   //! and a cone from gp.
0061   //! Tol is used to test if the point is at the apex or
0062   //! on the axis.
0063   Standard_EXPORT Extrema_ExtPElS(const gp_Pnt& P, const gp_Cone& S, const Standard_Real Tol);
0064   
0065   Standard_EXPORT void Perform (const gp_Pnt& P, const gp_Cone& S, const Standard_Real Tol);
0066   
0067   //! It calculates all the distances between a point
0068   //! and a torus from gp.
0069   //! Tol is used to test if the point is on the axis.
0070   Standard_EXPORT Extrema_ExtPElS(const gp_Pnt& P, const gp_Torus& S, const Standard_Real Tol);
0071   
0072   Standard_EXPORT void Perform (const gp_Pnt& P, const gp_Torus& S, const Standard_Real Tol);
0073   
0074   //! It calculates all the distances between a point
0075   //! and a sphere from gp.
0076   //! Tol is used to test if the point is at the center.
0077   Standard_EXPORT Extrema_ExtPElS(const gp_Pnt& P, const gp_Sphere& S, const Standard_Real Tol);
0078   
0079   Standard_EXPORT void Perform (const gp_Pnt& P, const gp_Sphere& S, const Standard_Real Tol);
0080   
0081   //! Returns True if the distances are found.
0082   Standard_EXPORT Standard_Boolean IsDone() const;
0083   
0084   //! Returns the number of extremum distances.
0085   Standard_EXPORT Standard_Integer NbExt() const;
0086   
0087   //! Returns the value of the Nth resulting square distance.
0088   Standard_EXPORT Standard_Real SquareDistance (const Standard_Integer N) const;
0089   
0090   //! Returns the point of the Nth resulting distance.
0091   Standard_EXPORT const Extrema_POnSurf& Point (const Standard_Integer N) const;
0092 
0093 
0094 
0095 
0096 protected:
0097 
0098 
0099 
0100 
0101 
0102 private:
0103 
0104 
0105 
0106   Standard_Boolean myDone;
0107   Standard_Integer myNbExt;
0108   Standard_Real mySqDist[4];
0109   Extrema_POnSurf myPoint[4];
0110 
0111 
0112 };
0113 
0114 
0115 
0116 
0117 
0118 
0119 
0120 #endif // _Extrema_ExtPElS_HeaderFile