Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
TEveTrackProjectedGL.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
13#include "TEveTrackProjected.h"
14#include "TEveTrackPropagator.h"
16
17#include "TGLIncludes.h"
18#include "TGLRnrCtx.h"
19
20/** \class TEveTrackProjectedGL
21\ingroup TEve
22GL-renderer for TEveTrackProjected class.
23*/
24
26
27////////////////////////////////////////////////////////////////////////////////
28/// Constructor.
29
31{
32 // fDLCache = kFALSE; // Disable display list.
33}
34
35////////////////////////////////////////////////////////////////////////////////
36/// Set model object.
37
39{
41 fM = DynCast<TEveTrackProjected>(obj);
42 return kTRUE;
43}
44
45////////////////////////////////////////////////////////////////////////////////
46/// Draw track with GL.
47
49{
50 // printf("TEveTrackProjectedGL::DirectDraw Style %d, LOD %d\n", flags.Style(), flags.LOD());
51 if (fM->Size() == 0)
52 return;
53
54 // lines
55 if (fM->fRnrLine)
56 {
57 TGLCapabilityEnabler sw_smooth(GL_LINE_SMOOTH, fM->fSmooth);
58 TGLCapabilityEnabler sw_blend(GL_BLEND, fM->fSmooth);
59 Int_t start = 0;
60 Float_t* p = fM->GetP();
61 TGLUtil::LockColor(); // Keep color from TGLPhysicalShape.
62 for (std::vector<Int_t>::iterator bpi = fM->fBreakPoints.begin();
63 bpi != fM->fBreakPoints.end(); ++bpi)
64 {
65 Int_t size = *bpi - start;
67 p += 3*size;
68 start += size;
69 }
71 }
72
73 // markers on lines
74 if (fM->fRnrPoints)
75 {
77 fM->GetP(), fM->Size(),
78 rnrCtx.GetPickRadius(),
79 rnrCtx.Selection());
80 }
81
82 // break-points
83 if (fM->fBreakPoints.size() > 1 && fM->fPropagator->GetRnrPTBMarkers())
84 {
85 // Last break-point is last point on track, do not draw it.
86 Int_t nbp = fM->fBreakPoints.size() - 1;
88 Int_t nbptd = bmb ? 2*nbp : nbp;
89 std::vector<Float_t> pnts(3*nbptd);
90 Int_t n = 0;
91 for (Int_t i = 0; i < nbp; ++i, n+=3)
92 {
93 fM->GetPoint(fM->fBreakPoints[i] - 1, pnts[n], pnts[n+1], pnts[n+2]);
94 if (bmb)
95 {
96 n += 3;
97 fM->GetPoint(fM->fBreakPoints[i], pnts[n], pnts[n+1], pnts[n+2]);
98 }
99 }
101 &pnts[0], nbptd,
102 rnrCtx.GetPickRadius(),
103 rnrCtx.Selection());
104 }
105
107}
size_t size(const MatrixT &matrix)
retrieve the size of a square matrix
float Float_t
Definition RtypesCore.h:57
constexpr Bool_t kTRUE
Definition RtypesCore.h:100
const char Option_t
Definition RtypesCore.h:66
#define ClassImp(name)
Definition Rtypes.h:377
winID h TVirtualViewer3D TVirtualGLPainter p
virtual Char_t GetMainTransparency() const
Bool_t fSmooth
Definition TEveLine.h:37
Bool_t fRnrLine
Definition TEveLine.h:35
Bool_t fRnrPoints
Definition TEveLine.h:36
GL-renderer for TEveTrack class.
Definition TEveTrackGL.h:23
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.
GL-renderer for TEveTrackProjected class.
TEveTrackProjected * fM
void DirectDraw(TGLRnrCtx &rnrCtx) const override
Draw track with GL.
Bool_t SetModel(TObject *obj, const Option_t *opt=nullptr) override
Set model object.
std::vector< Int_t > fBreakPoints
UChar_t GetProjTrackBreaking() const
Bool_t GetRnrPTBMarkers() const
TEveTrackPropagator * fPropagator
Last path-mark index tried in track-propagation.
Definition TEveTrack.h:64
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
static UInt_t LockColor()
Prevent further color changes.
Definition TGLUtil.cxx:1669
static void RenderPolyLine(const TAttLine &aline, Char_t transp, Float_t *p, Int_t n, Int_t pick_radius=0, Bool_t selection=kFALSE)
Render poly-line as specified by the p-array.
Definition TGLUtil.cxx:2252
static UInt_t UnlockColor()
Allow color changes.
Definition TGLUtil.cxx:1677
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:1980
Mother of all ROOT objects.
Definition TObject.h:41
virtual void GetPoint(Int_t n, Float_t &x, Float_t &y, Float_t &z) const
Fills the parameters x, y, z with the coordinate of the n-th point n must be between 0 and Size() - 1...
virtual Int_t Size() const
virtual Float_t * GetP() const
const Int_t n
Definition legend1.C:16