42cf5bc1 |
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 |
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 _PLib_Base_HeaderFile |
18 | #define _PLib_Base_HeaderFile |
19 | |
20 | #include <Standard.hxx> |
21 | #include <Standard_Type.hxx> |
22 | |
25e59720 |
23 | #include <Standard_Transient.hxx> |
42cf5bc1 |
24 | #include <Standard_Integer.hxx> |
25 | #include <TColStd_Array1OfReal.hxx> |
26 | #include <Standard_Real.hxx> |
27 | |
28 | |
29 | class PLib_Base; |
25e59720 |
30 | DEFINE_STANDARD_HANDLE(PLib_Base, Standard_Transient) |
42cf5bc1 |
31 | |
32 | //! To work with different polynomial's Bases |
25e59720 |
33 | class PLib_Base : public Standard_Transient |
42cf5bc1 |
34 | { |
35 | |
36 | public: |
37 | |
38 | |
39 | |
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; |
42 | |
43 | //! Compute the values of the basis functions in u |
44 | Standard_EXPORT virtual void D0 (const Standard_Real U, TColStd_Array1OfReal& BasisValue) = 0; |
45 | |
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; |
49 | |
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; |
53 | |
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; |
57 | |
58 | //! returns WorkDegree |
59 | Standard_EXPORT virtual Standard_Integer WorkDegree() const = 0; |
60 | |
61 | |
62 | //! Compute NewDegree <= MaxDegree so that MaxError is lower |
63 | //! than Tol. |
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; |
68 | |
69 | |
70 | |
71 | |
25e59720 |
72 | DEFINE_STANDARD_RTTIEXT(PLib_Base,Standard_Transient) |
42cf5bc1 |
73 | |
74 | protected: |
75 | |
76 | |
77 | |
78 | |
79 | private: |
80 | |
81 | |
82 | |
83 | |
84 | }; |
85 | |
86 | |
87 | |
88 | |
89 | |
90 | |
91 | |
92 | #endif // _PLib_Base_HeaderFile |