0032951: Coding - get rid of unused headers [GeomConvert to IGESBasic]
[occt.git] / src / GeomInt / GeomInt_ParFunctionOfMyGradientOfTheComputeLineBezierOfWLApprox.hxx
1 // Created on: 1995-01-27
2 // Created by: Jacques GOUSSARD
3 // Copyright (c) 1995-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 _GeomInt_ParFunctionOfMyGradientOfTheComputeLineBezierOfWLApprox_HeaderFile
18 #define _GeomInt_ParFunctionOfMyGradientOfTheComputeLineBezierOfWLApprox_HeaderFile
19
20 #include <Standard.hxx>
21 #include <Standard_DefineAlloc.hxx>
22 #include <Standard_Handle.hxx>
23
24 #include <GeomInt_TheMultiLineOfWLApprox.hxx>
25 #include <Standard_Integer.hxx>
26 #include <Standard_Real.hxx>
27 #include <GeomInt_ParLeastSquareOfMyGradientOfTheComputeLineBezierOfWLApprox.hxx>
28 #include <TColStd_HArray1OfInteger.hxx>
29 #include <AppParCurves_HArray1OfConstraintCouple.hxx>
30 #include <math_MultipleVarFunctionWithGradient.hxx>
31 #include <AppParCurves_Constraint.hxx>
32 class GeomInt_TheMultiLineOfWLApprox;
33 class GeomInt_TheMultiLineToolOfWLApprox;
34 class GeomInt_ParLeastSquareOfMyGradientOfTheComputeLineBezierOfWLApprox;
35 class GeomInt_ResConstraintOfMyGradientOfTheComputeLineBezierOfWLApprox;
36 class AppParCurves_MultiCurve;
37
38
39
40 class GeomInt_ParFunctionOfMyGradientOfTheComputeLineBezierOfWLApprox  : public math_MultipleVarFunctionWithGradient
41 {
42 public:
43
44   DEFINE_STANDARD_ALLOC
45
46   
47   //! initializes the fields of the function. The approximating
48   //! curve has the desired degree Deg.
49   Standard_EXPORT GeomInt_ParFunctionOfMyGradientOfTheComputeLineBezierOfWLApprox(const GeomInt_TheMultiLineOfWLApprox& SSP, const Standard_Integer FirstPoint, const Standard_Integer LastPoint, const Handle(AppParCurves_HArray1OfConstraintCouple)& TheConstraints, const math_Vector& Parameters, const Standard_Integer Deg);
50   
51   //! returns the number of variables of the function. It
52   //! corresponds to the number of MultiPoints.
53   Standard_EXPORT Standard_Integer NbVariables() const;
54   
55   //! this method computes the new approximation of the
56   //! MultiLine
57   //! SSP and calculates F = sum (||Pui - Bi*Pi||2) for each
58   //! point of the MultiLine.
59   Standard_EXPORT Standard_Boolean Value (const math_Vector& X, Standard_Real& F);
60   
61   //! returns the gradient G of the sum above for the
62   //! parameters Xi.
63   Standard_EXPORT Standard_Boolean Gradient (const math_Vector& X, math_Vector& G);
64   
65   //! returns the value F=sum(||Pui - Bi*Pi||)2.
66   //! returns the value G = grad(F) for the parameters Xi.
67   Standard_EXPORT Standard_Boolean Values (const math_Vector& X, Standard_Real& F, math_Vector& G);
68   
69   //! returns the new parameters of the MultiLine.
70   Standard_EXPORT const math_Vector& NewParameters() const;
71   
72   //! returns the MultiCurve approximating the set after
73   //! computing the value F or Grad(F).
74   Standard_EXPORT const AppParCurves_MultiCurve& CurveValue();
75   
76   //! returns the distance between the MultiPoint of range
77   //! IPoint and the curve CurveIndex.
78   Standard_EXPORT Standard_Real Error (const Standard_Integer IPoint, const Standard_Integer CurveIndex) const;
79   
80   //! returns the maximum distance between the points
81   //! and the MultiCurve.
82   Standard_EXPORT Standard_Real MaxError3d() const;
83   
84   //! returns the maximum distance between the points
85   //! and the MultiCurve.
86   Standard_EXPORT Standard_Real MaxError2d() const;
87   
88   Standard_EXPORT AppParCurves_Constraint FirstConstraint (const Handle(AppParCurves_HArray1OfConstraintCouple)& TheConstraints, const Standard_Integer FirstPoint) const;
89   
90   Standard_EXPORT AppParCurves_Constraint LastConstraint (const Handle(AppParCurves_HArray1OfConstraintCouple)& TheConstraints, const Standard_Integer LastPoint) const;
91
92
93
94
95 protected:
96
97   
98   //! this method is used each time Value or Gradient is
99   //! needed.
100   Standard_EXPORT void Perform (const math_Vector& X);
101
102
103
104
105 private:
106
107
108
109   Standard_Boolean Done;
110   GeomInt_TheMultiLineOfWLApprox MyMultiLine;
111   AppParCurves_MultiCurve MyMultiCurve;
112   Standard_Integer Degre;
113   math_Vector myParameters;
114   Standard_Real FVal;
115   math_Vector ValGrad_F;
116   math_Matrix MyF;
117   math_Matrix PTLX;
118   math_Matrix PTLY;
119   math_Matrix PTLZ;
120   math_Matrix A;
121   math_Matrix DA;
122   GeomInt_ParLeastSquareOfMyGradientOfTheComputeLineBezierOfWLApprox MyLeastSquare;
123   Standard_Boolean Contraintes;
124   Standard_Integer NbP;
125   Standard_Integer NbCu;
126   Standard_Integer Adeb;
127   Standard_Integer Afin;
128   Handle(TColStd_HArray1OfInteger) tabdim;
129   Standard_Real ERR3d;
130   Standard_Real ERR2d;
131   Standard_Integer FirstP;
132   Standard_Integer LastP;
133   Handle(AppParCurves_HArray1OfConstraintCouple) myConstraints;
134
135
136 };
137
138
139
140
141
142
143
144 #endif // _GeomInt_ParFunctionOfMyGradientOfTheComputeLineBezierOfWLApprox_HeaderFile