Back to home page

EIC code displayed by LXR

 
 

    


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