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_LocateExtPC2d_HeaderFile
18 #define _Extrema_LocateExtPC2d_HeaderFile
20 #include <Standard.hxx>
21 #include <Standard_DefineAlloc.hxx>
22 #include <Standard_Handle.hxx>
24 #include <Extrema_POnCurv2d.hxx>
25 #include <Standard_Address.hxx>
26 #include <Standard_Real.hxx>
27 #include <Standard_Boolean.hxx>
28 #include <Extrema_LocEPCOfLocateExtPC2d.hxx>
29 #include <Extrema_ELPCOfLocateExtPC2d.hxx>
30 #include <GeomAbs_CurveType.hxx>
31 #include <Standard_Integer.hxx>
32 #include <Extrema_SequenceOfPOnCurv2d.hxx>
33 class Standard_DomainError;
34 class StdFail_NotDone;
35 class Adaptor2d_Curve2d;
36 class Extrema_Curve2dTool;
37 class Extrema_ExtPElC2d;
40 class Extrema_POnCurv2d;
41 class Extrema_ELPCOfLocateExtPC2d;
42 class Extrema_EPCOfELPCOfLocateExtPC2d;
43 class Extrema_LocEPCOfLocateExtPC2d;
44 class Extrema_PCLocFOfLocEPCOfLocateExtPC2d;
48 class Extrema_LocateExtPC2d
55 Standard_EXPORT Extrema_LocateExtPC2d();
57 //! Calculates the distance with a close point.
58 //! The close point is defined by the parameter value
60 //! The function F(u)=distance(P,C(u)) has an extremum
61 //! when g(u)=dF/du=0. The algorithm searchs a zero
62 //! near the close point.
63 //! TolF is used to decide to stop the iterations.
64 //! At the nth iteration, the criteria is:
65 //! abs(Un - Un-1) < TolF.
66 Standard_EXPORT Extrema_LocateExtPC2d(const gp_Pnt2d& P, const Adaptor2d_Curve2d& C, const Standard_Real U0, const Standard_Real TolF);
68 //! Calculates the distance with a close point.
69 //! The close point is defined by the parameter value
71 //! The function F(u)=distance(P,C(u)) has an extremum
72 //! when g(u)=dF/du=0. The algorithm searchs a zero
73 //! near the close point.
74 //! Zeros are searched between Umin et Usup.
75 //! TolF is used to decide to stop the iterations.
76 //! At the nth iteration, the criteria is:
77 //! abs(Un - Un-1) < TolF.
78 Standard_EXPORT Extrema_LocateExtPC2d(const gp_Pnt2d& P, const Adaptor2d_Curve2d& C, const Standard_Real U0, const Standard_Real Umin, const Standard_Real Usup, const Standard_Real TolF);
80 //! sets the fields of the algorithm.
81 Standard_EXPORT void Initialize (const Adaptor2d_Curve2d& C, const Standard_Real Umin, const Standard_Real Usup, const Standard_Real TolF);
83 Standard_EXPORT void Perform (const gp_Pnt2d& P, const Standard_Real U0);
85 //! Returns True if the distance is found.
86 Standard_EXPORT Standard_Boolean IsDone() const;
88 //! Returns the value of the extremum square distance.
89 Standard_EXPORT Standard_Real SquareDistance() const;
91 //! Returns True if the extremum distance is a minimum.
92 Standard_EXPORT Standard_Boolean IsMin() const;
94 //! Returns the point of the extremum distance.
95 Standard_EXPORT const Extrema_POnCurv2d& Point() const;
110 Extrema_POnCurv2d mypp;
111 Standard_Address myC;
112 Standard_Real mydist2;
113 Standard_Boolean myismin;
114 Standard_Boolean myDone;
115 Standard_Real myumin;
116 Standard_Real myusup;
118 Extrema_LocEPCOfLocateExtPC2d myLocExtPC;
119 Extrema_ELPCOfLocateExtPC2d myExtremPC;
120 GeomAbs_CurveType type;
121 Standard_Integer numberext;
132 #endif // _Extrema_LocateExtPC2d_HeaderFile