0026595: Lost some comments in OCCT-code after cdl elimination
[occt.git] / src / Extrema / Extrema_CCLocFOfLocECC2d.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_CCLocFOfLocECC2d_HeaderFile
18 #define _Extrema_CCLocFOfLocECC2d_HeaderFile
19
20 #include <Standard.hxx>
21 #include <Standard_DefineAlloc.hxx>
22 #include <Standard_Handle.hxx>
23
24 #include <Standard_Address.hxx>
25 #include <Standard_Real.hxx>
26 #include <gp_Pnt2d.hxx>
27 #include <gp_Vec2d.hxx>
28 #include <TColStd_SequenceOfReal.hxx>
29 #include <Extrema_SeqPOnCOfCCLocFOfLocECC2d.hxx>
30 #include <Standard_Integer.hxx>
31 #include <math_FunctionSetWithDerivatives.hxx>
32 #include <Standard_Boolean.hxx>
33 #include <math_Vector.hxx>
34 class Standard_OutOfRange;
35 class Adaptor2d_Curve2d;
36 class Extrema_Curve2dTool;
37 class Extrema_POnCurv2d;
38 class gp_Pnt2d;
39 class gp_Vec2d;
40 class Extrema_SeqPOnCOfCCLocFOfLocECC2d;
41 class Extrema_SequenceNodeOfSeqPOnCOfCCLocFOfLocECC2d;
42 class math_Matrix;
43
44
45
46 class Extrema_CCLocFOfLocECC2d  : public math_FunctionSetWithDerivatives
47 {
48 public:
49
50   DEFINE_STANDARD_ALLOC
51
52   
53   Standard_EXPORT Extrema_CCLocFOfLocECC2d(const Standard_Real thetol = 1.0e-10);
54   
55   Standard_EXPORT Extrema_CCLocFOfLocECC2d(const Adaptor2d_Curve2d& C1, const Adaptor2d_Curve2d& C2, const Standard_Real thetol = 1.0e-10);
56   
57   Standard_EXPORT void SetCurve (const Standard_Integer theRank, const Adaptor2d_Curve2d& C1);
58   
59     void SetTolerance (const Standard_Real theTol);
60   
61     virtual Standard_Integer NbVariables() const Standard_OVERRIDE;
62   
63     virtual Standard_Integer NbEquations() const Standard_OVERRIDE;
64   
65   //! Calculate Fi(U,V).
66   Standard_EXPORT virtual Standard_Boolean Value (const math_Vector& UV, math_Vector& F) Standard_OVERRIDE;
67   
68   //! Calculate Fi'(U,V).
69   Standard_EXPORT Standard_Boolean Derivatives (const math_Vector& UV, math_Matrix& DF);
70   
71   //! Calculate Fi(U,V) and Fi'(U,V).
72   Standard_EXPORT Standard_Boolean Values (const math_Vector& UV, math_Vector& F, math_Matrix& DF);
73   
74   //! Save the found extremum.
75   Standard_EXPORT virtual Standard_Integer GetStateNumber() Standard_OVERRIDE;
76   
77   //! Return the number of found extrema.
78     Standard_Integer NbExt() const;
79   
80   //! Return the value of the Nth distance.
81     Standard_Real SquareDistance (const Standard_Integer N) const;
82   
83   //! Return the points of the Nth extreme distance.
84   Standard_EXPORT void Points (const Standard_Integer N, Extrema_POnCurv2d& P1, Extrema_POnCurv2d& P2) const;
85   
86   //! Returns a pointer to the curve specified in the constructor
87   //! or in SetCurve() method.
88     Standard_Address CurvePtr (const Standard_Integer theRank) const;
89   
90   //! Returns a tolerance specified in the constructor
91   //! or in SetTolerance() method.
92     Standard_Real Tolerance() const;
93   
94   //! Determines of boundaries of subinterval for find of root.
95   Standard_EXPORT void SubIntervalInitialize (const math_Vector& theUfirst, const math_Vector& theUlast);
96   
97   //! Computes a Tol value. If 1st derivative of curve
98   //! |D1|<Tol, it is considered D1=0.
99   Standard_EXPORT Standard_Real SearchOfTolerance (const Standard_Address C);
100
101
102
103
104 protected:
105
106
107
108
109
110 private:
111
112
113
114   Standard_Address myC1;
115   Standard_Address myC2;
116   Standard_Real myTol;
117   Standard_Real myU;
118   Standard_Real myV;
119   gp_Pnt2d myP1;
120   gp_Pnt2d myP2;
121   gp_Vec2d myDu;
122   gp_Vec2d myDv;
123   TColStd_SequenceOfReal mySqDist;
124   Extrema_SeqPOnCOfCCLocFOfLocECC2d myPoints;
125   Standard_Real myTolC1;
126   Standard_Real myTolC2;
127   Standard_Integer myMaxDerivOrderC1;
128   Standard_Integer myMaxDerivOrderC2;
129   Standard_Real myUinfium;
130   Standard_Real myUsupremum;
131   Standard_Real myVinfium;
132   Standard_Real myVsupremum;
133
134
135 };
136
137 #define Curve1 Adaptor2d_Curve2d
138 #define Curve1_hxx <Adaptor2d_Curve2d.hxx>
139 #define Tool1 Extrema_Curve2dTool
140 #define Tool1_hxx <Extrema_Curve2dTool.hxx>
141 #define Curve2 Adaptor2d_Curve2d
142 #define Curve2_hxx <Adaptor2d_Curve2d.hxx>
143 #define Tool2 Extrema_Curve2dTool
144 #define Tool2_hxx <Extrema_Curve2dTool.hxx>
145 #define POnC Extrema_POnCurv2d
146 #define POnC_hxx <Extrema_POnCurv2d.hxx>
147 #define Pnt gp_Pnt2d
148 #define Pnt_hxx <gp_Pnt2d.hxx>
149 #define Vec gp_Vec2d
150 #define Vec_hxx <gp_Vec2d.hxx>
151 #define Extrema_SeqPOnC Extrema_SeqPOnCOfCCLocFOfLocECC2d
152 #define Extrema_SeqPOnC_hxx <Extrema_SeqPOnCOfCCLocFOfLocECC2d.hxx>
153 #define Extrema_SequenceNodeOfSeqPOnC Extrema_SequenceNodeOfSeqPOnCOfCCLocFOfLocECC2d
154 #define Extrema_SequenceNodeOfSeqPOnC_hxx <Extrema_SequenceNodeOfSeqPOnCOfCCLocFOfLocECC2d.hxx>
155 #define Extrema_SequenceNodeOfSeqPOnC Extrema_SequenceNodeOfSeqPOnCOfCCLocFOfLocECC2d
156 #define Extrema_SequenceNodeOfSeqPOnC_hxx <Extrema_SequenceNodeOfSeqPOnCOfCCLocFOfLocECC2d.hxx>
157 #define Handle_Extrema_SequenceNodeOfSeqPOnC Handle(Extrema_SequenceNodeOfSeqPOnCOfCCLocFOfLocECC2d)
158 #define Handle_Extrema_SequenceNodeOfSeqPOnC Handle(Extrema_SequenceNodeOfSeqPOnCOfCCLocFOfLocECC2d)
159 #define Extrema_FuncExtCC Extrema_CCLocFOfLocECC2d
160 #define Extrema_FuncExtCC_hxx <Extrema_CCLocFOfLocECC2d.hxx>
161
162 #include <Extrema_FuncExtCC.lxx>
163
164 #undef Curve1
165 #undef Curve1_hxx
166 #undef Tool1
167 #undef Tool1_hxx
168 #undef Curve2
169 #undef Curve2_hxx
170 #undef Tool2
171 #undef Tool2_hxx
172 #undef POnC
173 #undef POnC_hxx
174 #undef Pnt
175 #undef Pnt_hxx
176 #undef Vec
177 #undef Vec_hxx
178 #undef Extrema_SeqPOnC
179 #undef Extrema_SeqPOnC_hxx
180 #undef Extrema_SequenceNodeOfSeqPOnC
181 #undef Extrema_SequenceNodeOfSeqPOnC_hxx
182 #undef Extrema_SequenceNodeOfSeqPOnC
183 #undef Extrema_SequenceNodeOfSeqPOnC_hxx
184 #undef Handle_Extrema_SequenceNodeOfSeqPOnC
185 #undef Handle_Extrema_SequenceNodeOfSeqPOnC
186 #undef Extrema_FuncExtCC
187 #undef Extrema_FuncExtCC_hxx
188
189
190
191
192 #endif // _Extrema_CCLocFOfLocECC2d_HeaderFile