Logo ROOT   6.14/05
Reference Guide
Go to the documentation of this file.
1 // @(#)root/gl:$Id$
2 // Author: Timur Pocheptsov 31/08/2006
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
14 #include <vector>
16 #include "TGLPlotPainter.h"
17 #include "TGLQuadric.h"
18 #include "TString.h"
19 #include "TGLUtil.h"
21 //TGLScenePad creates box painter
22 //for the case TPad has poly marker and
23 //empty TH3 inside.
24 //Now it's up to box painter to do everything
25 //correctly.
26 class TPolyMarker3D;
28 class TGLPlotCamera;
29 class TAxis;
30 class TH1;
32 class TGLBoxPainter : public TGLPlotPainter {
33 private:
38  enum EBoxType {
39  kBox, //boxes, sizes are proportional to bin content
40  kBox1 //spheres, not boxes
41  };
43  mutable EBoxType fType;
50  const TPolyMarker3D *fPolymarker; //Polymarker from TTree.
51  std::vector<Double_t> fPMPoints; //Cache for polymarker's points.
56 public:
57  TGLBoxPainter(TH1 *hist, TGLPlotCamera *camera, TGLPlotCoordinates *coord);
59  TGLBoxPainter(TH1 *hist, TPolyMarker3D * pm,
60  TGLPlotCamera *camera, TGLPlotCoordinates *coord);
62  char *GetPlotInfo(Int_t px, Int_t py);
64  void StartPan(Int_t px, Int_t py);
65  void Pan(Int_t px, Int_t py);
66  void AddOption(const TString &stringOption);
67  void ProcessEvent(Int_t event, Int_t px, Int_t py);
69 private:
70  //Overriders
71  void InitGL()const;
72  void DeInitGL()const;
74  void DrawPlot()const;
75  //Special type of TH3:
76  void DrawCloud()const;
78  void SetPlotColor()const;
80  void DrawSectionXOZ()const;
81  void DrawSectionYOZ()const;
82  void DrawSectionXOY()const;
84  void DrawPalette()const;
85  void DrawPaletteAxis()const;
87  Bool_t HasSections()const;
89  ClassDef(TGLBoxPainter, 0)//Box painter
90 };
92 #endif
EBoxType fType
Definition: TGLBoxPainter.h:43
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:1193
Basic string class.
Definition: TString.h:131
void DrawCloud() const
Draw a frame and a polymarker inside.
int Int_t
Definition: RtypesCore.h:41
bool Bool_t
Definition: RtypesCore.h:59
void DrawSectionXOZ() const
Draw XOZ parallel section.
TGLTH3Slice fXOZSlice
Definition: TGLBoxPainter.h:34
Wrapper class for GLU quadric shape drawing object.
Definition: TGLQuadric.h:27
std::vector< Double_t > fPMPoints
Definition: TGLBoxPainter.h:51
void DrawPalette() const
A slice of a TH3.
void DrawPlot() const
Paints TH3 histograms by rendering variable-sized boxes matching the bin contents.
Definition: TGLBoxPainter.h:32
#define ClassDef(name, id)
Definition: Rtypes.h:320
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 AddOption(const TString &stringOption)
Box1 == spheres.
void DrawSectionXOY() const
Draw XOY parallel section.
const TPolyMarker3D * fPolymarker
Definition: TGLBoxPainter.h:50
void DrawPaletteAxis() const
Draw. Palette. Axis.
Class to manage histogram axis.
Definition: TAxis.h:30
Helper class for plot-painters holding information about axis ranges, numbers of bins and flags if ce...
void DrawSectionYOZ() const
Draw YOZ parallel section.
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:45
Rgl::Range_t fMinMaxVal
Definition: TGLBoxPainter.h:46
void DeInitGL() const
Return back some gl state variables.
void Pan(Int_t px, Int_t py)
User&#39;s moving mouse cursor, with middle mouse button pressed (for pad).
TGLTH3Slice fYOZSlice
Definition: TGLBoxPainter.h:35
void InitGL() const
Initialize some gl state variables.
TGLQuadric fQuadric
Definition: TGLBoxPainter.h:48
void SetPlotColor() const
Set boxes color.
The TH1 histogram class.
Definition: TH1.h:56
TGLBoxPainter & operator=(const TGLBoxPainter &)
A 3D polymarker.
Definition: TPolyMarker3D.h:32
Bool_t HasSections() const
Check, if any section exists.
TGLTH3Slice fXOYSlice
Definition: TGLBoxPainter.h:36