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