]> git.uio.no Git - u/mrichter/AliRoot.git/blame - EVE/Reve/FrameBoxGL.cxx
Missing initialization; fiddle with the track marker-style a bit more.
[u/mrichter/AliRoot.git] / EVE / Reve / FrameBoxGL.cxx
CommitLineData
b7a5b6f9 1// $Header$
2
3#include "FrameBoxGL.h"
4#include <Reve/FrameBox.h>
5
6#include <TGLDrawFlags.h>
7
8#ifdef WIN32
9#include "Windows4root.h"
10#endif
11#include <GL/gl.h>
12#include <GL/glu.h>
13
14using namespace Reve;
15
16//______________________________________________________________________
17// FrameBoxGL
18//
19// A class encapsulating GL rendering of Reve::FrameBox via a static
20// meber function.
21
22ClassImp(FrameBoxGL)
23
24void FrameBoxGL::Render(const FrameBox* box)
25{
26 GLboolean lightp;
27 glGetBooleanv(GL_LIGHTING, &lightp);
28 if (lightp) glDisable(GL_LIGHTING);
29
30 const FrameBox& b = *box;
31 const Float_t* p = b.fFramePoints;
32 glColor4ubv(b.fFrameRGBA);
33 if (b.fFrameType == FrameBox::FT_Quad)
34 {
35 glBegin(GL_LINE_LOOP);
36 glVertex3fv(p); glVertex3fv(p + 3);
37 glVertex3fv(p + 6); glVertex3fv(p + 9);
38 glEnd();
39 }
40 else if (b.fFrameType == FrameBox::FT_Box)
41 {
42 glBegin(GL_LINE_STRIP);
43 glVertex3fv(p); glVertex3fv(p + 3);
44 glVertex3fv(p + 6); glVertex3fv(p + 9);
45 glVertex3fv(p);
46 glVertex3fv(p + 12); glVertex3fv(p + 15);
47 glVertex3fv(p + 18); glVertex3fv(p + 21);
48 glVertex3fv(p + 12);
49 glEnd();
50 glBegin(GL_LINES);
51 glVertex3fv(p + 3); glVertex3fv(p + 15);
52 glVertex3fv(p + 6); glVertex3fv(p + 18);
53 glVertex3fv(p + 9); glVertex3fv(p + 21);
54 glEnd();
55 }
56
57 if (lightp) glEnable(GL_LIGHTING);
58}