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
25
26////////////////////////////////////////////////////////////////////////////////
27/// Constructor.
28
30{
31 // fDLCache = kFALSE; // Disable display list.
32}
33
34////////////////////////////////////////////////////////////////////////////////
35/// Set model object.
36
43
44////////////////////////////////////////////////////////////////////////////////
45/// Draw track with GL.
46
48{
49 // printf("TEveTrackProjectedGL::DirectDraw Style %d, LOD %d\n", flags.Style(), flags.LOD());
50 if (fM->Size() == 0)
51 return;
52
53 // lines
54 if (fM->fRnrLine)
55 {
58 Int_t start = 0;
59 Float_t* p = fM->GetP();
60 TGLUtil::LockColor(); // Keep color from TGLPhysicalShape.
61 for (std::vector<Int_t>::iterator bpi = fM->fBreakPoints.begin();
62 bpi != fM->fBreakPoints.end(); ++bpi)
63 {
64 Int_t size = *bpi - start;
66 p += 3*size;
67 start += size;
68 }
70 }
71
72 // markers on lines
73 if (fM->fRnrPoints)
74 {
76 fM->GetP(), fM->Size(),
77 rnrCtx.GetPickRadius(),
78 rnrCtx.Selection());
79 }
80
81 // break-points
82 if (fM->fBreakPoints.size() > 1 && fM->fPropagator->GetRnrPTBMarkers())
83 {
84 // Last break-point is last point on track, do not draw it.
85 Int_t nbp = fM->fBreakPoints.size() - 1;
87 Int_t nbptd = bmb ? 2*nbp : nbp;
88 std::vector<Float_t> pnts(3*nbptd);
89 Int_t n = 0;
90 for (Int_t i = 0; i < nbp; ++i, n+=3)
91 {
92 fM->GetPoint(fM->fBreakPoints[i] - 1, pnts[n], pnts[n+1], pnts[n+2]);
93 if (bmb)
94 {
95 n += 3;
96 fM->GetPoint(fM->fBreakPoints[i], pnts[n], pnts[n+1], pnts[n+2]);
97 }
98 }
100 &pnts[0], nbptd,
101 rnrCtx.GetPickRadius(),
102 rnrCtx.Selection());
103 }
104
106}
size_t size(const MatrixT &matrix)
retrieve the size of a square matrix
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
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
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.
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
static UInt_t LockColor()
Prevent further color changes.
Definition TGLUtil.cxx:1660
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:2243
static UInt_t UnlockColor()
Allow color changes.
Definition TGLUtil.cxx:1668
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: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