Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-05-04 08:45:14

0001 // Created on: 1996-01-25
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_GenLocateExtCS_HeaderFile
0018 #define _Extrema_GenLocateExtCS_HeaderFile
0019 
0020 #include <Standard.hxx>
0021 #include <Standard_DefineAlloc.hxx>
0022 
0023 #include <Extrema_POnCurv.hxx>
0024 #include <Extrema_POnSurf.hxx>
0025 class Adaptor3d_Curve;
0026 class Adaptor3d_Surface;
0027 
0028 //! With two close points it calculates the distance
0029 //! between two surfaces.
0030 //! This distance can be a minimum or a maximum.
0031 class Extrema_GenLocateExtCS
0032 {
0033 public:
0034   DEFINE_STANDARD_ALLOC
0035 
0036   Standard_EXPORT Extrema_GenLocateExtCS();
0037 
0038   //! Calculates the distance with two close points.
0039   //! The close points are defined by the parameter values
0040   //! T for C and (U,V) for S.
0041   //! The function F(t,u,v)=distance(C(t),S(u,v))
0042   //! has an extremun when gradient(F)=0. The algorithm searches
0043   //! a zero near the close points.
0044   Standard_EXPORT Extrema_GenLocateExtCS(const Adaptor3d_Curve&   C,
0045                                          const Adaptor3d_Surface& S,
0046                                          const Standard_Real      T,
0047                                          const Standard_Real      U,
0048                                          const Standard_Real      V,
0049                                          const Standard_Real      Tol1,
0050                                          const Standard_Real      Tol2);
0051 
0052   Standard_EXPORT void Perform(const Adaptor3d_Curve&   C,
0053                                const Adaptor3d_Surface& S,
0054                                const Standard_Real      T,
0055                                const Standard_Real      U,
0056                                const Standard_Real      V,
0057                                const Standard_Real      Tol1,
0058                                const Standard_Real      Tol2);
0059 
0060   //! Returns True if the distance is found.
0061   Standard_EXPORT Standard_Boolean IsDone() const;
0062 
0063   //! Returns the value of the extremum square distance.
0064   Standard_EXPORT Standard_Real SquareDistance() const;
0065 
0066   //! Returns the point of the extremum distance on C.
0067   Standard_EXPORT const Extrema_POnCurv& PointOnCurve() const;
0068 
0069   //! Returns the point of the extremum distance on S.
0070   Standard_EXPORT const Extrema_POnSurf& PointOnSurface() const;
0071 
0072 protected:
0073 private:
0074   Standard_Boolean myDone;
0075   Standard_Real    mySqDist;
0076   Extrema_POnCurv  myPoint1;
0077   Extrema_POnSurf  myPoint2;
0078 };
0079 
0080 #endif // _Extrema_GenLocateExtCS_HeaderFile