ROOT  6.06/09
Reference Guide
TGLBoxPainter.h
Go to the documentation of this file.
1 // @(#)root/gl:$Id$
2 // Author: Timur Pocheptsov 31/08/2006
3 
4 /*************************************************************************
5  * Copyright (C) 1995-2006, 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 #ifndef ROOT_TGLBoxPainter
12 #define ROOT_TGLBoxPainter
13 
14 #include <vector>
15 
16 #ifndef ROOT_TGLPlotPainter
17 #include "TGLPlotPainter.h"
18 #endif
19 #ifndef ROOT_TGLQuadric
20 #include "TGLQuadric.h"
21 #endif
22 #ifndef ROOT_TString
23 #include "TString.h"
24 #endif
25 #ifndef ROOT_TGLUtil
26 #include "TGLUtil.h"
27 #endif
28 
29 //TGLScenePad creates box painter
30 //for the case TPad has poly marker and
31 //empty TH3 inside.
32 //Now it's up to box painter to do everything
33 //correctly.
34 class TPolyMarker3D;
35 
36 class TGLPlotCamera;
37 class TAxis;
38 class TH1;
39 
40 class TGLBoxPainter : public TGLPlotPainter {
41 private:
45 
46  enum EBoxType {
47  kBox, //boxes, sizes are proportional to bin content
48  kBox1 //spheres, not boxes
49  };
50 
51  mutable EBoxType fType;
52 
55 
57 
58  const TPolyMarker3D *fPolymarker; //Polymarker from TTree.
59  std::vector<Double_t> fPMPoints; //Cache for polymarker's points.
60 
63 
64 public:
65  TGLBoxPainter(TH1 *hist, TGLPlotCamera *camera, TGLPlotCoordinates *coord);
66 
67  TGLBoxPainter(TH1 *hist, TPolyMarker3D * pm,
68  TGLPlotCamera *camera, TGLPlotCoordinates *coord);
69 
70  char *GetPlotInfo(Int_t px, Int_t py);
72  void StartPan(Int_t px, Int_t py);
73  void Pan(Int_t px, Int_t py);
74  void AddOption(const TString &stringOption);
75  void ProcessEvent(Int_t event, Int_t px, Int_t py);
76 
77 private:
78  //Overriders
79  void InitGL()const;
80  void DeInitGL()const;
81 
82  void DrawPlot()const;
83  //Special type of TH3:
84  void DrawCloud()const;
85 
86  void SetPlotColor()const;
87 
88  void DrawSectionXOZ()const;
89  void DrawSectionYOZ()const;
90  void DrawSectionXOY()const;
91 
92  void DrawPalette()const;
93  void DrawPaletteAxis()const;
94 
95  Bool_t HasSections()const;
96 
97  ClassDef(TGLBoxPainter, 0)//Box painter
98 };
99 
100 #endif
EBoxType fType
Definition: TGLBoxPainter.h:51
Camera for TGLPlotPainter and sub-classes.
Definition: TGLPlotCamera.h:21
TGLBoxPainter(const TGLBoxPainter &)
void StartPan(Int_t px, Int_t py)
User clicks right mouse button (in a pad).
std::pair< Double_t, Double_t > Range_t
Definition: TGLUtil.h:1197
Basic string class.
Definition: TString.h:137
int Int_t
Definition: RtypesCore.h:41
bool Bool_t
Definition: RtypesCore.h:59
TGLTH3Slice fXOZSlice
Definition: TGLBoxPainter.h:42
void DeInitGL() const
Return back some gl state variables.
void DrawPalette() const
Draw.
Wrapper class for GLU quadric shape drawing object.
Definition: TGLQuadric.h:29
std::vector< Double_t > fPMPoints
Definition: TGLBoxPainter.h:59
A slice of a TH3.
Paints TH3 histograms by rendering variable-sized boxes matching the bin contents.
Definition: TGLBoxPainter.h:40
void DrawSectionXOY() const
Draw XOY parallel section.
void ProcessEvent(Int_t event, Int_t px, Int_t py)
Remove sections.
Bool_t InitGeometry()
Set ranges, find min and max bin content.
void DrawSectionYOZ() const
Draw YOZ parallel section.
void AddOption(const TString &stringOption)
Box1 == spheres.
const TPolyMarker3D * fPolymarker
Definition: TGLBoxPainter.h:58
Bool_t HasSections() const
Check, if any section exists.
void DrawCloud() const
Draw a frame and a polymarker inside.
void DrawPlot() const
Class to manage histogram axis.
Definition: TAxis.h:36
ClassDef(TVirtualGLPainter, 0)
Helper class for plot-painters holding information about axis ranges, numbers of bins and flags if ce...
void DrawPaletteAxis() const
Draw. Palette. Axis.
Base class for plot-painters that provide GL rendering of various 2D and 3D histograms, functions and parametric surfaces.
char * GetPlotInfo(Int_t px, Int_t py)
Show box info (i, j, k, binContent).
TString fPlotInfo
Definition: TGLBoxPainter.h:53
Rgl::Range_t fMinMaxVal
Definition: TGLBoxPainter.h:54
void Pan(Int_t px, Int_t py)
User's moving mouse cursor, with middle mouse button pressed (for pad).
TGLTH3Slice fYOZSlice
Definition: TGLBoxPainter.h:43
void DrawSectionXOZ() const
Draw XOZ parallel section.
TGLQuadric fQuadric
Definition: TGLBoxPainter.h:56
The TH1 histogram class.
Definition: TH1.h:80
TGLBoxPainter & operator=(const TGLBoxPainter &)
A 3D polymarker.
Definition: TPolyMarker3D.h:40
void SetPlotColor() const
Set boxes color.
TGLTH3Slice fXOYSlice
Definition: TGLBoxPainter.h:44
void InitGL() const
Initialize some gl state variables.