42cf5bc1 |
1 | // Created on: 1995-01-12 |
2 | // Created by: Laurent BOURESCHE |
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 _Law_Linear_HeaderFile |
18 | #define _Law_Linear_HeaderFile |
19 | |
20 | #include <Standard.hxx> |
21 | #include <Standard_Type.hxx> |
22 | |
23 | #include <Standard_Real.hxx> |
24 | #include <Law_Function.hxx> |
25 | #include <GeomAbs_Shape.hxx> |
26 | #include <Standard_Integer.hxx> |
27 | #include <TColStd_Array1OfReal.hxx> |
28 | class Standard_OutOfRange; |
29 | class Law_Function; |
30 | |
31 | |
32 | class Law_Linear; |
33 | DEFINE_STANDARD_HANDLE(Law_Linear, Law_Function) |
34 | |
35 | //! Describes an linear evolution law. |
36 | class Law_Linear : public Law_Function |
37 | { |
38 | |
39 | public: |
40 | |
41 | |
42 | //! Constructs an empty linear evolution law. |
43 | Standard_EXPORT Law_Linear(); |
44 | |
45 | |
46 | //! Defines this linear evolution law by assigning both: |
47 | //! - the bounds Pdeb and Pfin of the parameter, and |
48 | //! - the values Valdeb and Valfin of the function at these |
49 | //! two parametric bounds. |
50 | Standard_EXPORT void Set (const Standard_Real Pdeb, const Standard_Real Valdeb, const Standard_Real Pfin, const Standard_Real Valfin); |
51 | |
52 | //! Returns GeomAbs_CN |
53 | Standard_EXPORT GeomAbs_Shape Continuity() const Standard_OVERRIDE; |
54 | |
55 | //! Returns 1 |
56 | Standard_EXPORT Standard_Integer NbIntervals (const GeomAbs_Shape S) const Standard_OVERRIDE; |
57 | |
58 | Standard_EXPORT void Intervals (TColStd_Array1OfReal& T, const GeomAbs_Shape S) const Standard_OVERRIDE; |
59 | |
60 | //! Returns the value of this function at the point of parameter X. |
79104795 |
61 | Standard_EXPORT Standard_Real Value (const Standard_Real X) Standard_OVERRIDE; |
42cf5bc1 |
62 | |
63 | |
64 | //! Returns the value F and the first derivative D of this |
65 | //! function at the point of parameter X. |
79104795 |
66 | Standard_EXPORT void D1 (const Standard_Real X, Standard_Real& F, Standard_Real& D) Standard_OVERRIDE; |
42cf5bc1 |
67 | |
68 | //! Returns the value, first and second derivatives |
69 | //! at parameter X. |
79104795 |
70 | Standard_EXPORT void D2 (const Standard_Real X, Standard_Real& F, Standard_Real& D, Standard_Real& D2) Standard_OVERRIDE; |
42cf5bc1 |
71 | |
72 | //! Returns a law equivalent of <me> between |
73 | //! parameters <First> and <Last>. <Tol> is used to |
74 | //! test for 3d points confusion. |
75 | //! It is usfule to determines the derivatives |
76 | //! in these values <First> and <Last> if |
77 | //! the Law is not Cn. |
78 | Standard_EXPORT Handle(Law_Function) Trim (const Standard_Real PFirst, const Standard_Real PLast, const Standard_Real Tol) const Standard_OVERRIDE; |
79 | |
80 | //! Returns the parametric bounds of the function. |
79104795 |
81 | Standard_EXPORT void Bounds (Standard_Real& PFirst, Standard_Real& PLast) Standard_OVERRIDE; |
42cf5bc1 |
82 | |
83 | |
84 | |
85 | |
92efcf78 |
86 | DEFINE_STANDARD_RTTIEXT(Law_Linear,Law_Function) |
42cf5bc1 |
87 | |
88 | protected: |
89 | |
90 | |
91 | |
92 | |
93 | private: |
94 | |
95 | |
96 | Standard_Real valdeb; |
97 | Standard_Real valfin; |
98 | Standard_Real pdeb; |
99 | Standard_Real pfin; |
100 | |
101 | |
102 | }; |
103 | |
104 | |
105 | |
106 | |
107 | |
108 | |
109 | |
110 | #endif // _Law_Linear_HeaderFile |