summaryrefslogtreecommitdiff
path: root/src/DrawFairCurve/DrawFairCurve_MinimalVariation.cxx
blob: b314eab99d45f188384de3ff2474824e419933c3 (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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
#include <DrawFairCurve_MinimalVariation.ixx>

#include <FairCurve_MinimalVariation.hxx>
#include <Draw_ColorKind.hxx>

DrawFairCurve_MinimalVariation::DrawFairCurve_MinimalVariation(const Standard_Address TheMVC)
                               : DrawFairCurve_Batten(TheMVC)
                                 
{
 SetColor(Draw_jaune);
}

void DrawFairCurve_MinimalVariation::SetCurvature(const Standard_Integer Side,
						  const Standard_Real Rho)
{
  if (Side == 1) {
     ((FairCurve_MinimalVariation*)MyBatten)->SetCurvature1(Rho);
     ((FairCurve_MinimalVariation*)MyBatten)->SetConstraintOrder1(2);
   }
  else {
     ((FairCurve_MinimalVariation*)MyBatten)->SetCurvature2(Rho);
     ((FairCurve_MinimalVariation*)MyBatten)->SetConstraintOrder2(2);
   }
  Compute();
}

void DrawFairCurve_MinimalVariation::FreeCurvature(const Standard_Integer Side)
{
  if (Side == 1) {
     if ( ((FairCurve_MinimalVariation*)MyBatten)->GetConstraintOrder1()>1) 
       {
	 ((FairCurve_MinimalVariation*)MyBatten)->SetConstraintOrder1(1);
       }
   }
  else {
     if ( ((FairCurve_MinimalVariation*)MyBatten)->GetConstraintOrder2()>1) 
       {
	 ((FairCurve_MinimalVariation*)MyBatten)->SetConstraintOrder2(1);
       }
   }
  Compute();
}  


void DrawFairCurve_MinimalVariation::SetPhysicalRatio( const Standard_Real Ratio)
{
 ((FairCurve_MinimalVariation*)MyBatten)->SetPhysicalRatio(Ratio);
 Compute();
}

Standard_Real DrawFairCurve_MinimalVariation::GetCurvature(const Standard_Integer Side) const
{
 if (Side == 1) {return ((FairCurve_MinimalVariation*)MyBatten)->GetCurvature1();}
 else           {return ((FairCurve_MinimalVariation*)MyBatten)->GetCurvature2();}
}

Standard_Real DrawFairCurve_MinimalVariation::GetPhysicalRatio() const
{
  return ((FairCurve_MinimalVariation*)MyBatten)->GetPhysicalRatio();
}