1 // Created on: 1991-02-21
2 // Created by: Isabelle GRIGNON
3 // Copyright (c) 1991-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 _Extrema_ExtPElS_HeaderFile
18 #define _Extrema_ExtPElS_HeaderFile
20 #include <Standard.hxx>
21 #include <Standard_DefineAlloc.hxx>
22 #include <Standard_Handle.hxx>
24 #include <Standard_Boolean.hxx>
25 #include <Standard_Integer.hxx>
26 #include <Standard_Real.hxx>
27 #include <Extrema_POnSurf.hxx>
28 class StdFail_NotDone;
29 class Standard_OutOfRange;
36 class Extrema_POnSurf;
39 //! It calculates all the extremum distances
40 //! between a point and a surface.
41 //! These distances can be minimum or maximum.
49 Standard_EXPORT Extrema_ExtPElS();
51 //! It calculates all the distances between a point
52 //! and a cylinder from gp.
53 //! Tol is used to test if the point is on the axis.
54 Standard_EXPORT Extrema_ExtPElS(const gp_Pnt& P, const gp_Cylinder& S, const Standard_Real Tol);
56 Standard_EXPORT void Perform (const gp_Pnt& P, const gp_Cylinder& S, const Standard_Real Tol);
58 //! It calculates all the distances between a point
59 //! and a plane from gp.
60 //! Tol is used to test if the point is on the plane.
61 Standard_EXPORT Extrema_ExtPElS(const gp_Pnt& P, const gp_Pln& S, const Standard_Real Tol);
63 Standard_EXPORT void Perform (const gp_Pnt& P, const gp_Pln& S, const Standard_Real Tol);
65 //! It calculates all the distances between a point
66 //! and a cone from gp.
67 //! Tol is used to test if the point is at the apex or
69 Standard_EXPORT Extrema_ExtPElS(const gp_Pnt& P, const gp_Cone& S, const Standard_Real Tol);
71 Standard_EXPORT void Perform (const gp_Pnt& P, const gp_Cone& S, const Standard_Real Tol);
73 //! It calculates all the distances between a point
74 //! and a torus from gp.
75 //! Tol is used to test if the point is on the axis.
76 Standard_EXPORT Extrema_ExtPElS(const gp_Pnt& P, const gp_Torus& S, const Standard_Real Tol);
78 Standard_EXPORT void Perform (const gp_Pnt& P, const gp_Torus& S, const Standard_Real Tol);
80 //! It calculates all the distances between a point
81 //! and a sphere from gp.
82 //! Tol is used to test if the point is at the center.
83 Standard_EXPORT Extrema_ExtPElS(const gp_Pnt& P, const gp_Sphere& S, const Standard_Real Tol);
85 Standard_EXPORT void Perform (const gp_Pnt& P, const gp_Sphere& S, const Standard_Real Tol);
87 //! Returns True if the distances are found.
88 Standard_EXPORT Standard_Boolean IsDone() const;
90 //! Returns the number of extremum distances.
91 Standard_EXPORT Standard_Integer NbExt() const;
93 //! Returns the value of the Nth resulting square distance.
94 Standard_EXPORT Standard_Real SquareDistance (const Standard_Integer N) const;
96 //! Returns the point of the Nth resulting distance.
97 Standard_EXPORT const Extrema_POnSurf& Point (const Standard_Integer N) const;
112 Standard_Boolean myDone;
113 Standard_Integer myNbExt;
114 Standard_Real mySqDist[4];
115 Extrema_POnSurf myPoint[4];
126 #endif // _Extrema_ExtPElS_HeaderFile