0022627: Change OCCT memory management defaults
[occt.git] / src / DrawFairCurve / DrawFairCurve_MinimalVariation.cxx
CommitLineData
7fd59977 1#include <DrawFairCurve_MinimalVariation.ixx>
2
3#include <FairCurve_MinimalVariation.hxx>
4#include <Draw_ColorKind.hxx>
5
6DrawFairCurve_MinimalVariation::DrawFairCurve_MinimalVariation(const Standard_Address TheMVC)
7 : DrawFairCurve_Batten(TheMVC)
8
9{
10 SetColor(Draw_jaune);
11}
12
13void DrawFairCurve_MinimalVariation::SetCurvature(const Standard_Integer Side,
14 const Standard_Real Rho)
15{
16 if (Side == 1) {
17 ((FairCurve_MinimalVariation*)MyBatten)->SetCurvature1(Rho);
18 ((FairCurve_MinimalVariation*)MyBatten)->SetConstraintOrder1(2);
19 }
20 else {
21 ((FairCurve_MinimalVariation*)MyBatten)->SetCurvature2(Rho);
22 ((FairCurve_MinimalVariation*)MyBatten)->SetConstraintOrder2(2);
23 }
24 Compute();
25}
26
27void DrawFairCurve_MinimalVariation::FreeCurvature(const Standard_Integer Side)
28{
29 if (Side == 1) {
30 if ( ((FairCurve_MinimalVariation*)MyBatten)->GetConstraintOrder1()>1)
31 {
32 ((FairCurve_MinimalVariation*)MyBatten)->SetConstraintOrder1(1);
33 }
34 }
35 else {
36 if ( ((FairCurve_MinimalVariation*)MyBatten)->GetConstraintOrder2()>1)
37 {
38 ((FairCurve_MinimalVariation*)MyBatten)->SetConstraintOrder2(1);
39 }
40 }
41 Compute();
42}
43
44
45void DrawFairCurve_MinimalVariation::SetPhysicalRatio( const Standard_Real Ratio)
46{
47 ((FairCurve_MinimalVariation*)MyBatten)->SetPhysicalRatio(Ratio);
48 Compute();
49}
50
51Standard_Real DrawFairCurve_MinimalVariation::GetCurvature(const Standard_Integer Side) const
52{
53 if (Side == 1) {return ((FairCurve_MinimalVariation*)MyBatten)->GetCurvature1();}
54 else {return ((FairCurve_MinimalVariation*)MyBatten)->GetCurvature2();}
55}
56
57Standard_Real DrawFairCurve_MinimalVariation::GetPhysicalRatio() const
58{
59 return ((FairCurve_MinimalVariation*)MyBatten)->GetPhysicalRatio();
60}