forked from JeffersonLab/EVe_HallC
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Road.cxx
79 lines (65 loc) · 1.42 KB
/
Road.cxx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
//*************************************************************************
// Road.cxx - 4/14/2008
//
// by miham
//
// This class handles roads in projection view
//
//
//
//*************************************************************************
#include "Road.h"
#include "TMath.h"
#include <cstring>
#include <cstdio>
#include <iostream>
#include <sstream>
#define DEBUG_LEVEL 0
using namespace std;
Road::Road(CStransform *cst)
{
transformation = cst;
for (int i = 0; i<5; i++)
{
ZZ[i] = 0;
XX[i] = 0;
}
pline = new TPolyLine(5,XX,ZZ);
pline->SetLineColor(kBlack);
pline->SetLineWidth(1);
#if DEBUG_LEVEL >= 3
cout<<"Road object created!!!"<<endl;
#endif
}
void Road::DrawMe(double *x, double *z)
{
for (int i = 0; i<4; i++)
{
ZZ[i] = transformation->transYtoCY(z[i]);
XX[i] = transformation->transXtoCX(x[i]);
}
ZZ[4] = ZZ[0];
XX[4] = XX[0];
pline->SetPolyLine(5,XX,ZZ);
pline->SetLineWidth(1);
pline->SetLineColor(kPink+8);
pline->SetFillColor(kPink+8);
pline->SetFillStyle( 3002 );
pline->Draw("f");
pline->Draw();
}
void Road::Clear()
{
for (int i = 0; i<5; i++)
{
ZZ[i] = 0.0;
XX[i] = 0.0;
}
pline->SetPolyLine(5,XX,ZZ);
pline->SetLineColor(kWhite);
pline->SetLineWidth(1);
pline->Draw();
}
Road::~Road()
{
}