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
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_GenLocateExtCS_HeaderFile
18 #define _Extrema_GenLocateExtCS_HeaderFile
19 
20 #include <Standard.hxx>
21 #include <Standard_DefineAlloc.hxx>
22 #include <Standard_Handle.hxx>
23 
24 #include <Standard_Boolean.hxx>
25 #include <Standard_Real.hxx>
26 #include <Extrema_POnCurv.hxx>
27 #include <Extrema_POnSurf.hxx>
28 class Adaptor3d_Curve;
29 class Adaptor3d_Surface;
30 
31 
32 //! With two close points it calculates the distance
33 //! between two surfaces.
34 //! This distance can be a minimum or a maximum.
35 class Extrema_GenLocateExtCS
36 {
37 public:
38 
39   DEFINE_STANDARD_ALLOC
40 
41 
42   Standard_EXPORT Extrema_GenLocateExtCS();
43 
44   //! Calculates the distance with two close points.
45   //! The close points are defined by the parameter values
46   //! T for C and (U,V) for S.
47   //! The function F(t,u,v)=distance(C(t),S(u,v))
48   //! has an extremun when gradient(F)=0. The algorithm searches
49   //! a zero near the close points.
50   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);
51 
52   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);
53 
54   //! Returns True if the distance is found.
55   Standard_EXPORT Standard_Boolean IsDone() const;
56 
57   //! Returns the value of the extremum square distance.
58   Standard_EXPORT Standard_Real SquareDistance() const;
59 
60   //! Returns the point of the extremum distance on C.
61   Standard_EXPORT const Extrema_POnCurv& PointOnCurve() const;
62 
63   //! Returns the point of the extremum distance on S.
64   Standard_EXPORT const Extrema_POnSurf& PointOnSurface() const;
65 
66 
67 
68 
69 protected:
70 
71 
72 
73 
74 
75 private:
76 
77 
78 
79   Standard_Boolean myDone;
80   Standard_Real mySqDist;
81   Extrema_POnCurv myPoint1;
82   Extrema_POnSurf myPoint2;
83 
84 
85 };
86 
87 
88 
89 
90 
91 
92 
93 #endif // _Extrema_GenLocateExtCS_HeaderFile
94