Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-07-30 09:13:27

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