b311480e |
1 | // Created on: 1996-03-29 |
2 | // Created by: Laurent BOURESCHE |
3 | // Copyright (c) 1996-1999 Matra Datavision |
973c2be1 |
4 | // Copyright (c) 1999-2014 OPEN CASCADE SAS |
b311480e |
5 | // |
973c2be1 |
6 | // This file is part of Open CASCADE Technology software library. |
b311480e |
7 | // |
d5f74e42 |
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 |
973c2be1 |
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. |
b311480e |
13 | // |
973c2be1 |
14 | // Alternatively, this file may be used under the terms of Open CASCADE |
15 | // commercial license or contractual agreement. |
7fd59977 |
16 | |
17 | // pmn -> 17/01/1996 added : Continuity, (Nb)Interals, D2, Trim |
18 | |
42cf5bc1 |
19 | #include <Law_Constant.hxx> |
20 | #include <Law_Function.hxx> |
21 | #include <Standard_OutOfRange.hxx> |
22 | #include <Standard_Type.hxx> |
7fd59977 |
23 | |
92efcf78 |
24 | IMPLEMENT_STANDARD_RTTIEXT(Law_Constant,Law_Function) |
25 | |
7fd59977 |
26 | //======================================================================= |
27 | //function : Law_Constant |
28 | //purpose : |
29 | //======================================================================= |
7fd59977 |
30 | Law_Constant::Law_Constant() |
31 | { |
32 | } |
33 | |
34 | //======================================================================= |
35 | //function : Set |
36 | //purpose : |
37 | //======================================================================= |
38 | |
39 | void Law_Constant::Set(const Standard_Real Radius, |
40 | const Standard_Real PFirst, |
41 | const Standard_Real PLast) |
42 | { |
43 | radius = Radius; |
44 | first = PFirst; |
45 | last = PLast; |
46 | } |
47 | //======================================================================= |
48 | //function : Continuity |
49 | //purpose : |
50 | //======================================================================= |
51 | GeomAbs_Shape Law_Constant::Continuity() const |
52 | { |
53 | return GeomAbs_CN; |
54 | } |
55 | |
56 | //======================================================================= |
57 | //function : NbIntervals |
58 | //purpose : |
59 | //======================================================================= |
60 | //Standard_Integer Law_Constant::NbIntervals(const GeomAbs_Shape S) const |
61 | Standard_Integer Law_Constant::NbIntervals(const GeomAbs_Shape ) const |
62 | { |
63 | return 1; |
64 | } |
65 | |
66 | //======================================================================= |
67 | //function : Intervals |
68 | //purpose : |
69 | //======================================================================= |
70 | void Law_Constant::Intervals(TColStd_Array1OfReal& T, |
71 | // const GeomAbs_Shape S) const |
72 | const GeomAbs_Shape ) const |
73 | { |
74 | T.SetValue(T.Lower(), first); |
75 | T.SetValue(T.Upper(), last); |
76 | } |
77 | |
78 | //======================================================================= |
79 | //function : Value |
80 | //purpose : |
81 | //======================================================================= |
82 | |
83 | Standard_Real Law_Constant::Value(const Standard_Real) |
84 | { |
85 | return radius; |
86 | } |
87 | |
88 | //======================================================================= |
89 | //function : D1 |
90 | //purpose : |
91 | //======================================================================= |
92 | |
93 | void Law_Constant::D1(const Standard_Real, |
94 | Standard_Real& F, |
95 | Standard_Real& D) |
96 | { |
97 | F = radius; |
98 | D = 0.; |
99 | } |
100 | |
101 | //======================================================================= |
102 | //function : D2 |
103 | //purpose : |
104 | //======================================================================= |
105 | |
106 | void Law_Constant::D2(const Standard_Real, |
107 | Standard_Real& F, |
108 | Standard_Real& D, |
109 | Standard_Real& D2) |
110 | { |
111 | F = radius; |
112 | D = D2 = 0.; |
113 | } |
114 | |
115 | //======================================================================= |
116 | //function : Trim |
117 | //purpose : |
118 | //======================================================================= |
119 | |
120 | Handle(Law_Function) Law_Constant::Trim(const Standard_Real PFirst, |
121 | const Standard_Real PLast, |
122 | // const Standard_Real Tol) const |
123 | const Standard_Real ) const |
124 | { |
125 | Handle(Law_Constant) l = new (Law_Constant)(); |
126 | l->Set(radius, PFirst, PLast); |
127 | return l; |
128 | } |
129 | |
130 | //======================================================================= |
131 | //function : Bounds |
132 | //purpose : |
133 | //======================================================================= |
134 | |
135 | void Law_Constant::Bounds(Standard_Real& PFirst, |
136 | Standard_Real& PLast) |
137 | { |
138 | PFirst = first; |
139 | PLast = last; |
140 | } |