1 // Created on: 1995-06-06
2 // Created by: Jean Yves LEBEY
3 // Copyright (c) 1995-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 _BRepApprox_MyGradientbisOfTheComputeLineOfApprox_HeaderFile
18 #define _BRepApprox_MyGradientbisOfTheComputeLineOfApprox_HeaderFile
20 #include <Standard.hxx>
21 #include <Standard_DefineAlloc.hxx>
22 #include <Standard_Handle.hxx>
24 #include <AppParCurves_MultiCurve.hxx>
25 #include <math_Vector.hxx>
26 #include <Standard_Real.hxx>
27 #include <Standard_Integer.hxx>
28 #include <AppParCurves_HArray1OfConstraintCouple.hxx>
29 class Standard_OutOfRange;
30 class StdFail_NotDone;
31 class BRepApprox_TheMultiLineOfApprox;
32 class BRepApprox_TheMultiLineToolOfApprox;
33 class BRepApprox_ParLeastSquareOfMyGradientbisOfTheComputeLineOfApprox;
34 class BRepApprox_ResConstraintOfMyGradientbisOfTheComputeLineOfApprox;
35 class BRepApprox_ParFunctionOfMyGradientbisOfTheComputeLineOfApprox;
36 class BRepApprox_Gradient_BFGSOfMyGradientbisOfTheComputeLineOfApprox;
37 class AppParCurves_MultiCurve;
41 class BRepApprox_MyGradientbisOfTheComputeLineOfApprox
48 //! Tries to minimize the sum (square(||Qui - Bi*Pi||))
49 //! where Pui describe the approximating Bezier curves'Poles
50 //! and Qi the MultiLine points with a parameter ui.
51 //! In this algorithm, the parameters ui are the unknowns.
52 //! The tolerance required on this sum is given by Tol.
53 //! The desired degree of the resulting curve is Deg.
54 Standard_EXPORT BRepApprox_MyGradientbisOfTheComputeLineOfApprox(const BRepApprox_TheMultiLineOfApprox& SSP, const Standard_Integer FirstPoint, const Standard_Integer LastPoint, const Handle(AppParCurves_HArray1OfConstraintCouple)& TheConstraints, math_Vector& Parameters, const Standard_Integer Deg, const Standard_Real Tol3d, const Standard_Real Tol2d, const Standard_Integer NbIterations = 200);
56 //! returns True if all has been correctly done.
57 Standard_EXPORT Standard_Boolean IsDone() const;
59 //! returns all the Bezier curves approximating the
60 //! MultiLine SSP after minimization of the parameter.
61 Standard_EXPORT AppParCurves_MultiCurve Value() const;
63 //! returns the difference between the old and the new
65 //! An exception is raised if NotDone.
66 //! An exception is raised if Index<1 or Index>NbParameters.
67 Standard_EXPORT Standard_Real Error (const Standard_Integer Index) const;
69 //! returns the maximum difference between the old and the
70 //! new approximation.
71 Standard_EXPORT Standard_Real MaxError3d() const;
73 //! returns the maximum difference between the old and the
74 //! new approximation.
75 Standard_EXPORT Standard_Real MaxError2d() const;
77 //! returns the average error between the old and the
78 //! new approximation.
79 Standard_EXPORT Standard_Real AverageError() const;
94 AppParCurves_MultiCurve SCU;
96 Standard_Real AvError;
97 Standard_Real MError3d;
98 Standard_Real MError2d;
99 Standard_Boolean Done;
110 #endif // _BRepApprox_MyGradientbisOfTheComputeLineOfApprox_HeaderFile