0027961: Visualization - remove unused and no more working OpenGl_AVIWriter
[occt.git] / src / Extrema / Extrema_LocateExtPC2d.hxx
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
5 //
6 // This file is part of Open CASCADE Technology software library.
7 //
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.
13 //
14 // Alternatively, this file may be used under the terms of Open CASCADE
15 // commercial license or contractual agreement.
16
17 #ifndef _Extrema_LocateExtPC2d_HeaderFile
18 #define _Extrema_LocateExtPC2d_HeaderFile
19
20 #include <Standard.hxx>
21 #include <Standard_DefineAlloc.hxx>
22 #include <Standard_Handle.hxx>
23
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;
38 class gp_Pnt2d;
39 class gp_Vec2d;
40 class Extrema_POnCurv2d;
41 class Extrema_ELPCOfLocateExtPC2d;
42 class Extrema_EPCOfELPCOfLocateExtPC2d;
43 class Extrema_LocEPCOfLocateExtPC2d;
44 class Extrema_PCLocFOfLocEPCOfLocateExtPC2d;
45
46
47
48 class Extrema_LocateExtPC2d 
49 {
50 public:
51
52   DEFINE_STANDARD_ALLOC
53
54   
55   Standard_EXPORT Extrema_LocateExtPC2d();
56   
57   //! Calculates the distance with a close point.
58   //! The close point is defined by the parameter value
59   //! U0.
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);
67   
68   //! Calculates the distance with a close point.
69   //! The close point is defined by the parameter value
70   //! U0.
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);
79   
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);
82   
83   Standard_EXPORT void Perform (const gp_Pnt2d& P, const Standard_Real U0);
84   
85   //! Returns True if the distance is found.
86   Standard_EXPORT Standard_Boolean IsDone() const;
87   
88   //! Returns the value of the extremum square distance.
89   Standard_EXPORT Standard_Real SquareDistance() const;
90   
91   //! Returns True if the extremum distance is a minimum.
92   Standard_EXPORT Standard_Boolean IsMin() const;
93   
94   //! Returns the point of the extremum distance.
95   Standard_EXPORT const Extrema_POnCurv2d& Point() const;
96
97
98
99
100 protected:
101
102
103
104
105
106 private:
107
108
109
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;
117   Standard_Real mytol;
118   Extrema_LocEPCOfLocateExtPC2d myLocExtPC;
119   Extrema_ELPCOfLocateExtPC2d myExtremPC;
120   GeomAbs_CurveType type;
121   Standard_Integer numberext;
122
123
124 };
125
126
127
128
129
130
131
132 #endif // _Extrema_LocateExtPC2d_HeaderFile