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_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 
0043 
0044 class Extrema_LocateExtPC2d 
0045 {
0046 public:
0047 
0048   DEFINE_STANDARD_ALLOC
0049 
0050   
0051   Standard_EXPORT Extrema_LocateExtPC2d();
0052   
0053   //! Calculates the distance with a close point.
0054   //! The close point is defined by the parameter value
0055   //! U0.
0056   //! The function F(u)=distance(P,C(u)) has an extremum
0057   //! when g(u)=dF/du=0. The algorithm searches a zero
0058   //! near the close point.
0059   //! TolF is used to decide to stop the iterations.
0060   //! At the nth iteration, the criteria is:
0061   //! abs(Un - Un-1) < TolF.
0062   Standard_EXPORT Extrema_LocateExtPC2d(const gp_Pnt2d& P, const Adaptor2d_Curve2d& C, const Standard_Real U0, const Standard_Real TolF);
0063   
0064   //! Calculates the distance with a close point.
0065   //! The close point is defined by the parameter value
0066   //! U0.
0067   //! The function F(u)=distance(P,C(u)) has an extremum
0068   //! when g(u)=dF/du=0. The algorithm searches a zero
0069   //! near the close point.
0070   //! Zeros are searched between Umin et Usup.
0071   //! TolF is used to decide to stop the iterations.
0072   //! At the nth iteration, the criteria is:
0073   //! abs(Un - Un-1) < TolF.
0074   Standard_EXPORT Extrema_LocateExtPC2d(const gp_Pnt2d& P, const Adaptor2d_Curve2d& C, const Standard_Real U0, const Standard_Real Umin, const Standard_Real Usup, const Standard_Real TolF);
0075   
0076   //! sets the fields of the algorithm.
0077   Standard_EXPORT void Initialize (const Adaptor2d_Curve2d& C, const Standard_Real Umin, const Standard_Real Usup, const Standard_Real TolF);
0078   
0079   Standard_EXPORT void Perform (const gp_Pnt2d& P, const Standard_Real U0);
0080   
0081   //! Returns True if the distance is found.
0082   Standard_EXPORT Standard_Boolean IsDone() const;
0083   
0084   //! Returns the value of the extremum square distance.
0085   Standard_EXPORT Standard_Real SquareDistance() const;
0086   
0087   //! Returns True if the extremum distance is a minimum.
0088   Standard_EXPORT Standard_Boolean IsMin() const;
0089   
0090   //! Returns the point of the extremum distance.
0091   Standard_EXPORT const Extrema_POnCurv2d& Point() const;
0092 
0093 
0094 
0095 
0096 protected:
0097 
0098 
0099 
0100 
0101 
0102 private:
0103 
0104 
0105 
0106   Extrema_POnCurv2d mypp;
0107   Standard_Address myC;
0108   Standard_Real mydist2;
0109   Standard_Boolean myismin;
0110   Standard_Boolean myDone;
0111   Standard_Real myumin;
0112   Standard_Real myusup;
0113   Standard_Real mytol;
0114   Extrema_LocEPCOfLocateExtPC2d myLocExtPC;
0115   Extrema_ELPCOfLocateExtPC2d myExtremPC;
0116   GeomAbs_CurveType type;
0117   Standard_Integer numberext;
0118 
0119 
0120 };
0121 
0122 
0123 
0124 
0125 
0126 
0127 
0128 #endif // _Extrema_LocateExtPC2d_HeaderFile