42cf5bc1 |
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 |
5 | // |
6 | // This file is part of Open CASCADE Technology software library. |
7 | // |
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. |
13 | // |
14 | // Alternatively, this file may be used under the terms of Open CASCADE |
15 | // commercial license or contractual agreement. |
16 | |
17 | #ifndef _Extrema_ExtPElS_HeaderFile |
18 | #define _Extrema_ExtPElS_HeaderFile |
19 | |
20 | #include <Standard.hxx> |
21 | #include <Standard_DefineAlloc.hxx> |
42cf5bc1 |
22 | |
42cf5bc1 |
23 | #include <Standard_Integer.hxx> |
42cf5bc1 |
24 | #include <Extrema_POnSurf.hxx> |
42cf5bc1 |
25 | class gp_Pnt; |
26 | class gp_Cylinder; |
27 | class gp_Pln; |
28 | class gp_Cone; |
29 | class gp_Torus; |
30 | class gp_Sphere; |
42cf5bc1 |
31 | |
32 | |
33 | //! It calculates all the extremum distances |
34 | //! between a point and a surface. |
35 | //! These distances can be minimum or maximum. |
36 | class Extrema_ExtPElS |
37 | { |
38 | public: |
39 | |
40 | DEFINE_STANDARD_ALLOC |
41 | |
42 | |
43 | Standard_EXPORT Extrema_ExtPElS(); |
44 | |
45 | //! It calculates all the distances between a point |
46 | //! and a cylinder from gp. |
47 | //! Tol is used to test if the point is on the axis. |
48 | Standard_EXPORT Extrema_ExtPElS(const gp_Pnt& P, const gp_Cylinder& S, const Standard_Real Tol); |
49 | |
50 | Standard_EXPORT void Perform (const gp_Pnt& P, const gp_Cylinder& S, const Standard_Real Tol); |
51 | |
52 | //! It calculates all the distances between a point |
53 | //! and a plane from gp. |
54 | //! Tol is used to test if the point is on the plane. |
55 | Standard_EXPORT Extrema_ExtPElS(const gp_Pnt& P, const gp_Pln& S, const Standard_Real Tol); |
56 | |
57 | Standard_EXPORT void Perform (const gp_Pnt& P, const gp_Pln& S, const Standard_Real Tol); |
58 | |
59 | //! It calculates all the distances between a point |
60 | //! and a cone from gp. |
61 | //! Tol is used to test if the point is at the apex or |
62 | //! on the axis. |
63 | Standard_EXPORT Extrema_ExtPElS(const gp_Pnt& P, const gp_Cone& S, const Standard_Real Tol); |
64 | |
65 | Standard_EXPORT void Perform (const gp_Pnt& P, const gp_Cone& S, const Standard_Real Tol); |
66 | |
67 | //! It calculates all the distances between a point |
68 | //! and a torus from gp. |
69 | //! Tol is used to test if the point is on the axis. |
70 | Standard_EXPORT Extrema_ExtPElS(const gp_Pnt& P, const gp_Torus& S, const Standard_Real Tol); |
71 | |
72 | Standard_EXPORT void Perform (const gp_Pnt& P, const gp_Torus& S, const Standard_Real Tol); |
73 | |
74 | //! It calculates all the distances between a point |
75 | //! and a sphere from gp. |
76 | //! Tol is used to test if the point is at the center. |
77 | Standard_EXPORT Extrema_ExtPElS(const gp_Pnt& P, const gp_Sphere& S, const Standard_Real Tol); |
78 | |
79 | Standard_EXPORT void Perform (const gp_Pnt& P, const gp_Sphere& S, const Standard_Real Tol); |
80 | |
81 | //! Returns True if the distances are found. |
82 | Standard_EXPORT Standard_Boolean IsDone() const; |
83 | |
84 | //! Returns the number of extremum distances. |
85 | Standard_EXPORT Standard_Integer NbExt() const; |
86 | |
87 | //! Returns the value of the Nth resulting square distance. |
88 | Standard_EXPORT Standard_Real SquareDistance (const Standard_Integer N) const; |
89 | |
90 | //! Returns the point of the Nth resulting distance. |
91 | Standard_EXPORT const Extrema_POnSurf& Point (const Standard_Integer N) const; |
92 | |
93 | |
94 | |
95 | |
96 | protected: |
97 | |
98 | |
99 | |
100 | |
101 | |
102 | private: |
103 | |
104 | |
105 | |
106 | Standard_Boolean myDone; |
107 | Standard_Integer myNbExt; |
108 | Standard_Real mySqDist[4]; |
109 | Extrema_POnSurf myPoint[4]; |
110 | |
111 | |
112 | }; |
113 | |
114 | |
115 | |
116 | |
117 | |
118 | |
119 | |
120 | #endif // _Extrema_ExtPElS_HeaderFile |