Back to home page

EIC code displayed by LXR

 
 

    


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

0001 // Created on: 1991-02-26
0002 // Created by: Isabelle GRIGNON
0003 // Copyright (c) 1991-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_EPCOfELPCOfLocateExtPC2d_HeaderFile
0018 #define _Extrema_EPCOfELPCOfLocateExtPC2d_HeaderFile
0019 
0020 #include <Standard.hxx>
0021 #include <Standard_DefineAlloc.hxx>
0022 #include <Standard_Handle.hxx>
0023 
0024 #include <Standard_Boolean.hxx>
0025 #include <Extrema_PCFOfEPCOfELPCOfLocateExtPC2d.hxx>
0026 class StdFail_NotDone;
0027 class Standard_OutOfRange;
0028 class Standard_TypeMismatch;
0029 class Adaptor2d_Curve2d;
0030 class Extrema_Curve2dTool;
0031 class Extrema_POnCurv2d;
0032 class gp_Pnt2d;
0033 class gp_Vec2d;
0034 class Extrema_PCFOfEPCOfELPCOfLocateExtPC2d;
0035 
0036 class Extrema_EPCOfELPCOfLocateExtPC2d 
0037 {
0038 public:
0039 
0040   DEFINE_STANDARD_ALLOC
0041 
0042   
0043   Standard_EXPORT Extrema_EPCOfELPCOfLocateExtPC2d();
0044   
0045   //! It calculates all the distances.
0046   //! The function F(u)=distance(P,C(u)) has an extremum
0047   //! when g(u)=dF/du=0. The algorithm searches all the
0048   //! zeros inside the definition range of the curve.
0049   //! NbU is used to locate the close points to
0050   //! find the zeros.
0051   //! Tol and TolU are used to decide to stop the
0052   //! iterations according to the following condition:
0053   //! if n is the number of iterations,
0054   //! abs(Un-Un-1) < TolU and abs(F(Un)-F(Un-1)) < Tol.
0055   Standard_EXPORT Extrema_EPCOfELPCOfLocateExtPC2d(const gp_Pnt2d& P, const Adaptor2d_Curve2d& C, const Standard_Integer NbU, const Standard_Real TolU, const Standard_Real TolF);
0056   
0057   //! It calculates all the distances.
0058   //! The function F(u)=distance(P,C(u)) has an extremum
0059   //! when g(u)=dF/du=0. The algorithm searches all the
0060   //! zeros inside the definition range of the curve.
0061   //! NbU is used to locate the close points to
0062   //! find the zeros.
0063   //! Zeros are searched between umin and usup.
0064   //! Tol and TolU are used to decide to stop the
0065   //! iterations according to the following condition:
0066   //! if n is the number of iterations,
0067   //! abs(Un-Un-1) < TolU and abs(F(Un)-F(Un-1)) < Tol.
0068   Standard_EXPORT Extrema_EPCOfELPCOfLocateExtPC2d(const gp_Pnt2d& P, const Adaptor2d_Curve2d& C, const Standard_Integer NbU, const Standard_Real Umin, const Standard_Real Usup, const Standard_Real TolU, const Standard_Real TolF);
0069   
0070   //! sets the fields of the algorithm.
0071   Standard_EXPORT void Initialize (const Adaptor2d_Curve2d& C, const Standard_Integer NbU, const Standard_Real TolU, const Standard_Real TolF);
0072   
0073   //! sets the fields of the algorithm.
0074   Standard_EXPORT void Initialize (const Adaptor2d_Curve2d& C, const Standard_Integer NbU, const Standard_Real Umin, const Standard_Real Usup, const Standard_Real TolU, const Standard_Real TolF);
0075   
0076   //! sets the fields of the algorithm.
0077   Standard_EXPORT void Initialize (const Adaptor2d_Curve2d& C);
0078   
0079   //! sets the fields of the algorithm.
0080   Standard_EXPORT void Initialize (const Standard_Integer NbU, const Standard_Real Umin, const Standard_Real Usup, const Standard_Real TolU, const Standard_Real TolF);
0081   
0082   //! the algorithm is done with the point P.
0083   //! An exception is raised if the fields have not
0084   //! been initialized.
0085   Standard_EXPORT void Perform (const gp_Pnt2d& P);
0086   
0087   //! True if the distances are found.
0088   Standard_EXPORT Standard_Boolean IsDone() const;
0089   
0090   //! Returns the number of extremum distances.
0091   Standard_EXPORT Standard_Integer NbExt() const;
0092   
0093   //! Returns the value of the Nth extremum square distance.
0094   Standard_EXPORT Standard_Real SquareDistance (const Standard_Integer N) const;
0095   
0096   //! Returns True if the Nth extremum distance is a
0097   //! minimum.
0098   Standard_EXPORT Standard_Boolean IsMin (const Standard_Integer N) const;
0099   
0100   //! Returns the point of the Nth extremum distance.
0101   Standard_EXPORT const Extrema_POnCurv2d& Point (const Standard_Integer N) const;
0102 
0103 
0104 
0105 
0106 protected:
0107 
0108 
0109 
0110 
0111 
0112 private:
0113 
0114 
0115 
0116   Standard_Boolean myDone;
0117   Standard_Boolean myInit;
0118   Standard_Integer mynbsample;
0119   Standard_Real myumin;
0120   Standard_Real myusup;
0121   Standard_Real mytolu;
0122   Standard_Real mytolF;
0123   Extrema_PCFOfEPCOfELPCOfLocateExtPC2d myF;
0124 
0125 
0126 };
0127 
0128 
0129 
0130 
0131 
0132 
0133 
0134 #endif // _Extrema_EPCOfELPCOfLocateExtPC2d_HeaderFile