Back to home page

EIC code displayed by LXR

 
 

    


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

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_LocEPCOfLocateExtPC2d_HeaderFile
0018 #define _Extrema_LocEPCOfLocateExtPC2d_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_PCLocFOfLocEPCOfLocateExtPC2d.hxx>
0026 class Standard_DomainError;
0027 class Standard_TypeMismatch;
0028 class StdFail_NotDone;
0029 class Adaptor2d_Curve2d;
0030 class Extrema_Curve2dTool;
0031 class Extrema_POnCurv2d;
0032 class gp_Pnt2d;
0033 class gp_Vec2d;
0034 class Extrema_PCLocFOfLocEPCOfLocateExtPC2d;
0035 
0036 class Extrema_LocEPCOfLocateExtPC2d 
0037 {
0038 public:
0039 
0040   DEFINE_STANDARD_ALLOC
0041 
0042   
0043   Standard_EXPORT Extrema_LocEPCOfLocateExtPC2d();
0044   
0045   //! Calculates the distance with a close point.
0046   //! The close point is defined by the parameter value
0047   //! U0.
0048   //! The function F(u)=distance(P,C(u)) has an extremum
0049   //! when g(u)=dF/du=0. The algorithm searches a zero
0050   //! near the close point.
0051   //! TolU is used to decide to stop the iterations.
0052   //! At the nth iteration, the criteria is:
0053   //! abs(Un - Un-1) < TolU.
0054   Standard_EXPORT Extrema_LocEPCOfLocateExtPC2d(const gp_Pnt2d& P, const Adaptor2d_Curve2d& C, const Standard_Real U0, const Standard_Real TolU);
0055   
0056   //! Calculates the distance with a close point.
0057   //! The close point is defined by the parameter value
0058   //! U0.
0059   //! The function F(u)=distance(P,C(u)) has an extremum
0060   //! when g(u)=dF/du=0. The algorithm searches a zero
0061   //! near the close point.
0062   //! Zeros are searched between Umin et Usup.
0063   //! TolU is used to decide to stop the iterations.
0064   //! At the nth iteration, the criteria is:
0065   //! abs(Un - Un-1) < TolU.
0066   Standard_EXPORT Extrema_LocEPCOfLocateExtPC2d(const gp_Pnt2d& P, const Adaptor2d_Curve2d& C, const Standard_Real U0, const Standard_Real Umin, const Standard_Real Usup, const Standard_Real TolU);
0067   
0068   //! sets the fields of the algorithm.
0069   Standard_EXPORT void Initialize (const Adaptor2d_Curve2d& C, const Standard_Real Umin, const Standard_Real Usup, const Standard_Real TolU);
0070   
0071   //! the algorithm is done with the point P.
0072   //! An exception is raised if the fields have not
0073   //! been initialized.
0074   Standard_EXPORT void Perform (const gp_Pnt2d& P, const Standard_Real U0);
0075   
0076   //! Returns True if the distance is found.
0077   Standard_EXPORT Standard_Boolean IsDone() const;
0078   
0079   //! Returns the value of the extremum square distance.
0080   Standard_EXPORT Standard_Real SquareDistance() const;
0081   
0082   //! Returns True if the extremum distance is a minimum.
0083   Standard_EXPORT Standard_Boolean IsMin() const;
0084   
0085   //! Returns the point of the extremum distance.
0086   Standard_EXPORT const Extrema_POnCurv2d& Point() const;
0087 
0088 
0089 
0090 
0091 protected:
0092 
0093 
0094 
0095 
0096 
0097 private:
0098 
0099 
0100 
0101   Standard_Boolean myDone;
0102   Standard_Real mytolU;
0103   Standard_Real myumin;
0104   Standard_Real myusup;
0105   Extrema_PCLocFOfLocEPCOfLocateExtPC2d myF;
0106 
0107 
0108 };
0109 
0110 
0111 
0112 
0113 
0114 
0115 
0116 #endif // _Extrema_LocEPCOfLocateExtPC2d_HeaderFile