ROOT  6.06/09
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
20 GL-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 
46 void TEveLineGL::DirectDraw(TGLRnrCtx & rnrCtx) const
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);
58  }
60  if (q.fRnrPoints) {
61  TGLUtil::RenderPolyMarkers(q, 0,q.GetP(), q.Size(),
62  rnrCtx.GetPickRadius(),
63  rnrCtx.Selection());
64  }
65 }
The TGLRnrCtx class aggregates data for a given redering context as needed by various parts of the RO...
Definition: TGLRnrCtx.h:40
ClassImp(TEveLineGL)
Int_t GetPickRadius()
Return pick radius. If selection is not active it returns 0.
Definition: TGLRnrCtx.cxx:257
const char Option_t
Definition: RtypesCore.h:62
An arbitrary polyline with fixed line and marker attributes.
Definition: TEveLine.h:24
virtual Int_t Size() const
Definition: TPolyMarker3D.h:81
Bool_t Selection() const
Definition: TGLRnrCtx.h:222
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
static UInt_t LockColor()
Prevent further color changes.
Definition: TGLUtil.cxx:1630
static UInt_t UnlockColor()
Allow color changes.
Definition: TGLUtil.cxx:1638
virtual Float_t * GetP() const
Definition: TPolyMarker3D.h:67
Bool_t fSmooth
Definition: TEveLine.h:37
GL-renderer for TEveLine class.
Definition: TEveLineGL.h:23
TEveLine * fM
Definition: TEveLineGL.h:30
Bool_t fRnrLine
Definition: TEveLine.h:35
Bool_t fRnrPoints
Definition: TEveLine.h:36
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:2213
virtual void DirectDraw(TGLRnrCtx &rnrCtx) const
Direct GL rendering for TEveLine.
Definition: TEveLineGL.cxx:46
Bool_t fMultiColor
Definition: TGLObject.h:28
TEveLineGL()
Constructor.
Definition: TEveLineGL.cxx:28
Mother of all ROOT objects.
Definition: TObject.h:58
Direct OpenGL renderer for TPointSet3D.
Definition: TPointSet3DGL.h:22
virtual Char_t GetMainTransparency() const
Definition: TEveElement.h:279
const Bool_t kTRUE
Definition: Rtypes.h:91
float * q
Definition: THbookFile.cxx:87
TObject * obj