4 #include <Reve/Track.h>
6 #include <TGLDrawFlags.h>
9 #include "Windows4root.h"
16 //______________________________________________________________________
22 TrackGL::TrackGL() : LineGL()
24 // fCached = false; // Disable display list.
30 /**************************************************************************/
32 Bool_t TrackGL::SetModel(TObject* obj)
34 if(LineGL::SetModel(obj) == kFALSE) return kFALSE;
35 if(SetModelCheckClass(obj, Track::Class())) {
36 fTrack = dynamic_cast<Track*>(obj);
41 /**************************************************************************/
43 void TrackGL::ProcessSelection(UInt_t* ptr, TGLViewer*, TGLScene*)
45 // Processes secondary selection from TGLViewer.
46 // Calls TPointSet3D::PointSelected(Int_t) with index of selected
47 // point as an argument.
50 printf("TrackGL::ProcessSelection %d names on the stack (z1=%g, z2=%g).\n",
51 n, Float_t(ptr[1])/0x7fffffff, Float_t(ptr[2])/0x7fffffff);
54 for (Int_t j=0; j<n; ++j, ++ptr) printf ("%d ", *ptr);
57 ((Track*)fM)->CtrlClicked((Track*)fM);
60 /**************************************************************************/
61 void TrackGL::DirectDraw(const TGLDrawFlags & flags) const
63 // Render line and path marks
65 LineGL::DirectDraw(flags);
67 if ( ! fTrack->fPathMarks.empty()){
69 TrackRnrStyle* rs = fTrack->GetRnrStyle();
70 Int_t style = rs->fPMStyle;
73 ColorFromIdx(rs->fPMColor, color);
76 glPushAttrib(GL_POINT_BIT | GL_LINE_BIT | GL_ENABLE_BIT);
77 glDisable(GL_LIGHTING);
79 Int_t ms = rs->fPMStyle;
81 if (ms != 2 && ms != 3 && ms != 5 && ms != 28)
83 Float_t size = 5*rs->fPMSize;
84 if (style == 4 || style == 20 || style == 24)
86 if (style == 4 || style == 24)
88 glEnable(GL_POINT_SMOOTH);
92 glDisable(GL_POINT_SMOOTH);
93 if (style == 1) size = 1;
94 else if (style == 6) size = 2;
95 else if (style == 7) size = 3;
101 std::vector<PathMark*>& pm = fTrack->fPathMarks;
102 for(std::vector<PathMark*>::iterator i=pm.begin(); i!=pm.end(); ++i)
107 case(PathMark::Daughter):
108 if(rs->fRnrDaughters) accept = kTRUE;
110 case(PathMark::Reference):
111 if(rs->fRnrReferences) accept = kTRUE;
113 case(PathMark::Decay):
114 if(rs->fRnrDecay) accept = kTRUE;
119 if((TMath::Abs((*i)->V.z) < rs->fMaxZ) && ((*i)->V.Perp() < rs->fMaxR))
120 glVertex3f((*i)->V.x, (*i)->V.y,(*i)->V.z);
124 } // end render points
131 glEnable(GL_LINE_SMOOTH);
136 glDisable(GL_LINE_SMOOTH);
141 Float_t d = 2* rs->fPMSize;
143 std::vector<PathMark*>& pm = fTrack->fPathMarks;
144 for(std::vector<PathMark*>::iterator i=pm.begin(); i!=pm.end(); ++i)
149 case(PathMark::Daughter):
150 if(rs->fRnrDaughters) accept = kTRUE;
152 case(PathMark::Reference):
153 if(rs->fRnrReferences) accept = kTRUE;
155 case(PathMark::Decay):
156 if(rs->fRnrDecay) accept = kTRUE;
161 if((TMath::Abs((*i)->V.z) < rs->fMaxZ) && ((*i)->V.Perp() < rs->fMaxR))
163 p[0] = (*i)->V.x; p[1] = (*i)->V.y; p[2] = (*i)->V.z;
164 glVertex3f(p[0]-d, p[1], p[2]); glVertex3f(p[0]+d, p[1], p[2]);
165 glVertex3f(p[0], p[1]-d, p[2]); glVertex3f(p[0], p[1]+d, p[2]);
166 glVertex3f(p[0], p[1], p[2]-d); glVertex3f(p[0], p[1], p[2]+d);
171 } // end render corsses