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