Warnings on vc14 were eliminated
[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
7fd59977 16#include <Draw_ColorKind.hxx>
42cf5bc1 17#include <DrawFairCurve_MinimalVariation.hxx>
18#include <FairCurve_MinimalVariation.hxx>
19#include <Standard_Type.hxx>
7fd59977 20
92efcf78 21IMPLEMENT_STANDARD_RTTIEXT(DrawFairCurve_MinimalVariation,DrawFairCurve_Batten)
22
7fd59977 23DrawFairCurve_MinimalVariation::DrawFairCurve_MinimalVariation(const Standard_Address TheMVC)
24 : DrawFairCurve_Batten(TheMVC)
25
26{
27 SetColor(Draw_jaune);
28}
29
30void DrawFairCurve_MinimalVariation::SetCurvature(const Standard_Integer Side,
31 const Standard_Real Rho)
32{
33 if (Side == 1) {
34 ((FairCurve_MinimalVariation*)MyBatten)->SetCurvature1(Rho);
35 ((FairCurve_MinimalVariation*)MyBatten)->SetConstraintOrder1(2);
36 }
37 else {
38 ((FairCurve_MinimalVariation*)MyBatten)->SetCurvature2(Rho);
39 ((FairCurve_MinimalVariation*)MyBatten)->SetConstraintOrder2(2);
40 }
41 Compute();
42}
43
44void DrawFairCurve_MinimalVariation::FreeCurvature(const Standard_Integer Side)
45{
46 if (Side == 1) {
47 if ( ((FairCurve_MinimalVariation*)MyBatten)->GetConstraintOrder1()>1)
48 {
49 ((FairCurve_MinimalVariation*)MyBatten)->SetConstraintOrder1(1);
50 }
51 }
52 else {
53 if ( ((FairCurve_MinimalVariation*)MyBatten)->GetConstraintOrder2()>1)
54 {
55 ((FairCurve_MinimalVariation*)MyBatten)->SetConstraintOrder2(1);
56 }
57 }
58 Compute();
59}
60
61
62void DrawFairCurve_MinimalVariation::SetPhysicalRatio( const Standard_Real Ratio)
63{
64 ((FairCurve_MinimalVariation*)MyBatten)->SetPhysicalRatio(Ratio);
65 Compute();
66}
67
68Standard_Real DrawFairCurve_MinimalVariation::GetCurvature(const Standard_Integer Side) const
69{
70 if (Side == 1) {return ((FairCurve_MinimalVariation*)MyBatten)->GetCurvature1();}
71 else {return ((FairCurve_MinimalVariation*)MyBatten)->GetCurvature2();}
72}
73
74Standard_Real DrawFairCurve_MinimalVariation::GetPhysicalRatio() const
75{
76 return ((FairCurve_MinimalVariation*)MyBatten)->GetPhysicalRatio();
77}