Logo ROOT  
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#include "TGLPlotPainter.h"
17#include "TGLQuadric.h"
18#include "TString.h"
19#include "TGLUtil.h"
20
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.
26class TPolyMarker3D;
27
28class TGLPlotCamera;
29class TAxis;
30class TH1;
31
33private:
37
38 enum EBoxType {
39 kBox, //boxes, sizes are proportional to bin content
40 kBox1 //spheres, not boxes
41 };
42
43 mutable EBoxType fType;
44
47
49
50 const TPolyMarker3D *fPolymarker; //Polymarker from TTree.
51 std::vector<Double_t> fPMPoints; //Cache for polymarker's points.
52
55
56public:
57 TGLBoxPainter(TH1 *hist, TGLPlotCamera *camera, TGLPlotCoordinates *coord);
58
60 TGLPlotCamera *camera, TGLPlotCoordinates *coord);
61
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);
68
69private:
70 //Overriders
71 void InitGL()const;
72 void DeInitGL()const;
73
74 void DrawPlot()const;
75 //Special type of TH3:
76 void DrawCloud()const;
77
78 void SetPlotColor()const;
79
80 void DrawSectionXOZ()const;
81 void DrawSectionYOZ()const;
82 void DrawSectionXOY()const;
83
84 void DrawPalette()const;
85 void DrawPaletteAxis()const;
86
87 Bool_t HasSections()const;
88
89 ClassDef(TGLBoxPainter, 0)//Box painter
90};
91
92#endif
int Int_t
Definition: RtypesCore.h:41
bool Bool_t
Definition: RtypesCore.h:59
#define ClassDef(name, id)
Definition: Rtypes.h:326
Class to manage histogram axis.
Definition: TAxis.h:30
Paints TH3 histograms by rendering variable-sized boxes matching the bin contents.
Definition: TGLBoxPainter.h:32
void StartPan(Int_t px, Int_t py)
User clicks right mouse button (in a pad).
EBoxType fType
Definition: TGLBoxPainter.h:43
void ProcessEvent(Int_t event, Int_t px, Int_t py)
Remove sections.
const TPolyMarker3D * fPolymarker
Definition: TGLBoxPainter.h:50
TGLTH3Slice fYOZSlice
Definition: TGLBoxPainter.h:35
Bool_t HasSections() const
Check, if any section exists.
TGLTH3Slice fXOZSlice
Definition: TGLBoxPainter.h:34
TGLBoxPainter & operator=(const TGLBoxPainter &)
char * GetPlotInfo(Int_t px, Int_t py)
Show box info (i, j, k, binContent).
TGLQuadric fQuadric
Definition: TGLBoxPainter.h:48
void DeInitGL() const
Return back some gl state variables.
std::vector< Double_t > fPMPoints
Definition: TGLBoxPainter.h:51
void DrawSectionXOZ() const
Draw XOZ parallel section.
void DrawSectionYOZ() const
Draw YOZ parallel section.
TString fPlotInfo
Definition: TGLBoxPainter.h:45
Rgl::Range_t fMinMaxVal
Definition: TGLBoxPainter.h:46
void SetPlotColor() const
Set boxes color.
TGLBoxPainter(const TGLBoxPainter &)
void DrawCloud() const
Draw a frame and a polymarker inside.
void Pan(Int_t px, Int_t py)
User's moving mouse cursor, with middle mouse button pressed (for pad).
void DrawPaletteAxis() const
Draw. Palette. Axis.
void InitGL() const
Initialize some gl state variables.
void DrawPlot() const
TGLTH3Slice fXOYSlice
Definition: TGLBoxPainter.h:36
void AddOption(const TString &stringOption)
Box1 == spheres.
void DrawPalette() const
Draw.
void DrawSectionXOY() const
Draw XOY parallel section.
Bool_t InitGeometry()
Set ranges, find min and max bin content.
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
A slice of a TH3.
The TH1 histogram class.
Definition: TH1.h:56
A 3D polymarker.
Definition: TPolyMarker3D.h:33
Basic string class.
Definition: TString.h:131
std::pair< Double_t, Double_t > Range_t
Definition: TGLUtil.h:1194