0022922: Clean up warnings on uninitialized / unused variables
[occt.git] / src / DrawFairCurve / DrawFairCurve_Batten.cxx
CommitLineData
7fd59977 1// File: DrawFairCurve_Batten.cxx
2// Created: Fri Feb 16 14:32:26 1996
3// Author: Philippe MANGIN
4// <pmn@sgi29>
5// Copyright: Matra Datavision 1996
6
7#include <DrawFairCurve_Batten.ixx>
8
9#include <FairCurve_Batten.hxx>
10#include <FairCurve_AnalysisCode.hxx>
11#include <GeomTools_Curve2dSet.hxx>
12
13DrawFairCurve_Batten::DrawFairCurve_Batten(const Standard_Address TheBatten)
14 : DrawTrSurf_BSplineCurve2d( ((FairCurve_Batten*)TheBatten)->Curve()),
15 MyBatten( TheBatten)
16
17{
18 Compute();
19 ShowCurvature();
20}
21
22void DrawFairCurve_Batten::Compute()
23{
24 FairCurve_AnalysisCode Iana;
6e6cd5d9 25 ((FairCurve_Batten*)MyBatten)->Compute(Iana, 50, 1.0e-2);
7fd59977 26 curv = ((FairCurve_Batten*)MyBatten)->Curve();
27}
28void DrawFairCurve_Batten::SetPoint(const Standard_Integer Side, const gp_Pnt2d& Point)
29{
30 if (Side == 1) {
31 ((FairCurve_Batten*)MyBatten)->SetP1(Point);
32 }
33 else {
34 ((FairCurve_Batten*)MyBatten)-> SetP2(Point);
35 }
36 Compute();
37}
38
39void DrawFairCurve_Batten::SetAngle(const Standard_Integer Side, const Standard_Real Angle)
40{
41 if (Side == 1) {
c6541a0c 42 ((FairCurve_Batten*)MyBatten)->SetAngle1(Angle*M_PI/180);
7fd59977 43 if ( ((FairCurve_Batten*)MyBatten)->GetConstraintOrder1() == 0 )
44 {
45 ((FairCurve_Batten*)MyBatten)->SetConstraintOrder1(1);
46 }
47 }
48 else {
c6541a0c 49 ((FairCurve_Batten*)MyBatten)->SetAngle2(Angle*M_PI/180);
7fd59977 50 if ( ((FairCurve_Batten*)MyBatten)->GetConstraintOrder2() == 0 )
51 {
52 ((FairCurve_Batten*)MyBatten)->SetConstraintOrder2(1);
53 }
54 }
55 Compute();
56}
57
58void DrawFairCurve_Batten::SetSliding(const Standard_Real Length)
59{
60 ((FairCurve_Batten*)MyBatten)-> SetFreeSliding(Standard_False);
61 ((FairCurve_Batten*)MyBatten)->SetSlidingFactor(Length);
62 Compute();
63}
64
65void DrawFairCurve_Batten::SetHeight(const Standard_Real Height)
66{
67 ((FairCurve_Batten*)MyBatten)->SetHeight(Height);
68 Compute();
69}
70
71void DrawFairCurve_Batten::SetSlope(const Standard_Real Slope)
72{
73 ((FairCurve_Batten*)MyBatten)->SetSlope(Slope);
74 Compute();
75}
76
77Standard_Real DrawFairCurve_Batten::GetAngle(const Standard_Integer Side) const
78{
79 if (Side == 1) return ((FairCurve_Batten*)MyBatten)->GetAngle1();
80 else return ((FairCurve_Batten*)MyBatten)->GetAngle2();
81}
82
83Standard_Real DrawFairCurve_Batten::GetSliding() const
84{
85 return ((FairCurve_Batten*)MyBatten)->GetSlidingFactor();
86}
87
88
89void DrawFairCurve_Batten::FreeSliding()
90{
91 ((FairCurve_Batten*)MyBatten)->SetFreeSliding(Standard_True);
92 Compute();
93}
94
95void DrawFairCurve_Batten::FreeAngle(const Standard_Integer Side)
96{
97 if (Side == 1) ((FairCurve_Batten*)MyBatten)->SetConstraintOrder1(0);
98 else ((FairCurve_Batten*)MyBatten)->SetConstraintOrder2(0);
99
100 Compute();
101}
102
103void DrawFairCurve_Batten::Dump(Standard_OStream& S)const
104{
105 GeomTools_Curve2dSet::PrintCurve2d(curv,S);
106 ((FairCurve_Batten*)MyBatten)->Dump(S);
107}