Logo ROOT   6.30.04
Reference Guide
 All Namespaces Files Pages
TEvePlot3DGL.cxx
Go to the documentation of this file.
1 // @(#)root/eve:$Id$
2 // Author: Matevz Tadel, 2009
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 "TEvePlot3DGL.h"
13 #include "TEvePlot3D.h"
14 #include "TGLPlot3D.h"
15 
16 #include "TGLRnrCtx.h"
17 #include "TGLIncludes.h"
18 
19 /** \class TEvePlot3DGL
20 \ingroup TEve
21 OpenGL renderer class for TEvePlot3D.
22 */
23 
24 ClassImp(TEvePlot3DGL);
25 
26 ////////////////////////////////////////////////////////////////////////////////
27 /// Constructor.
28 
29 TEvePlot3DGL::TEvePlot3DGL() :
30  TGLObject(), fM(0), fPlotLogical(0)
31 {
32  fDLCache = kFALSE; // Disable display list.
33 }
34 
35 ////////////////////////////////////////////////////////////////////////////////
36 /// Set model object.
37 
38 Bool_t TEvePlot3DGL::SetModel(TObject* obj, const Option_t* /*opt*/)
39 {
40  fM = SetModelDynCast<TEvePlot3D>(obj);
41  fPlotLogical = TGLPlot3D::CreatePlot(fM->fPlot, fM->fPlotOption, fM->fLogX, fM->fLogY, fM->fLogZ);
42  return kTRUE;
43 }
44 
45 ////////////////////////////////////////////////////////////////////////////////
46 /// Set bounding box.
47 
48 void TEvePlot3DGL::SetBBox()
49 {
50  // !! This ok if master sub-classed from TAttBBox
51  //SetAxisAlignedBBox(((TEvePlot3D*)fExternalObj)->AssertBBox());
52  fBoundingBox = fPlotLogical->BoundingBox();
53 }
54 
55 ////////////////////////////////////////////////////////////////////////////////
56 /// Render with OpenGL.
57 
58 void TEvePlot3DGL::DirectDraw(TGLRnrCtx & rnrCtx) const
59 {
60  // printf("TEvePlot3DGL::DirectDraw LOD %d\n", rnrCtx.CombiLOD());
61  if (fPlotLogical)
62  {
63  fPlotLogical->DirectDraw(rnrCtx);
64  }
65 }