Logo ROOT  
Reference Guide
Loading...
Searching...
No Matches
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
22GL-renderer for TEveTrack class.
23*/
24
25
26////////////////////////////////////////////////////////////////////////////////
27/// Default constructor.
28
30{
31 // fDLCache = false; // Disable display list.
32}
33
34////////////////////////////////////////////////////////////////////////////////
35/// Set model object.
36
38{
41 return kTRUE;
42}
43
44////////////////////////////////////////////////////////////////////////////////
45/// Processes secondary selection from TGLViewer.
46/// Just calls SecSelected(track) in model object which emits a signal.
47/// This is used in user code for alternate selection of good / bad tracks.
48
50{
51 if (gDebug > 0)
52 {
53 printf("TEveTrackGL::ProcessSelection %d names on the stack (z1=%g, z2=%g).\n",
54 rec.GetN(), rec.GetMinZ(), rec.GetMaxZ());
55 printf(" Names: ");
56 for (Int_t j=0; j<rec.GetN(); ++j) printf ("%d ", rec.GetItem(j));
57 printf("\n");
58 }
59
60 fTrack->SecSelected(fTrack);
61}
62
63////////////////////////////////////////////////////////////////////////////////
64/// GL rendering code.
65/// Virtual from TGLLogicalShape.
66
68{
70
72}
73
74////////////////////////////////////////////////////////////////////////////////
75/// Render path-marks and the first vertex, if required.
76
78{
79 TEveTrackPropagator &rTP = *fTrack->GetPropagator();
80 const TEveTrack::vPathMark_t &pms = fTrack->RefPathMarks();
81 if ( ! pms.empty())
82 {
83 Float_t *pnts = new Float_t[3*pms.size()]; // maximum
84 Int_t cnt = 0;
85 Int_t n = 0;
86 for (Int_t i = 0; i < fTrack->fLastPMIdx; ++i)
87 {
88 const TEvePathMarkD &pm = pms[i];
89 if ((pm.fType == TEvePathMarkD::kDaughter && rTP.GetRnrDaughters()) ||
91 (pm.fType == TEvePathMarkD::kDecay && rTP.GetRnrDecay()) ||
93 {
94 pnts[n ] = pm.fV.fX;
95 pnts[n+1] = pm.fV.fY;
96 pnts[n+2] = pm.fV.fZ;
97 n += 3;
98 ++cnt;
99 }
100 }
101 TGLUtil::RenderPolyMarkers(rTP.RefPMAtt(), 0, pnts, cnt,
102 rnrCtx.GetPickRadius(),
103 rnrCtx.Selection());
104 delete [] pnts;
105 }
106
107 // fist vertex
108 if (rTP.GetRnrFV() && fTrack->GetLastPoint())
109 TGLUtil::RenderPolyMarkers(rTP.RefFVAtt(), 0, fTrack->GetP(), 1,
110 rnrCtx.GetPickRadius(),
111 rnrCtx.Selection());
112}
int Int_t
Signed integer 4 bytes (int).
Definition RtypesCore.h:59
bool Bool_t
Boolean (0=false, 1=true) (bool).
Definition RtypesCore.h:77
float Float_t
Float 4 bytes (float).
Definition RtypesCore.h:71
constexpr Bool_t kTRUE
Definition RtypesCore.h:107
const char Option_t
Option string (const char).
Definition RtypesCore.h:80
TEvePathMarkT< Double_t > TEvePathMarkD
Int_t gDebug
Definition TROOT.cxx:777
void DirectDraw(TGLRnrCtx &rnrCtx) const override
Direct GL rendering for TEveLine.
Bool_t SetModel(TObject *obj, const Option_t *opt=nullptr) override
Set model object.
TEveLineGL(const TEveLineGL &)
TEveVectorT< TT > fV
TEveTrackGL()
Default constructor.
void RenderPathMarksAndFirstVertex(TGLRnrCtx &rnrCtx) const
Render path-marks and the first vertex, if required.
Bool_t SetModel(TObject *obj, const Option_t *opt=nullptr) override
Set model object.
void ProcessSelection(TGLRnrCtx &rnrCtx, TGLSelectRecord &rec) override
Processes secondary selection from TGLViewer.
TEveTrack * fTrack
Definition TEveTrackGL.h:29
void DirectDraw(TGLRnrCtx &rnrCtx) const override
GL rendering code.
Holding structure for a number of track rendering parameters.
Bool_t GetRnrDaughters() const
Bool_t GetRnrCluster2Ds() const
Bool_t GetRnrReferences() const
std::vector< TEvePathMarkD > vPathMark_t
Definition TEveTrack.h:42
TT * DynCast(TObject *obj)
Definition TGLObject.h:45
The TGLRnrCtx class aggregates data for a given redering context as needed by various parts of the RO...
Definition TGLRnrCtx.h:41
Int_t GetPickRadius()
Return pick radius. If selection is not active it returns 0.
Bool_t Selection() const
Definition TGLRnrCtx.h:222
Float_t GetMinZ() const
UInt_t GetItem(Int_t i) const
Float_t GetMaxZ() const
Standard selection record including information about containing scene and details ob out selected ob...
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:1971
Mother of all ROOT objects.
Definition TObject.h:42
const Int_t n
Definition legend1.C:16