1 // Created on: 1996-01-25
2 // Created by: Laurent PAINNOT
3 // Copyright (c) 1996-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_GenLocateExtCS_HeaderFile
18 #define _Extrema_GenLocateExtCS_HeaderFile
20 #include <Standard.hxx>
21 #include <Standard_DefineAlloc.hxx>
22 #include <Standard_Handle.hxx>
24 #include <Standard_Boolean.hxx>
25 #include <Standard_Real.hxx>
26 #include <Extrema_POnCurv.hxx>
27 #include <Extrema_POnSurf.hxx>
28 class Standard_DomainError;
29 class StdFail_NotDone;
30 class Adaptor3d_Curve;
31 class Adaptor3d_Surface;
32 class Extrema_POnCurv;
33 class Extrema_POnSurf;
36 //! With two close points it calculates the distance
37 //! between two surfaces.
38 //! This distance can be a minimum or a maximum.
39 class Extrema_GenLocateExtCS
46 Standard_EXPORT Extrema_GenLocateExtCS();
48 //! Calculates the distance with two close points.
49 //! The close points are defined by the parameter values
50 //! T for C and (U,V) for S.
51 //! The function F(t,u,v)=distance(C(t),S(u,v))
52 //! has an extremun when gradient(F)=0. The algorithm searchs
53 //! a zero near the close points.
54 Standard_EXPORT Extrema_GenLocateExtCS(const Adaptor3d_Curve& C, const Adaptor3d_Surface& S, const Standard_Real T, const Standard_Real U, const Standard_Real V, const Standard_Real Tol1, const Standard_Real Tol2);
56 Standard_EXPORT void Perform (const Adaptor3d_Curve& C, const Adaptor3d_Surface& S, const Standard_Real T, const Standard_Real U, const Standard_Real V, const Standard_Real Tol1, const Standard_Real Tol2);
58 //! Returns True if the distance is found.
59 Standard_EXPORT Standard_Boolean IsDone() const;
61 //! Returns the value of the extremum square distance.
62 Standard_EXPORT Standard_Real SquareDistance() const;
64 //! Returns the point of the extremum distance on C.
65 Standard_EXPORT const Extrema_POnCurv& PointOnCurve() const;
67 //! Returns the point of the extremum distance on S.
68 Standard_EXPORT const Extrema_POnSurf& PointOnSurface() const;
83 Standard_Boolean myDone;
84 Standard_Real mySqDist;
85 Extrema_POnCurv myPoint1;
86 Extrema_POnSurf myPoint2;
97 #endif // _Extrema_GenLocateExtCS_HeaderFile