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>
39 class Extrema_POnCurv;
40 class Extrema_POnSurf;
43 //! It calculates all the distances between a curve and
45 //! These distances can be maximum or minimum.
53 Standard_EXPORT Extrema_ExtElCS();
55 //! Calculates the distances between a line and a
56 //! plane. The line can be on the plane or on a parallel
58 Standard_EXPORT Extrema_ExtElCS(const gp_Lin& C, const gp_Pln& S);
60 Standard_EXPORT void Perform (const gp_Lin& C, const gp_Pln& S);
62 //! Calculates the distances between a line and a
64 Standard_EXPORT Extrema_ExtElCS(const gp_Lin& C, const gp_Cylinder& S);
66 Standard_EXPORT void Perform (const gp_Lin& C, const gp_Cylinder& S);
68 //! Calculates the distances between a line and a cone.
69 Standard_EXPORT Extrema_ExtElCS(const gp_Lin& C, const gp_Cone& S);
71 Standard_EXPORT void Perform (const gp_Lin& C, const gp_Cone& S);
73 //! Calculates the distances between a line and a
75 Standard_EXPORT Extrema_ExtElCS(const gp_Lin& C, const gp_Sphere& S);
77 Standard_EXPORT void Perform (const gp_Lin& C, const gp_Sphere& S);
79 //! Calculates the distances between a line and a
81 Standard_EXPORT Extrema_ExtElCS(const gp_Lin& C, const gp_Torus& S);
83 Standard_EXPORT void Perform (const gp_Lin& C, const gp_Torus& S);
85 //! Calculates the distances between a circle and a
87 Standard_EXPORT Extrema_ExtElCS(const gp_Circ& C, const gp_Pln& S);
89 Standard_EXPORT void Perform (const gp_Circ& C, const gp_Pln& S);
91 //! Calculates the distances between a circle and a
93 Standard_EXPORT Extrema_ExtElCS(const gp_Circ& C, const gp_Cylinder& S);
95 Standard_EXPORT void Perform (const gp_Circ& C, const gp_Cylinder& S);
97 //! Calculates the distances between a circle and a
99 Standard_EXPORT Extrema_ExtElCS(const gp_Circ& C, const gp_Cone& S);
101 Standard_EXPORT void Perform (const gp_Circ& C, const gp_Cone& S);
103 //! Calculates the distances between a circle and a
105 Standard_EXPORT Extrema_ExtElCS(const gp_Circ& C, const gp_Sphere& S);
107 Standard_EXPORT void Perform (const gp_Circ& C, const gp_Sphere& S);
109 //! Calculates the distances between a circle and a
111 Standard_EXPORT Extrema_ExtElCS(const gp_Circ& C, const gp_Torus& S);
113 Standard_EXPORT void Perform (const gp_Circ& C, const gp_Torus& S);
115 //! Calculates the distances between a hyperbola and a
117 Standard_EXPORT Extrema_ExtElCS(const gp_Hypr& C, const gp_Pln& S);
119 Standard_EXPORT void Perform (const gp_Hypr& C, const gp_Pln& S);
121 //! Returns True if the distances are found.
122 Standard_EXPORT Standard_Boolean IsDone() const;
124 //! Returns True if the curve is on a parallel surface.
125 Standard_EXPORT Standard_Boolean IsParallel() const;
127 //! Returns the number of extremum distances.
128 Standard_EXPORT Standard_Integer NbExt() const;
130 //! Returns the value of the Nth extremum square distance.
131 Standard_EXPORT Standard_Real SquareDistance (const Standard_Integer N = 1) const;
133 //! Returns the points of the Nth extremum distance.
134 //! P1 is on the curve, P2 on the surface.
135 Standard_EXPORT void Points (const Standard_Integer N, Extrema_POnCurv& P1, Extrema_POnSurf& P2) const;
150 Standard_Boolean myDone;
151 Standard_Integer myNbExt;
152 Standard_Boolean myIsPar;
153 Handle(TColStd_HArray1OfReal) mySqDist;
154 Handle(Extrema_HArray1OfPOnCurv) myPoint1;
155 Handle(Extrema_HArray1OfPOnSurf) myPoint2;
166 #endif // _Extrema_ExtElCS_HeaderFile