1 // Created on: 1991-02-26
2 // Created by: Isabelle GRIGNON
3 // Copyright (c) 1991-1999 Matra Datavision
4 // Copyright (c) 1999-2014 OPEN CASCADE SAS
6 // This file is part of Open CASCADE Technology software library.
8 // This library is free software; you can redistribute it and/or modify it under
9 // the terms of the GNU Lesser General Public License version 2.1 as published
10 // by the Free Software Foundation, with special exception defined in the file
11 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
12 // distribution for complete text of the license and disclaimer of any warranty.
14 // Alternatively, this file may be used under the terms of Open CASCADE
15 // commercial license or contractual agreement.
17 #ifndef _Extrema_EPCOfELPCOfLocateExtPC2d_HeaderFile
18 #define _Extrema_EPCOfELPCOfLocateExtPC2d_HeaderFile
20 #include <Standard.hxx>
21 #include <Standard_DefineAlloc.hxx>
22 #include <Standard_Handle.hxx>
24 #include <Standard_Boolean.hxx>
25 #include <Standard_Integer.hxx>
26 #include <Standard_Real.hxx>
27 #include <Extrema_PCFOfEPCOfELPCOfLocateExtPC2d.hxx>
28 class StdFail_NotDone;
29 class Standard_OutOfRange;
30 class Standard_TypeMismatch;
31 class Adaptor2d_Curve2d;
32 class Extrema_Curve2dTool;
33 class Extrema_POnCurv2d;
36 class Extrema_PCFOfEPCOfELPCOfLocateExtPC2d;
37 class Extrema_SeqPCOfPCFOfEPCOfELPCOfLocateExtPC2d;
41 class Extrema_EPCOfELPCOfLocateExtPC2d
48 Standard_EXPORT Extrema_EPCOfELPCOfLocateExtPC2d();
50 //! It calculates all the distances.
51 //! The function F(u)=distance(P,C(u)) has an extremum
52 //! when g(u)=dF/du=0. The algorithm searchs all the
53 //! zeros inside the definition range of the curve.
54 //! NbU is used to locate the close points to
56 //! Tol and TolU are used to decide to stop the
57 //! iterations according to the following condition:
58 //! if n is the number of iterations,
59 //! abs(Un-Un-1) < TolU and abs(F(Un)-F(Un-1)) < Tol.
60 Standard_EXPORT Extrema_EPCOfELPCOfLocateExtPC2d(const gp_Pnt2d& P, const Adaptor2d_Curve2d& C, const Standard_Integer NbU, const Standard_Real TolU, const Standard_Real TolF);
62 //! It calculates all the distances.
63 //! The function F(u)=distance(P,C(u)) has an extremum
64 //! when g(u)=dF/du=0. The algorithm searchs all the
65 //! zeros inside the definition range of the curve.
66 //! NbU is used to locate the close points to
68 //! Zeros are searched between umin and usup.
69 //! Tol and TolU are used to decide to stop the
70 //! iterations according to the following condition:
71 //! if n is the number of iterations,
72 //! abs(Un-Un-1) < TolU and abs(F(Un)-F(Un-1)) < Tol.
73 Standard_EXPORT Extrema_EPCOfELPCOfLocateExtPC2d(const gp_Pnt2d& P, const Adaptor2d_Curve2d& C, const Standard_Integer NbU, const Standard_Real Umin, const Standard_Real Usup, const Standard_Real TolU, const Standard_Real TolF);
75 //! sets the fields of the algorithm.
76 Standard_EXPORT void Initialize (const Adaptor2d_Curve2d& C, const Standard_Integer NbU, const Standard_Real TolU, const Standard_Real TolF);
78 //! sets the fields of the algorithm.
79 Standard_EXPORT void Initialize (const Adaptor2d_Curve2d& C, const Standard_Integer NbU, const Standard_Real Umin, const Standard_Real Usup, const Standard_Real TolU, const Standard_Real TolF);
81 //! sets the fields of the algorithm.
82 Standard_EXPORT void Initialize (const Adaptor2d_Curve2d& C);
84 //! sets the fields of the algorithm.
85 Standard_EXPORT void Initialize (const Standard_Integer NbU, const Standard_Real Umin, const Standard_Real Usup, const Standard_Real TolU, const Standard_Real TolF);
87 //! the algorithm is done with the point P.
88 //! An exception is raised if the fields have not
90 Standard_EXPORT void Perform (const gp_Pnt2d& P);
92 //! True if the distances are found.
93 Standard_EXPORT Standard_Boolean IsDone() const;
95 //! Returns the number of extremum distances.
96 Standard_EXPORT Standard_Integer NbExt() const;
98 //! Returns the value of the Nth extremum square distance.
99 Standard_EXPORT Standard_Real SquareDistance (const Standard_Integer N) const;
101 //! Returns True if the Nth extremum distance is a
103 Standard_EXPORT Standard_Boolean IsMin (const Standard_Integer N) const;
105 //! Returns the point of the Nth extremum distance.
106 Standard_EXPORT const Extrema_POnCurv2d& Point (const Standard_Integer N) const;
121 Standard_Boolean myDone;
122 Standard_Boolean myInit;
123 Standard_Integer mynbsample;
124 Standard_Real myumin;
125 Standard_Real myusup;
126 Standard_Real mytolu;
127 Standard_Real mytolF;
128 Extrema_PCFOfEPCOfELPCOfLocateExtPC2d myF;
139 #endif // _Extrema_EPCOfELPCOfLocateExtPC2d_HeaderFile