Logo ROOT  
Reference Guide
TEveLineGL.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 "TEveLineGL.h"
13#include "TEveLine.h"
14
15#include "TGLRnrCtx.h"
16#include "TGLIncludes.h"
17
18/** \class TEveLineGL
19\ingroup TEve
20GL-renderer for TEveLine class.
21*/
22
24
25////////////////////////////////////////////////////////////////////////////////
26/// Constructor.
27
29{
30 // fDLCache = false; // Disable display list.
32}
33
34////////////////////////////////////////////////////////////////////////////////
35/// Set model object.
36
38{
39 fM = SetModelDynCast<TEveLine>(obj);
40 return kTRUE;
41}
42
43////////////////////////////////////////////////////////////////////////////////
44/// Direct GL rendering for TEveLine.
45
47{
48 // printf("TEveLineGL::DirectDraw Style %d, LOD %d\n", rnrCtx.Style(), rnrCtx.LOD());
49
50 TEveLine& q = *fM;
51 if (q.Size() <= 0) return;
52
53 TGLUtil::LockColor(); // Keep color from TGLPhysicalShape.
54 if (q.fRnrLine) {
55 TGLCapabilityEnabler sw_smooth(GL_LINE_SMOOTH, q.fSmooth);
56 TGLCapabilityEnabler sw_blend(GL_BLEND, q.fSmooth);
57 TGLUtil::RenderPolyLine(q, q.GetMainTransparency(), q.GetP(), q.Size());
58 }
60 if (q.fRnrPoints) {
61 TGLUtil::RenderPolyMarkers(q, 0,q.GetP(), q.Size(),
62 rnrCtx.GetPickRadius(),
63 rnrCtx.Selection());
64 }
65}
const Bool_t kTRUE
Definition: RtypesCore.h:89
const char Option_t
Definition: RtypesCore.h:64
#define ClassImp(name)
Definition: Rtypes.h:361
float * q
Definition: THbookFile.cxx:87
GL-renderer for TEveLine class.
Definition: TEveLineGL.h:24
virtual Bool_t SetModel(TObject *obj, const Option_t *opt=0)
Set model object.
Definition: TEveLineGL.cxx:37
TEveLine * fM
Definition: TEveLineGL.h:30
virtual void DirectDraw(TGLRnrCtx &rnrCtx) const
Direct GL rendering for TEveLine.
Definition: TEveLineGL.cxx:46
TEveLineGL()
Constructor.
Definition: TEveLineGL.cxx:28
An arbitrary polyline with fixed line and marker attributes.
Definition: TEveLine.h:26
Bool_t fMultiColor
Definition: TGLObject.h:28
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.
Definition: TGLRnrCtx.cxx:257
Bool_t Selection() const
Definition: TGLRnrCtx.h:222
static UInt_t LockColor()
Prevent further color changes.
Definition: TGLUtil.cxx:1664
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:2247
static UInt_t UnlockColor()
Allow color changes.
Definition: TGLUtil.cxx:1672
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:1975
Mother of all ROOT objects.
Definition: TObject.h:37
Direct OpenGL renderer for TPointSet3D.
Definition: TPointSet3DGL.h:21