Logo ROOT   6.08/07
Reference Guide
TGLLegoPainter.h
Go to the documentation of this file.
1 // @(#)root/gl:$Id$
2 // Author: Timur Pocheptsov 14/06/2006
3 
4 /*************************************************************************
5  * Copyright (C) 1995-2004, 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 #ifndef ROOT_TGLLegoPainter
13 #define ROOT_TGLLegoPainter
14 
15 #ifndef ROOT_TGLPlotPainter
16 #include "TGLPlotPainter.h"
17 #endif
18 #ifndef ROOT_TGLQuadric
19 #include "TGLQuadric.h"
20 #endif
21 #ifndef ROOT_TGLUtil
22 #include "TGLUtil.h"
23 #endif
24 #ifndef ROOT_TString
25 #include "TString.h"
26 #endif
27 
28 class TGLPlotCamera;
29 class TAxis;
30 class TH1;
31 
32 /*
33  TGLLegoPainter. The concrete implementation of abstract TGLPlotPainter.
34 */
35 
37 private:
38 
39  enum ELegoType {
43  };
44  //Bars, cylinders or textured bars.
47  Rgl::Range_t fMinMaxVal;//For texture coordinates generation.
48 
49  std::vector<Rgl::Range_t> fXEdges;
50  std::vector<Rgl::Range_t> fYEdges;
51 
52  typedef std::pair<Double_t, Double_t> CosSin_t;
53  std::vector<CosSin_t> fCosSinTableX;
54  std::vector<CosSin_t> fCosSinTableY;
58 
60  mutable std::vector<Double_t> fColorLevels;
61 
64 
65 public:
66  TGLLegoPainter(TH1 *hist, TGLPlotCamera *camera, TGLPlotCoordinates *coord);
67 
68  //TGLPlotPainter's final-overriders
69  char *GetPlotInfo(Int_t px, Int_t py);
71  void StartPan(Int_t px, Int_t py);
72  void Pan(Int_t px, Int_t py);
73  void AddOption(const TString &stringOption);
74  void ProcessEvent(Int_t event, Int_t px, Int_t py);
75 
76 private:
77  //Auxilary functions.
82  //Overriders
83  void InitGL()const;
84  void DeInitGL()const;
85 
86  void DrawPlot()const;
87 
88  void DrawLegoCartesian()const;
89  void DrawLegoPolar()const;
90  void DrawLegoCylindrical()const;
91  void DrawLegoSpherical()const;
92 
93  void SetLegoColor()const;
94 
95  void DrawSectionXOZ()const;
96  void DrawSectionYOZ()const;
97  void DrawSectionXOY()const;
98 
99  Bool_t ClampZ(Double_t &zVal)const;
100  Bool_t PreparePalette()const;
101 
102  void DrawPalette()const;
103  void DrawPaletteAxis()const;
104 
105  ClassDef(TGLLegoPainter, 0)//Lego painter
106 };
107 
108 #endif
ELegoType fLegoType
Camera for TGLPlotPainter and sub-classes.
Definition: TGLPlotCamera.h:21
void DrawLegoSpherical() const
Lego in spherical system.
std::vector< Rgl::Range_t > fXEdges
Plot-painter implementing LEGO rendering of TH2 histograms in cartesian, polar, cylindrical and spher...
std::pair< Double_t, Double_t > Range_t
Definition: TGLUtil.h:1197
Rgl::Range_t fMinMaxVal
Bool_t InitGeometryCylindrical()
Geometry for lego in cylindrical coords.
Basic string class.
Definition: TString.h:137
int Int_t
Definition: RtypesCore.h:41
void DeInitGL() const
Return some gl states to original values.
void StartPan(Int_t px, Int_t py)
User clicks on a lego with middle mouse button (middle for pad).
void InitGL() const
Initialize some gl state variables.
bool Bool_t
Definition: RtypesCore.h:59
void ProcessEvent(Int_t event, Int_t px, Int_t py)
Remove all sections and repaint.
void AddOption(const TString &stringOption)
Parse additional options.
Wrapper class for GLU quadric shape drawing object.
Definition: TGLQuadric.h:29
std::vector< CosSin_t > fCosSinTableY
Bool_t InitGeometryPolar()
Geometry for lego in polar coords.
#define ClassDef(name, id)
Definition: Rtypes.h:254
void DrawSectionYOZ() const
YOZ plane parallel section.
void DrawPalette() const
Draw.
TGLLegoPainter(const TGLLegoPainter &)
std::vector< Double_t > fColorLevels
void SetLegoColor() const
Set lego&#39;s color.
void DrawLegoCylindrical() const
Lego in cylindrical system.
std::vector< CosSin_t > fCosSinTableX
Bool_t InitGeometry()
Select method.
void DrawLegoCartesian() const
Lego in cartesian system.
std::pair< Double_t, Double_t > CosSin_t
void DrawSectionXOY() const
Empty. No such sections for lego.
Class to manage histogram axis.
Definition: TAxis.h:36
Helper class for plot-painters holding information about axis ranges, numbers of bins and flags if ce...
char * GetPlotInfo(Int_t px, Int_t py)
Obtain bin&#39;s info (i, j, value).
Base class for plot-painters that provide GL rendering of various 2D and 3D histograms, functions and parametric surfaces.
void DrawLegoPolar() const
Lego in polar system.
double Double_t
Definition: RtypesCore.h:55
The TH1 histogram class.
Definition: TH1.h:80
Bool_t ClampZ(Double_t &zVal) const
Clamp z value.
std::vector< Rgl::Range_t > fYEdges
TGLLevelPalette fPalette
TGLLegoPainter & operator=(const TGLLegoPainter &)
Bool_t PreparePalette() const
Initialize color palette.
TGLQuadric fQuadric
Bool_t InitGeometrySpherical()
Geometry for lego in spherical coords.
void DrawPlot() const
Select method corresponding to coordinate system.
void DrawSectionXOZ() const
XOZ plane parallel section.
void Pan(Int_t px, Int_t py)
Move lego or section.
Bool_t InitGeometryCartesian()
Geometry for lego in cartesian coords.
void DrawPaletteAxis() const
Draw. Palette. Axis.