Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-09-29 09:18:41

0001 // Created on: 1996-01-22
0002 // Created by: Laurent PAINNOT
0003 // Copyright (c) 1996-1999 Matra Datavision
0004 // Copyright (c) 1999-2014 OPEN CASCADE SAS
0005 //
0006 // This file is part of Open CASCADE Technology software library.
0007 //
0008 // This library is free software; you can redistribute it and/or modify it under
0009 // the terms of the GNU Lesser General Public License version 2.1 as published
0010 // by the Free Software Foundation, with special exception defined in the file
0011 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
0012 // distribution for complete text of the license and disclaimer of any warranty.
0013 //
0014 // Alternatively, this file may be used under the terms of Open CASCADE
0015 // commercial license or contractual agreement.
0016 
0017 #ifndef _Extrema_GenLocateExtSS_HeaderFile
0018 #define _Extrema_GenLocateExtSS_HeaderFile
0019 
0020 #include <Standard.hxx>
0021 #include <Standard_DefineAlloc.hxx>
0022 
0023 #include <Extrema_POnSurf.hxx>
0024 class Adaptor3d_Surface;
0025 
0026 //! With two close points it calculates the distance
0027 //! between two surfaces.
0028 //! This distance can be a minimum or a maximum.
0029 class Extrema_GenLocateExtSS
0030 {
0031 public:
0032   DEFINE_STANDARD_ALLOC
0033 
0034   Standard_EXPORT Extrema_GenLocateExtSS();
0035 
0036   //! Calculates the distance with two close points.
0037   //! The close points are defined by the parameter values
0038   //! (U1,V1) for S1 and (U2,V2) for S2.
0039   //! The function F(u1,v1,u2,v2)=distance(S1(u1,v1),S2(u2,v2))
0040   //! has an extremun when gradient(F)=0. The algorithm searches
0041   //! a zero near the close points.
0042   Standard_EXPORT Extrema_GenLocateExtSS(const Adaptor3d_Surface& S1,
0043                                          const Adaptor3d_Surface& S2,
0044                                          const double             U1,
0045                                          const double             V1,
0046                                          const double             U2,
0047                                          const double             V2,
0048                                          const double             Tol1,
0049                                          const double             Tol2);
0050 
0051   Standard_EXPORT void Perform(const Adaptor3d_Surface& S1,
0052                                const Adaptor3d_Surface& S2,
0053                                const double             U1,
0054                                const double             V1,
0055                                const double             U2,
0056                                const double             V2,
0057                                const double             Tol1,
0058                                const double             Tol2);
0059 
0060   //! Returns True if the distance is found.
0061   Standard_EXPORT bool IsDone() const;
0062 
0063   //! Returns the value of the extremum square distance.
0064   Standard_EXPORT double SquareDistance() const;
0065 
0066   //! Returns the point of the extremum distance on S1.
0067   Standard_EXPORT const Extrema_POnSurf& PointOnS1() const;
0068 
0069   //! Returns the point of the extremum distance on S2.
0070   Standard_EXPORT const Extrema_POnSurf& PointOnS2() const;
0071 
0072 private:
0073   bool            myDone;
0074   double          mySqDist;
0075   Extrema_POnSurf myPoint1;
0076   Extrema_POnSurf myPoint2;
0077 };
0078 
0079 #endif // _Extrema_GenLocateExtSS_HeaderFile