Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:03:29

0001 // Created on: 1996-01-18
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_GenExtSS_HeaderFile
0018 #define _Extrema_GenExtSS_HeaderFile
0019 
0020 #include <Standard.hxx>
0021 #include <Standard_DefineAlloc.hxx>
0022 #include <Standard_Handle.hxx>
0023 
0024 #include <TColgp_HArray2OfPnt.hxx>
0025 #include <Extrema_FuncExtSS.hxx>
0026 
0027 class Adaptor3d_Surface;
0028 class Extrema_POnSurf;
0029 
0030 //! It calculates all the extremum distances
0031 //! between two surfaces.
0032 //! These distances can be minimum or maximum.
0033 class Extrema_GenExtSS 
0034 {
0035 public:
0036 
0037   DEFINE_STANDARD_ALLOC
0038 
0039   //! Empty constructor.
0040   Standard_EXPORT Extrema_GenExtSS();
0041 
0042   //! Destructor.
0043   Standard_EXPORT ~Extrema_GenExtSS();
0044 
0045   //! It calculates all the distances.
0046   //! The function F(u,v)=distance(S1(u1,v1),S2(u2,v2)) has an
0047   //! extremum when gradient(F)=0. The algorithm searches
0048   //! all the zeros inside the definition ranges of the
0049   //! surfaces.
0050   //! NbU and NbV are used to locate the close points
0051   //! to find the zeros.
0052   Standard_EXPORT Extrema_GenExtSS(const Adaptor3d_Surface& S1, const Adaptor3d_Surface& S2, const Standard_Integer NbU, const Standard_Integer NbV, const Standard_Real Tol1, const Standard_Real Tol2);
0053   
0054   //! It calculates all the distances.
0055   //! The function F(u,v)=distance(P,S(u,v)) has an
0056   //! extremum when gradient(F)=0. The algorithm searches
0057   //! all the zeros inside the definition ranges of the
0058   //! surface.
0059   //! NbU and NbV are used to locate the close points
0060   //! to find the zeros.
0061   Standard_EXPORT Extrema_GenExtSS(const Adaptor3d_Surface& S1, const Adaptor3d_Surface& S2, const Standard_Integer NbU, const Standard_Integer NbV, const Standard_Real U1min, const Standard_Real U1sup, const Standard_Real V1min, const Standard_Real V1sup, const Standard_Real U2min, const Standard_Real U2sup, const Standard_Real V2min, const Standard_Real V2sup, const Standard_Real Tol1, const Standard_Real Tol2);
0062   
0063   Standard_EXPORT void Initialize (const Adaptor3d_Surface& S2, const Standard_Integer NbU, const Standard_Integer NbV, const Standard_Real Tol2);
0064   
0065   Standard_EXPORT void Initialize (const Adaptor3d_Surface& S2, const Standard_Integer NbU, const Standard_Integer NbV, const Standard_Real U2min, const Standard_Real U2sup, const Standard_Real V2min, const Standard_Real V2sup, const Standard_Real Tol2);
0066   
0067   //! the algorithm is done with S1
0068   //! An exception is raised if the fields have not
0069   //! been initialized.
0070   Standard_EXPORT void Perform (const Adaptor3d_Surface& S1, const Standard_Real Tol1);
0071   
0072   //! the algorithm is done withS1
0073   //! An exception is raised if the fields have not
0074   //! been initialized.
0075   Standard_EXPORT void Perform (const Adaptor3d_Surface& S1, const Standard_Real U1min, const Standard_Real U1sup, const Standard_Real V1min, const Standard_Real V1sup, const Standard_Real Tol1);
0076   
0077   //! Returns True if the distances are found.
0078   Standard_EXPORT Standard_Boolean IsDone() const;
0079   
0080   //! Returns the number of extremum distances.
0081   Standard_EXPORT Standard_Integer NbExt() const;
0082   
0083   //! Returns the value of the Nth resulting square distance.
0084   Standard_EXPORT Standard_Real SquareDistance (const Standard_Integer N) const;
0085   
0086   //! Returns the point of the Nth resulting distance.
0087   Standard_EXPORT const Extrema_POnSurf& PointOnS1 (const Standard_Integer N) const;
0088   
0089   //! Returns the point of the Nth resulting distance.
0090   Standard_EXPORT const Extrema_POnSurf& PointOnS2 (const Standard_Integer N) const;
0091 
0092 private:
0093 
0094   // disallow copies
0095   Extrema_GenExtSS            (const Extrema_GenExtSS& ) Standard_DELETE;
0096   Extrema_GenExtSS& operator= (const Extrema_GenExtSS& ) Standard_DELETE;
0097 
0098 private:
0099 
0100   Standard_Boolean myDone;
0101   Standard_Boolean myInit;
0102   Standard_Real myu1min;
0103   Standard_Real myu1sup;
0104   Standard_Real myv1min;
0105   Standard_Real myv1sup;
0106   Standard_Real myu2min;
0107   Standard_Real myu2sup;
0108   Standard_Real myv2min;
0109   Standard_Real myv2sup;
0110   Standard_Integer myusample;
0111   Standard_Integer myvsample;
0112   Handle(TColgp_HArray2OfPnt) mypoints1;
0113   Handle(TColgp_HArray2OfPnt) mypoints2;
0114   Standard_Real mytol1;
0115   Standard_Real mytol2;
0116   Extrema_FuncExtSS myF;
0117   const Adaptor3d_Surface* myS2;
0118 
0119 };
0120 
0121 #endif // _Extrema_GenExtSS_HeaderFile