7fd59977 |
1 | // pmn -> modified 17/01/1996 : utilisation de Curve() et SetCurve() |
2 | |
3 | #include <Law_S.ixx> |
4 | #include <TColStd_Array1OfReal.hxx> |
5 | #include <TColStd_Array1OfInteger.hxx> |
6 | #include <Law_BSpline.hxx> |
7 | |
8 | Law_S::Law_S () |
9 | {} |
10 | |
11 | |
12 | void Law_S::Set (const Standard_Real Pdeb, |
13 | const Standard_Real Valdeb, |
14 | const Standard_Real Pfin, |
15 | const Standard_Real Valfin) |
16 | { |
17 | Set(Pdeb,Valdeb,0.,Pfin,Valfin,0.); |
18 | } |
19 | |
20 | |
21 | void Law_S::Set (const Standard_Real Pdeb, |
22 | const Standard_Real Valdeb, |
23 | const Standard_Real Ddeb, |
24 | const Standard_Real Pfin, |
25 | const Standard_Real Valfin, |
26 | const Standard_Real Dfin) |
27 | { |
28 | TColStd_Array1OfReal poles(1,4); |
29 | TColStd_Array1OfReal knots(1,2); |
30 | TColStd_Array1OfInteger mults(1,2); |
31 | poles(1) = Valdeb; poles(4) = Valfin; |
32 | Standard_Real coe = (Pfin-Pdeb) / 3.; |
33 | poles(2) = Valdeb + coe * Ddeb; |
34 | poles(3) = Valfin - coe * Dfin; |
35 | knots(1) = Pdeb; knots(2) = Pfin; |
36 | mults(1) = mults(2) = 4; |
37 | |
38 | SetCurve( new Law_BSpline(poles,knots,mults,3) ); |
39 | } |