1 // Created on: 1997-10-22
2 // Created by: Philippe MANGIN / Sergey SOKOLOV
3 // Copyright (c) 1997-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 _PLib_Base_HeaderFile
18 #define _PLib_Base_HeaderFile
20 #include <Standard.hxx>
21 #include <Standard_Type.hxx>
23 #include <MMgt_TShared.hxx>
24 #include <Standard_Integer.hxx>
25 #include <TColStd_Array1OfReal.hxx>
26 #include <Standard_Real.hxx>
30 DEFINE_STANDARD_HANDLE(PLib_Base, MMgt_TShared)
32 //! To work with different polynomial's Bases
33 class PLib_Base : public MMgt_TShared
40 //! Convert the polynomial P(t) in the canonical base.
41 Standard_EXPORT virtual void ToCoefficients (const Standard_Integer Dimension, const Standard_Integer Degree, const TColStd_Array1OfReal& CoeffinBase, TColStd_Array1OfReal& Coefficients) const = 0;
43 //! Compute the values of the basis functions in u
44 Standard_EXPORT virtual void D0 (const Standard_Real U, TColStd_Array1OfReal& BasisValue) = 0;
46 //! Compute the values and the derivatives values of
47 //! the basis functions in u
48 Standard_EXPORT virtual void D1 (const Standard_Real U, TColStd_Array1OfReal& BasisValue, TColStd_Array1OfReal& BasisD1) = 0;
50 //! Compute the values and the derivatives values of
51 //! the basis functions in u
52 Standard_EXPORT virtual void D2 (const Standard_Real U, TColStd_Array1OfReal& BasisValue, TColStd_Array1OfReal& BasisD1, TColStd_Array1OfReal& BasisD2) = 0;
54 //! Compute the values and the derivatives values of
55 //! the basis functions in u
56 Standard_EXPORT virtual void D3 (const Standard_Real U, TColStd_Array1OfReal& BasisValue, TColStd_Array1OfReal& BasisD1, TColStd_Array1OfReal& BasisD2, TColStd_Array1OfReal& BasisD3) = 0;
58 //! returns WorkDegree
59 Standard_EXPORT virtual Standard_Integer WorkDegree() const = 0;
62 //! Compute NewDegree <= MaxDegree so that MaxError is lower
64 //! MaxError can be greater than Tol if it is not possible
65 //! to find a NewDegree <= MaxDegree.
66 //! In this case NewDegree = MaxDegree
67 Standard_EXPORT virtual void ReduceDegree (const Standard_Integer Dimension, const Standard_Integer MaxDegree, const Standard_Real Tol, Standard_Real& BaseCoeff, Standard_Integer& NewDegree, Standard_Real& MaxError) const = 0;
72 DEFINE_STANDARD_RTTIEXT(PLib_Base,MMgt_TShared)
92 #endif // _PLib_Base_HeaderFile