0024023: Revamp the OCCT Handle -- ambiguity
[occt.git] / src / DrawFairCurve / DrawFairCurve_MinimalVariation.cxx
CommitLineData
b311480e 1// Copyright (c) 1996-1999 Matra Datavision
973c2be1 2// Copyright (c) 1999-2014 OPEN CASCADE SAS
b311480e 3//
973c2be1 4// This file is part of Open CASCADE Technology software library.
b311480e 5//
d5f74e42 6// This library is free software; you can redistribute it and/or modify it under
7// the terms of the GNU Lesser General Public License version 2.1 as published
973c2be1 8// by the Free Software Foundation, with special exception defined in the file
9// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
10// distribution for complete text of the license and disclaimer of any warranty.
b311480e 11//
973c2be1 12// Alternatively, this file may be used under the terms of Open CASCADE
13// commercial license or contractual agreement.
b311480e 14
7fd59977 15#include <DrawFairCurve_MinimalVariation.ixx>
16
17#include <FairCurve_MinimalVariation.hxx>
18#include <Draw_ColorKind.hxx>
19
20DrawFairCurve_MinimalVariation::DrawFairCurve_MinimalVariation(const Standard_Address TheMVC)
21 : DrawFairCurve_Batten(TheMVC)
22
23{
24 SetColor(Draw_jaune);
25}
26
27void DrawFairCurve_MinimalVariation::SetCurvature(const Standard_Integer Side,
28 const Standard_Real Rho)
29{
30 if (Side == 1) {
31 ((FairCurve_MinimalVariation*)MyBatten)->SetCurvature1(Rho);
32 ((FairCurve_MinimalVariation*)MyBatten)->SetConstraintOrder1(2);
33 }
34 else {
35 ((FairCurve_MinimalVariation*)MyBatten)->SetCurvature2(Rho);
36 ((FairCurve_MinimalVariation*)MyBatten)->SetConstraintOrder2(2);
37 }
38 Compute();
39}
40
41void DrawFairCurve_MinimalVariation::FreeCurvature(const Standard_Integer Side)
42{
43 if (Side == 1) {
44 if ( ((FairCurve_MinimalVariation*)MyBatten)->GetConstraintOrder1()>1)
45 {
46 ((FairCurve_MinimalVariation*)MyBatten)->SetConstraintOrder1(1);
47 }
48 }
49 else {
50 if ( ((FairCurve_MinimalVariation*)MyBatten)->GetConstraintOrder2()>1)
51 {
52 ((FairCurve_MinimalVariation*)MyBatten)->SetConstraintOrder2(1);
53 }
54 }
55 Compute();
56}
57
58
59void DrawFairCurve_MinimalVariation::SetPhysicalRatio( const Standard_Real Ratio)
60{
61 ((FairCurve_MinimalVariation*)MyBatten)->SetPhysicalRatio(Ratio);
62 Compute();
63}
64
65Standard_Real DrawFairCurve_MinimalVariation::GetCurvature(const Standard_Integer Side) const
66{
67 if (Side == 1) {return ((FairCurve_MinimalVariation*)MyBatten)->GetCurvature1();}
68 else {return ((FairCurve_MinimalVariation*)MyBatten)->GetCurvature2();}
69}
70
71Standard_Real DrawFairCurve_MinimalVariation::GetPhysicalRatio() const
72{
73 return ((FairCurve_MinimalVariation*)MyBatten)->GetPhysicalRatio();
74}