0024166: Unable to create file with "Save" menu of voxeldemo Qt sample
[occt.git] / src / DrawFairCurve / DrawFairCurve_MinimalVariation.cxx
CommitLineData
b311480e 1// Copyright (c) 1996-1999 Matra Datavision
2// Copyright (c) 1999-2012 OPEN CASCADE SAS
3//
4// The content of this file is subject to the Open CASCADE Technology Public
5// License Version 6.5 (the "License"). You may not use the content of this file
6// except in compliance with the License. Please obtain a copy of the License
7// at http://www.opencascade.org and read it completely before using this file.
8//
9// The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
10// main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
11//
12// The Original Code and all software distributed under the License is
13// distributed on an "AS IS" basis, without warranty of any kind, and the
14// Initial Developer hereby disclaims all such warranties, including without
15// limitation, any warranties of merchantability, fitness for a particular
16// purpose or non-infringement. Please see the License for the specific terms
17// and conditions governing the rights and limitations under the License.
18
7fd59977 19#include <DrawFairCurve_MinimalVariation.ixx>
20
21#include <FairCurve_MinimalVariation.hxx>
22#include <Draw_ColorKind.hxx>
23
24DrawFairCurve_MinimalVariation::DrawFairCurve_MinimalVariation(const Standard_Address TheMVC)
25 : DrawFairCurve_Batten(TheMVC)
26
27{
28 SetColor(Draw_jaune);
29}
30
31void DrawFairCurve_MinimalVariation::SetCurvature(const Standard_Integer Side,
32 const Standard_Real Rho)
33{
34 if (Side == 1) {
35 ((FairCurve_MinimalVariation*)MyBatten)->SetCurvature1(Rho);
36 ((FairCurve_MinimalVariation*)MyBatten)->SetConstraintOrder1(2);
37 }
38 else {
39 ((FairCurve_MinimalVariation*)MyBatten)->SetCurvature2(Rho);
40 ((FairCurve_MinimalVariation*)MyBatten)->SetConstraintOrder2(2);
41 }
42 Compute();
43}
44
45void DrawFairCurve_MinimalVariation::FreeCurvature(const Standard_Integer Side)
46{
47 if (Side == 1) {
48 if ( ((FairCurve_MinimalVariation*)MyBatten)->GetConstraintOrder1()>1)
49 {
50 ((FairCurve_MinimalVariation*)MyBatten)->SetConstraintOrder1(1);
51 }
52 }
53 else {
54 if ( ((FairCurve_MinimalVariation*)MyBatten)->GetConstraintOrder2()>1)
55 {
56 ((FairCurve_MinimalVariation*)MyBatten)->SetConstraintOrder2(1);
57 }
58 }
59 Compute();
60}
61
62
63void DrawFairCurve_MinimalVariation::SetPhysicalRatio( const Standard_Real Ratio)
64{
65 ((FairCurve_MinimalVariation*)MyBatten)->SetPhysicalRatio(Ratio);
66 Compute();
67}
68
69Standard_Real DrawFairCurve_MinimalVariation::GetCurvature(const Standard_Integer Side) const
70{
71 if (Side == 1) {return ((FairCurve_MinimalVariation*)MyBatten)->GetCurvature1();}
72 else {return ((FairCurve_MinimalVariation*)MyBatten)->GetCurvature2();}
73}
74
75Standard_Real DrawFairCurve_MinimalVariation::GetPhysicalRatio() const
76{
77 return ((FairCurve_MinimalVariation*)MyBatten)->GetPhysicalRatio();
78}