0026936: Drawbacks of inlining in new type system in OCCT 7.0 -- manual
[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
21DrawFairCurve_MinimalVariation::DrawFairCurve_MinimalVariation(const Standard_Address TheMVC)
22 : DrawFairCurve_Batten(TheMVC)
23
24{
25 SetColor(Draw_jaune);
26}
27
28void DrawFairCurve_MinimalVariation::SetCurvature(const Standard_Integer Side,
29 const Standard_Real Rho)
30{
31 if (Side == 1) {
32 ((FairCurve_MinimalVariation*)MyBatten)->SetCurvature1(Rho);
33 ((FairCurve_MinimalVariation*)MyBatten)->SetConstraintOrder1(2);
34 }
35 else {
36 ((FairCurve_MinimalVariation*)MyBatten)->SetCurvature2(Rho);
37 ((FairCurve_MinimalVariation*)MyBatten)->SetConstraintOrder2(2);
38 }
39 Compute();
40}
41
42void DrawFairCurve_MinimalVariation::FreeCurvature(const Standard_Integer Side)
43{
44 if (Side == 1) {
45 if ( ((FairCurve_MinimalVariation*)MyBatten)->GetConstraintOrder1()>1)
46 {
47 ((FairCurve_MinimalVariation*)MyBatten)->SetConstraintOrder1(1);
48 }
49 }
50 else {
51 if ( ((FairCurve_MinimalVariation*)MyBatten)->GetConstraintOrder2()>1)
52 {
53 ((FairCurve_MinimalVariation*)MyBatten)->SetConstraintOrder2(1);
54 }
55 }
56 Compute();
57}
58
59
60void DrawFairCurve_MinimalVariation::SetPhysicalRatio( const Standard_Real Ratio)
61{
62 ((FairCurve_MinimalVariation*)MyBatten)->SetPhysicalRatio(Ratio);
63 Compute();
64}
65
66Standard_Real DrawFairCurve_MinimalVariation::GetCurvature(const Standard_Integer Side) const
67{
68 if (Side == 1) {return ((FairCurve_MinimalVariation*)MyBatten)->GetCurvature1();}
69 else {return ((FairCurve_MinimalVariation*)MyBatten)->GetCurvature2();}
70}
71
72Standard_Real DrawFairCurve_MinimalVariation::GetPhysicalRatio() const
73{
74 return ((FairCurve_MinimalVariation*)MyBatten)->GetPhysicalRatio();
75}