ROOT  6.07/01
Reference Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
TEveTrackGL.cxx
Go to the documentation of this file.
1 // @(#)root/eve:$Id$
2 // Authors: Matevz Tadel & Alja Mrak-Tadel: 2006, 2007
3 
4 /*************************************************************************
5  * Copyright (C) 1995-2007, Rene Brun and Fons Rademakers. *
6  * All rights reserved. *
7  * *
8  * For the licensing terms see $ROOTSYS/LICENSE. *
9  * For the list of contributors see $ROOTSYS/README/CREDITS. *
10  *************************************************************************/
11 
12 #include "TEveTrackGL.h"
13 #include "TEveTrack.h"
14 #include "TEveTrackPropagator.h"
15 
16 #include "TGLIncludes.h"
17 #include "TGLRnrCtx.h"
18 #include "TGLSelectRecord.h"
19 
20 /** \class TEveTrackGL
21 \ingroup TEve
22 GL-renderer for TEveTrack class.
23 */
24 
26 
27 ////////////////////////////////////////////////////////////////////////////////
28 /// Default constructor.
29 
31 {
32  // fDLCache = false; // Disable display list.
33 }
34 
35 ////////////////////////////////////////////////////////////////////////////////
36 /// Set model object.
37 
39 {
41  fTrack = DynCast<TEveTrack>(obj);
42  return kTRUE;
43 }
44 
45 ////////////////////////////////////////////////////////////////////////////////
46 /// Processes secondary selection from TGLViewer.
47 /// Just calls SecSelected(track) in model object which emits a signal.
48 /// This is used in user code for alternate selection of good / bad tracks.
49 
51 {
52  if (gDebug > 0)
53  {
54  printf("TEveTrackGL::ProcessSelection %d names on the stack (z1=%g, z2=%g).\n",
55  rec.GetN(), rec.GetMinZ(), rec.GetMaxZ());
56  printf(" Names: ");
57  for (Int_t j=0; j<rec.GetN(); ++j) printf ("%d ", rec.GetItem(j));
58  printf("\n");
59  }
60 
62 }
63 
64 ////////////////////////////////////////////////////////////////////////////////
65 /// GL rendering code.
66 /// Virtual from TGLLogicalShape.
67 
68 void TEveTrackGL::DirectDraw(TGLRnrCtx & rnrCtx) const
69 {
70  TEveLineGL::DirectDraw(rnrCtx);
71 
73 }
74 
75 ////////////////////////////////////////////////////////////////////////////////
76 /// Render path-marks and the first vertex, if required.
77 
79 {
82  if ( ! pms.empty())
83  {
84  Float_t *pnts = new Float_t[3*pms.size()]; // maximum
85  Int_t cnt = 0;
86  Int_t n = 0;
87  for (Int_t i = 0; i < fTrack->fLastPMIdx; ++i)
88  {
89  const TEvePathMarkD &pm = pms[i];
90  if ((pm.fType == TEvePathMarkD::kDaughter && rTP.GetRnrDaughters()) ||
92  (pm.fType == TEvePathMarkD::kDecay && rTP.GetRnrDecay()) ||
94  {
95  pnts[n ] = pm.fV.fX;
96  pnts[n+1] = pm.fV.fY;
97  pnts[n+2] = pm.fV.fZ;
98  n += 3;
99  ++cnt;
100  }
101  }
102  TGLUtil::RenderPolyMarkers(rTP.RefPMAtt(), 0, pnts, cnt,
103  rnrCtx.GetPickRadius(),
104  rnrCtx.Selection());
105  delete [] pnts;
106  }
107 
108  // fist vertex
109  if (rTP.GetRnrFV() && fTrack->GetLastPoint())
111  rnrCtx.GetPickRadius(),
112  rnrCtx.Selection());
113 }
Bool_t GetRnrFV() const
TEveTrackPropagator * GetPropagator() const
Definition: TEveTrack.h:84
The TGLRnrCtx class aggregates data for a given redering context as needed by various parts of the RO...
Definition: TGLRnrCtx.h:40
Int_t fLastPMIdx
Definition: TEveTrack.h:62
Int_t GetPickRadius()
Return pick radius. If selection is not active it returns 0.
Definition: TGLRnrCtx.cxx:257
EType_e fType
Definition: TEvePathMark.h:27
Bool_t GetRnrDecay() const
Bool_t GetRnrCluster2Ds() const
void RenderPathMarksAndFirstVertex(TGLRnrCtx &rnrCtx) const
Render path-marks and the first vertex, if required.
Definition: TEveTrackGL.cxx:78
Float_t GetMinZ() const
float Float_t
Definition: RtypesCore.h:53
const char Option_t
Definition: RtypesCore.h:62
TEveVectorT< TT > fV
Definition: TEvePathMark.h:28
Bool_t Selection() const
Definition: TGLRnrCtx.h:222
TEveTrackGL()
Default constructor.
Definition: TEveTrackGL.cxx:30
vPathMark_t & RefPathMarks()
Definition: TEveTrack.h:111
int Int_t
Definition: RtypesCore.h:41
bool Bool_t
Definition: RtypesCore.h:59
static void RenderPolyMarkers(const TAttMarker &marker, Char_t transp, Float_t *p, Int_t n, Int_t pick_radius=0, Bool_t selection=kFALSE, Bool_t sec_selection=kFALSE)
Render polymarkers at points specified by p-array.
Definition: TGLUtil.cxx:1941
virtual Bool_t SetModel(TObject *obj, const Option_t *opt=0)
Set model object.
Definition: TEveLineGL.cxx:37
ClassImp(TEveTrackGL)
virtual Bool_t SetModel(TObject *obj, const Option_t *opt=0)
Set model object.
Definition: TEveTrackGL.cxx:38
virtual Float_t * GetP() const
Definition: TPolyMarker3D.h:67
Float_t GetMaxZ() const
GL-renderer for TEveLine class.
Definition: TEveLineGL.h:23
Special-point on track:
Definition: TEvePathMark.h:22
Bool_t GetRnrReferences() const
Standard selection record including information about containing scene and details ob out selected ob...
std::vector< TEvePathMarkD > vPathMark_t
Definition: TEveTrack.h:42
Bool_t GetRnrDaughters() const
virtual void SecSelected(TEveTrack *)
Emits "SecSelected(TEveTrack*)" signal.
Definition: TEveTrack.cxx:548
GL-renderer for TEveTrack class.
Definition: TEveTrackGL.h:22
Holding structure for a number of track rendering parameters.
UInt_t GetItem(Int_t i) const
ClassImp(TMCParticle) void TMCParticle printf(": p=(%7.3f,%7.3f,%9.3f) ;", fPx, fPy, fPz)
virtual void DirectDraw(TGLRnrCtx &rnrCtx) const
GL rendering code.
Definition: TEveTrackGL.cxx:68
virtual void DirectDraw(TGLRnrCtx &rnrCtx) const
Direct GL rendering for TEveLine.
Definition: TEveLineGL.cxx:46
Mother of all ROOT objects.
Definition: TObject.h:58
virtual void ProcessSelection(TGLRnrCtx &rnrCtx, TGLSelectRecord &rec)
Processes secondary selection from TGLViewer.
Definition: TEveTrackGL.cxx:50
TEveTrack * fTrack
Definition: TEveTrackGL.h:29
R__EXTERN Int_t gDebug
Definition: Rtypes.h:128
const Bool_t kTRUE
Definition: Rtypes.h:91
TObject * obj
const Int_t n
Definition: legend1.C:16
Int_t GetN() const
const char * cnt
Definition: TXMLSetup.cxx:75
virtual Int_t GetLastPoint() const
Definition: TPolyMarker3D.h:64