Logo ROOT   6.16/01
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#include "TGLPlotPainter.h"
16#include "TGLQuadric.h"
17#include "TGLUtil.h"
18#include "TString.h"
19
20class TGLPlotCamera;
21class TAxis;
22class TH1;
23
24/*
25 TGLLegoPainter. The concrete implementation of abstract TGLPlotPainter.
26*/
27
29private:
30
31 enum ELegoType {
35 };
36 //Bars, cylinders or textured bars.
39 Rgl::Range_t fMinMaxVal;//For texture coordinates generation.
40
41 std::vector<Rgl::Range_t> fXEdges;
42 std::vector<Rgl::Range_t> fYEdges;
43
44 typedef std::pair<Double_t, Double_t> CosSin_t;
45 std::vector<CosSin_t> fCosSinTableX;
46 std::vector<CosSin_t> fCosSinTableY;
50
52 mutable std::vector<Double_t> fColorLevels;
53
56
57public:
58 TGLLegoPainter(TH1 *hist, TGLPlotCamera *camera, TGLPlotCoordinates *coord);
59
60 //TGLPlotPainter's final-overriders
61 char *GetPlotInfo(Int_t px, Int_t py);
63 void StartPan(Int_t px, Int_t py);
64 void Pan(Int_t px, Int_t py);
65 void AddOption(const TString &stringOption);
66 void ProcessEvent(Int_t event, Int_t px, Int_t py);
67
68private:
69 //Auxilary functions.
74 //Overriders
75 void InitGL()const;
76 void DeInitGL()const;
77
78 void DrawPlot()const;
79
80 void DrawLegoCartesian()const;
81 void DrawLegoPolar()const;
82 void DrawLegoCylindrical()const;
83 void DrawLegoSpherical()const;
84
85 void SetLegoColor()const;
86
87 void DrawSectionXOZ()const;
88 void DrawSectionYOZ()const;
89 void DrawSectionXOY()const;
90
91 Bool_t ClampZ(Double_t &zVal)const;
93
94 void DrawPalette()const;
95 void DrawPaletteAxis()const;
96
97 ClassDef(TGLLegoPainter, 0)//Lego painter
98};
99
100#endif
int Int_t
Definition: RtypesCore.h:41
bool Bool_t
Definition: RtypesCore.h:59
double Double_t
Definition: RtypesCore.h:55
#define ClassDef(name, id)
Definition: Rtypes.h:324
Class to manage histogram axis.
Definition: TAxis.h:30
Plot-painter implementing LEGO rendering of TH2 histograms in cartesian, polar, cylindrical and spher...
Bool_t InitGeometryCartesian()
Geometry for lego in cartesian coords.
Bool_t PreparePalette() const
Initialize color palette.
void DrawLegoSpherical() const
Lego in spherical system.
std::vector< Rgl::Range_t > fXEdges
Bool_t InitGeometryCylindrical()
Geometry for lego in cylindrical coords.
void ProcessEvent(Int_t event, Int_t px, Int_t py)
Remove all sections and repaint.
TGLLevelPalette fPalette
void DrawLegoPolar() const
Lego in polar system.
void DrawSectionXOZ() const
XOZ plane parallel section.
Bool_t ClampZ(Double_t &zVal) const
Clamp z value.
void InitGL() const
Initialize some gl state variables.
Bool_t InitGeometrySpherical()
Geometry for lego in spherical coords.
TGLLegoPainter & operator=(const TGLLegoPainter &)
TGLQuadric fQuadric
TGLLegoPainter(const TGLLegoPainter &)
void DrawPalette() const
Draw.
void DrawSectionYOZ() const
YOZ plane parallel section.
void DrawLegoCartesian() const
Lego in cartesian system.
void SetLegoColor() const
Set lego's color.
Bool_t InitGeometry()
Select method.
void DrawSectionXOY() const
Empty. No such sections for lego.
void StartPan(Int_t px, Int_t py)
User clicks on a lego with middle mouse button (middle for pad).
std::vector< Rgl::Range_t > fYEdges
void DeInitGL() const
Return some gl states to original values.
std::vector< CosSin_t > fCosSinTableX
std::pair< Double_t, Double_t > CosSin_t
Rgl::Range_t fMinMaxVal
void DrawLegoCylindrical() const
Lego in cylindrical system.
char * GetPlotInfo(Int_t px, Int_t py)
Obtain bin's info (i, j, value).
std::vector< CosSin_t > fCosSinTableY
void DrawPlot() const
Select method corresponding to coordinate system.
Bool_t InitGeometryPolar()
Geometry for lego in polar coords.
ELegoType fLegoType
void AddOption(const TString &stringOption)
Parse additional options.
void DrawPaletteAxis() const
Draw. Palette. Axis.
std::vector< Double_t > fColorLevels
void Pan(Int_t px, Int_t py)
Move lego or section.
Camera for TGLPlotPainter and sub-classes.
Definition: TGLPlotCamera.h:22
Helper class for plot-painters holding information about axis ranges, numbers of bins and flags if ce...
Base class for plot-painters that provide GL rendering of various 2D and 3D histograms,...
Wrapper class for GLU quadric shape drawing object.
Definition: TGLQuadric.h:28
The TH1 histogram class.
Definition: TH1.h:56
Basic string class.
Definition: TString.h:131
std::pair< Double_t, Double_t > Range_t
Definition: TGLUtil.h:1193