summaryrefslogtreecommitdiff
path: root/src/Law/Law_S.cxx
blob: 373695287790e581c98e66dd96c92195803d9095 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
// pmn -> modified 17/01/1996 : utilisation de Curve() et SetCurve()

#include <Law_S.ixx>
#include <TColStd_Array1OfReal.hxx>
#include <TColStd_Array1OfInteger.hxx>
#include <Law_BSpline.hxx>

Law_S::Law_S ()
{}


void Law_S::Set (const Standard_Real Pdeb,
		 const Standard_Real Valdeb,
		 const Standard_Real Pfin,
		 const Standard_Real Valfin)
{
  Set(Pdeb,Valdeb,0.,Pfin,Valfin,0.);
}


void Law_S::Set (const Standard_Real Pdeb,
		 const Standard_Real Valdeb,
		 const Standard_Real Ddeb,
		 const Standard_Real Pfin,
		 const Standard_Real Valfin,
		 const Standard_Real Dfin)
{
  TColStd_Array1OfReal    poles(1,4);
  TColStd_Array1OfReal    knots(1,2);
  TColStd_Array1OfInteger mults(1,2);
  poles(1) = Valdeb; poles(4) = Valfin;
  Standard_Real coe = (Pfin-Pdeb) / 3.;
  poles(2) = Valdeb + coe * Ddeb;
  poles(3) = Valfin - coe * Dfin;
  knots(1) = Pdeb; knots(2) = Pfin;
  mults(1) = mults(2) = 4; 

  SetCurve( new Law_BSpline(poles,knots,mults,3) );
}