Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:03:40

0001 // Created on: 1995-01-27
0002 // Created by: Jacques GOUSSARD
0003 // Copyright (c) 1995-1999 Matra Datavision
0004 // Copyright (c) 1999-2014 OPEN CASCADE SAS
0005 //
0006 // This file is part of Open CASCADE Technology software library.
0007 //
0008 // This library is free software; you can redistribute it and/or modify it under
0009 // the terms of the GNU Lesser General Public License version 2.1 as published
0010 // by the Free Software Foundation, with special exception defined in the file
0011 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
0012 // distribution for complete text of the license and disclaimer of any warranty.
0013 //
0014 // Alternatively, this file may be used under the terms of Open CASCADE
0015 // commercial license or contractual agreement.
0016 
0017 #ifndef _GeomInt_MyGradientOfTheComputeLineBezierOfWLApprox_HeaderFile
0018 #define _GeomInt_MyGradientOfTheComputeLineBezierOfWLApprox_HeaderFile
0019 
0020 #include <Standard.hxx>
0021 #include <Standard_DefineAlloc.hxx>
0022 #include <Standard_Handle.hxx>
0023 
0024 #include <AppParCurves_MultiCurve.hxx>
0025 #include <math_Vector.hxx>
0026 #include <Standard_Real.hxx>
0027 #include <Standard_Integer.hxx>
0028 #include <AppParCurves_HArray1OfConstraintCouple.hxx>
0029 class Standard_OutOfRange;
0030 class StdFail_NotDone;
0031 class GeomInt_TheMultiLineOfWLApprox;
0032 class GeomInt_TheMultiLineToolOfWLApprox;
0033 class GeomInt_ParLeastSquareOfMyGradientOfTheComputeLineBezierOfWLApprox;
0034 class GeomInt_ResConstraintOfMyGradientOfTheComputeLineBezierOfWLApprox;
0035 class GeomInt_ParFunctionOfMyGradientOfTheComputeLineBezierOfWLApprox;
0036 class GeomInt_Gradient_BFGSOfMyGradientOfTheComputeLineBezierOfWLApprox;
0037 class AppParCurves_MultiCurve;
0038 
0039 
0040 
0041 class GeomInt_MyGradientOfTheComputeLineBezierOfWLApprox 
0042 {
0043 public:
0044 
0045   DEFINE_STANDARD_ALLOC
0046 
0047   
0048   //! Tries to minimize the sum (square(||Qui - Bi*Pi||))
0049   //! where Pui describe the approximating Bezier curves'Poles
0050   //! and Qi the MultiLine points with a parameter ui.
0051   //! In this algorithm, the parameters ui are the unknowns.
0052   //! The tolerance required on this sum is given by Tol.
0053   //! The desired degree of the resulting curve is Deg.
0054   Standard_EXPORT GeomInt_MyGradientOfTheComputeLineBezierOfWLApprox(const GeomInt_TheMultiLineOfWLApprox& 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);
0055   
0056   //! returns True if all has been correctly done.
0057   Standard_EXPORT Standard_Boolean IsDone() const;
0058   
0059   //! returns all the Bezier curves approximating the
0060   //! MultiLine SSP after minimization of the parameter.
0061   Standard_EXPORT AppParCurves_MultiCurve Value() const;
0062   
0063   //! returns the difference between the old and the new
0064   //! approximation.
0065   //! An exception is raised if NotDone.
0066   //! An exception is raised if Index<1 or Index>NbParameters.
0067   Standard_EXPORT Standard_Real Error (const Standard_Integer Index) const;
0068   
0069   //! returns the maximum difference between the old and the
0070   //! new approximation.
0071   Standard_EXPORT Standard_Real MaxError3d() const;
0072   
0073   //! returns the maximum difference between the old and the
0074   //! new approximation.
0075   Standard_EXPORT Standard_Real MaxError2d() const;
0076   
0077   //! returns the average error between the old and the
0078   //! new approximation.
0079   Standard_EXPORT Standard_Real AverageError() const;
0080 
0081 
0082 
0083 
0084 protected:
0085 
0086 
0087 
0088 
0089 
0090 private:
0091 
0092 
0093 
0094   AppParCurves_MultiCurve SCU;
0095   math_Vector ParError;
0096   Standard_Real AvError;
0097   Standard_Real MError3d;
0098   Standard_Real MError2d;
0099   Standard_Boolean Done;
0100 
0101 
0102 };
0103 
0104 
0105 
0106 
0107 
0108 
0109 
0110 #endif // _GeomInt_MyGradientOfTheComputeLineBezierOfWLApprox_HeaderFile