45 |
struct LineConnector { |
struct LineConnector { |
46 |
enum { NTrans = 2 }; |
enum { NTrans = 2 }; |
47 |
|
|
48 |
|
float px0, py0, px1, py1; |
49 |
|
|
50 |
template<class F> void params(F &f) { |
template<class F> void params(F &f) { |
51 |
|
f(px0, py0, px1, py1); |
52 |
} |
} |
53 |
|
|
54 |
template<class T> void render(const T &t0, const T &t1) const { |
template<class T> void render(const T &t0, const T &t1) const { |
55 |
|
Pt box0 = t0.getSqSize(); |
56 |
|
Pt box1 = t1.getSqSize(); |
57 |
|
|
58 |
glBegin(GL_LINES); |
glBegin(GL_LINES); |
59 |
t0.vertex(ZPt(0,0,0)); |
t0.vertex(ZPt(box0.x*px0,box0.y*py0,0)); |
60 |
t1.vertex(ZPt(0,0,0)); |
t1.vertex(ZPt(box1.x*px1,box1.y*py1,0)); |
61 |
glEnd(); |
glEnd(); |
62 |
} |
} |
63 |
}; |
}; |