Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-09-26 09:03:01

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 //! It calculates all the extremum distances
0033 //! between a point and a surface.
0034 //! These distances can be minimum or maximum.
0035 class Extrema_ExtPElS
0036 {
0037 public:
0038   DEFINE_STANDARD_ALLOC
0039 
0040   Standard_EXPORT Extrema_ExtPElS();
0041 
0042   //! It calculates all the distances between a point
0043   //! and a cylinder from gp.
0044   //! Tol is used to test if the point is on the axis.
0045   Standard_EXPORT Extrema_ExtPElS(const gp_Pnt& P, const gp_Cylinder& S, const double Tol);
0046 
0047   Standard_EXPORT void Perform(const gp_Pnt& P, const gp_Cylinder& S, const double Tol);
0048 
0049   //! It calculates all the distances between a point
0050   //! and a plane from gp.
0051   //! Tol is used to test if the point is on the plane.
0052   Standard_EXPORT Extrema_ExtPElS(const gp_Pnt& P, const gp_Pln& S, const double Tol);
0053 
0054   Standard_EXPORT void Perform(const gp_Pnt& P, const gp_Pln& S, const double Tol);
0055 
0056   //! It calculates all the distances between a point
0057   //! and a cone from gp.
0058   //! Tol is used to test if the point is at the apex or
0059   //! on the axis.
0060   Standard_EXPORT Extrema_ExtPElS(const gp_Pnt& P, const gp_Cone& S, const double Tol);
0061 
0062   Standard_EXPORT void Perform(const gp_Pnt& P, const gp_Cone& S, const double Tol);
0063 
0064   //! It calculates all the distances between a point
0065   //! and a torus from gp.
0066   //! Tol is used to test if the point is on the axis.
0067   Standard_EXPORT Extrema_ExtPElS(const gp_Pnt& P, const gp_Torus& S, const double Tol);
0068 
0069   Standard_EXPORT void Perform(const gp_Pnt& P, const gp_Torus& S, const double Tol);
0070 
0071   //! It calculates all the distances between a point
0072   //! and a sphere from gp.
0073   //! Tol is used to test if the point is at the center.
0074   Standard_EXPORT Extrema_ExtPElS(const gp_Pnt& P, const gp_Sphere& S, const double Tol);
0075 
0076   Standard_EXPORT void Perform(const gp_Pnt& P, const gp_Sphere& S, const double Tol);
0077 
0078   //! Returns True if the distances are found.
0079   Standard_EXPORT bool IsDone() const;
0080 
0081   //! Returns the number of extremum distances.
0082   Standard_EXPORT int NbExt() const;
0083 
0084   //! Returns the value of the Nth resulting square distance.
0085   Standard_EXPORT double SquareDistance(const int N) const;
0086 
0087   //! Returns the point of the Nth resulting distance.
0088   Standard_EXPORT const Extrema_POnSurf& Point(const int N) const;
0089 
0090 private:
0091   bool            myDone;
0092   int             myNbExt;
0093   double          mySqDist[4];
0094   Extrema_POnSurf myPoint[4];
0095 };
0096 
0097 #endif // _Extrema_ExtPElS_HeaderFile