Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:03:28

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_EPCOfExtPC_HeaderFile
0018 #define _Extrema_EPCOfExtPC_HeaderFile
0019 
0020 #include <Standard.hxx>
0021 #include <Standard_DefineAlloc.hxx>
0022 
0023 #include <Standard_Integer.hxx>
0024 #include <Extrema_PCFOfEPCOfExtPC.hxx>
0025 class StdFail_NotDone;
0026 class Standard_OutOfRange;
0027 class Standard_TypeMismatch;
0028 class Adaptor3d_Curve;
0029 class Extrema_CurveTool;
0030 class Extrema_POnCurv;
0031 class gp_Pnt;
0032 class gp_Vec;
0033 class Extrema_PCFOfEPCOfExtPC;
0034 
0035 class Extrema_EPCOfExtPC 
0036 {
0037 public:
0038 
0039   DEFINE_STANDARD_ALLOC
0040 
0041   
0042   Standard_EXPORT Extrema_EPCOfExtPC();
0043   
0044   //! It calculates all the distances.
0045   //! The function F(u)=distance(P,C(u)) has an extremum
0046   //! when g(u)=dF/du=0. The algorithm searches all the
0047   //! zeros inside the definition range of the curve.
0048   //! NbU is used to locate the close points to
0049   //! find the zeros.
0050   //! Tol and TolU are used to decide to stop the
0051   //! iterations according to the following condition:
0052   //! if n is the number of iterations,
0053   //! abs(Un-Un-1) < TolU and abs(F(Un)-F(Un-1)) < Tol.
0054   Standard_EXPORT Extrema_EPCOfExtPC(const gp_Pnt& P, const Adaptor3d_Curve& C, const Standard_Integer NbU, const Standard_Real TolU, const Standard_Real TolF);
0055   
0056   //! It calculates all the distances.
0057   //! The function F(u)=distance(P,C(u)) has an extremum
0058   //! when g(u)=dF/du=0. The algorithm searches all the
0059   //! zeros inside the definition range of the curve.
0060   //! NbU is used to locate the close points to
0061   //! find the zeros.
0062   //! Zeros are searched between umin and usup.
0063   //! Tol and TolU are used to decide to stop the
0064   //! iterations according to the following condition:
0065   //! if n is the number of iterations,
0066   //! abs(Un-Un-1) < TolU and abs(F(Un)-F(Un-1)) < Tol.
0067   Standard_EXPORT Extrema_EPCOfExtPC(const gp_Pnt& P, const Adaptor3d_Curve& C, const Standard_Integer NbU, const Standard_Real Umin, const Standard_Real Usup, const Standard_Real TolU, const Standard_Real TolF);
0068   
0069   //! sets the fields of the algorithm.
0070   Standard_EXPORT void Initialize (const Adaptor3d_Curve& C, const Standard_Integer NbU, const Standard_Real TolU, const Standard_Real TolF);
0071   
0072   //! sets the fields of the algorithm.
0073   Standard_EXPORT void Initialize (const Adaptor3d_Curve& C, const Standard_Integer NbU, const Standard_Real Umin, const Standard_Real Usup, const Standard_Real TolU, const Standard_Real TolF);
0074   
0075   //! sets the fields of the algorithm.
0076   Standard_EXPORT void Initialize (const Adaptor3d_Curve& C);
0077   
0078   //! sets the fields of the algorithm.
0079   Standard_EXPORT void Initialize (const Standard_Integer NbU, const Standard_Real Umin, const Standard_Real Usup, const Standard_Real TolU, const Standard_Real TolF);
0080   
0081   //! the algorithm is done with the point P.
0082   //! An exception is raised if the fields have not
0083   //! been initialized.
0084   Standard_EXPORT void Perform (const gp_Pnt& P);
0085   
0086   //! True if the distances are found.
0087   Standard_EXPORT Standard_Boolean IsDone() const;
0088   
0089   //! Returns the number of extremum distances.
0090   Standard_EXPORT Standard_Integer NbExt() const;
0091   
0092   //! Returns the value of the Nth extremum square distance.
0093   Standard_EXPORT Standard_Real SquareDistance (const Standard_Integer N) const;
0094   
0095   //! Returns True if the Nth extremum distance is a
0096   //! minimum.
0097   Standard_EXPORT Standard_Boolean IsMin (const Standard_Integer N) const;
0098   
0099   //! Returns the point of the Nth extremum distance.
0100   Standard_EXPORT const Extrema_POnCurv& Point (const Standard_Integer N) const;
0101 
0102 
0103 
0104 
0105 protected:
0106 
0107 
0108 
0109 
0110 
0111 private:
0112 
0113 
0114 
0115   Standard_Boolean myDone;
0116   Standard_Boolean myInit;
0117   Standard_Integer mynbsample;
0118   Standard_Real myumin;
0119   Standard_Real myusup;
0120   Standard_Real mytolu;
0121   Standard_Real mytolF;
0122   Extrema_PCFOfEPCOfExtPC myF;
0123 
0124 
0125 };
0126 
0127 
0128 
0129 
0130 
0131 
0132 
0133 #endif // _Extrema_EPCOfExtPC_HeaderFile