1 // Created on: 1992-07-22
2 // Created by: Laurent PAINNOT
3 // Copyright (c) 1992-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_ExtElCS_HeaderFile
18 #define _Extrema_ExtElCS_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 <TColStd_HArray1OfReal.hxx>
27 #include <Extrema_HArray1OfPOnCurv.hxx>
28 #include <Extrema_HArray1OfPOnSurf.hxx>
29 #include <Standard_Real.hxx>
30 class StdFail_InfiniteSolutions;
31 class StdFail_NotDone;
32 class Standard_OutOfRange;
41 class Extrema_POnCurv;
42 class Extrema_POnSurf;
45 //! It calculates all the distances between a curve and
47 //! These distances can be maximum or minimum.
55 Standard_EXPORT Extrema_ExtElCS();
57 //! Calculates the distances between a line and a
58 //! plane. The line can be on the plane or on a parallel
60 Standard_EXPORT Extrema_ExtElCS(const gp_Lin& C, const gp_Pln& S);
62 Standard_EXPORT void Perform (const gp_Lin& C, const gp_Pln& S);
64 //! Calculates the distances between a line and a
66 Standard_EXPORT Extrema_ExtElCS(const gp_Lin& C, const gp_Cylinder& S);
68 Standard_EXPORT void Perform (const gp_Lin& C, const gp_Cylinder& S);
70 //! Calculates the distances between a line and a cone.
71 Standard_EXPORT Extrema_ExtElCS(const gp_Lin& C, const gp_Cone& S);
73 Standard_EXPORT void Perform (const gp_Lin& C, const gp_Cone& S);
75 //! Calculates the distances between a line and a
77 Standard_EXPORT Extrema_ExtElCS(const gp_Lin& C, const gp_Sphere& S);
79 Standard_EXPORT void Perform (const gp_Lin& C, const gp_Sphere& S);
81 //! Calculates the distances between a line and a
83 Standard_EXPORT Extrema_ExtElCS(const gp_Lin& C, const gp_Torus& S);
85 Standard_EXPORT void Perform (const gp_Lin& C, const gp_Torus& S);
87 //! Calculates the distances between a circle and a
89 Standard_EXPORT Extrema_ExtElCS(const gp_Circ& C, const gp_Pln& S);
91 Standard_EXPORT void Perform (const gp_Circ& C, const gp_Pln& S);
93 //! Calculates the distances between a circle and a
95 Standard_EXPORT Extrema_ExtElCS(const gp_Circ& C, const gp_Cylinder& S);
97 Standard_EXPORT void Perform (const gp_Circ& C, const gp_Cylinder& S);
99 //! Calculates the distances between a circle and a
101 Standard_EXPORT Extrema_ExtElCS(const gp_Circ& C, const gp_Cone& S);
103 Standard_EXPORT void Perform (const gp_Circ& C, const gp_Cone& S);
105 //! Calculates the distances between a circle and a
107 Standard_EXPORT Extrema_ExtElCS(const gp_Circ& C, const gp_Sphere& S);
109 Standard_EXPORT void Perform (const gp_Circ& C, const gp_Sphere& S);
111 //! Calculates the distances between a circle and a
113 Standard_EXPORT Extrema_ExtElCS(const gp_Circ& C, const gp_Torus& S);
115 Standard_EXPORT void Perform (const gp_Circ& C, const gp_Torus& S);
117 //! Calculates the distances between a hyperbola and a
119 Standard_EXPORT Extrema_ExtElCS(const gp_Hypr& C, const gp_Pln& S);
121 Standard_EXPORT void Perform (const gp_Hypr& C, const gp_Pln& S);
123 //! Returns True if the distances are found.
124 Standard_EXPORT Standard_Boolean IsDone() const;
126 //! Returns True if the curve is on a parallel surface.
127 Standard_EXPORT Standard_Boolean IsParallel() const;
129 //! Returns the number of extremum distances.
130 Standard_EXPORT Standard_Integer NbExt() const;
132 //! Returns the value of the Nth extremum square distance.
133 Standard_EXPORT Standard_Real SquareDistance (const Standard_Integer N = 1) const;
135 //! Returns the points of the Nth extremum distance.
136 //! P1 is on the curve, P2 on the surface.
137 Standard_EXPORT void Points (const Standard_Integer N, Extrema_POnCurv& P1, Extrema_POnSurf& P2) const;
152 Standard_Boolean myDone;
153 Standard_Integer myNbExt;
154 Standard_Boolean myIsPar;
155 Handle(TColStd_HArray1OfReal) mySqDist;
156 Handle(Extrema_HArray1OfPOnCurv) myPoint1;
157 Handle(Extrema_HArray1OfPOnSurf) myPoint2;
168 #endif // _Extrema_ExtElCS_HeaderFile