Logo ROOT  
Reference Guide
TGLTH3Composition.h
Go to the documentation of this file.
1// @(#)root/gl:$Id$
2// Author: Timur Pocheptsov 07/08/2009
3
4#ifndef ROOT_TGLTH3Composition
5#define ROOT_TGLTH3Composition
6
7#include <utility>
8#include <memory>
9#include <vector>
10
11#include "TGLHistPainter.h"
12#include "TGLPlotPainter.h"
13#include "TGLQuadric.h"
14#include "TH3.h"
15
16//
17//Composition of TH3 objects. All TH3 must have the same axis range
18//and the same number of bins. If this condition is violated,
19//AddTH3 will throw.
20//IMPORTANT: TGLTH3Composition does not own TH3 objects
21//it contains.
22//This class inherits TH3 - to re-use TH3 editor.
23//I use TH3C to reduce memory usage.
24//Slising is not implemeted yet.
25//
26
27class TGLTH3Composition : public TH3C {
29public:
30 TGLTH3Composition();//I need it only because of explicit private copy ctor.
31
35 };
36
37 void AddTH3(const TH3 *hist, ETH3BinShape shape = kBox);
38
39 //These are functions for TPad and
40 //TPad's standard machinery (picking, painting).
42 void ExecuteEvent(Int_t event, Int_t px, Int_t py);
43 char *GetObjectInfo(Int_t px, Int_t py) const;
44 void Paint(Option_t *option);
45
46private:
47 void CheckRanges(const TH3 *hist);
48
49 typedef std::pair<const TH3 *, ETH3BinShape> TH3Pair_t;
50
51 std::vector<TH3Pair_t> fHists;
52 std::unique_ptr<TGLHistPainter> fPainter;
53
56
57 ClassDef(TGLTH3Composition, 0)//Composition of TH3 objects.
58};
59
60//
61//TGLTH3CompositionPainter class.
62//
64public:
66 TGLPlotCoordinates *coord);
67
68 //TGLPlotPainter 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 &option);
74 void ProcessEvent(Int_t event, Int_t px, Int_t py);
75
76private:
77 //TGLPlotPainter final-overriders.
78 void InitGL()const;
79 void DeInitGL()const;
80
81 void DrawPlot()const;
82
83 //Empty overriders.
84 void DrawSectionXOZ()const{}
85 void DrawSectionYOZ()const{}
86 void DrawSectionXOY()const{}
87
88 void SetColor(Int_t color)const;
89
91 std::pair<Double_t, Double_t> fMinMaxVal;
92
94
97
98 ClassDef(TGLTH3CompositionPainter, 0)//Painter to draw several TH3.
99};
100
101
102#endif
int Int_t
Definition: RtypesCore.h:43
const char Option_t
Definition: RtypesCore.h:64
#define ClassDef(name, id)
Definition: Rtypes.h:322
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
void InitGL() const
Initialize some gl state variables.
void DeInitGL() const
Return back some gl state variables.
void AddOption(const TString &option)
No options for composition.
TGLTH3Composition * fData
std::pair< Double_t, Double_t > fMinMaxVal
void DrawPlot() const
Draw composition of TH3s.
void SetColor(Int_t color) const
Set material.
void Pan(Int_t px, Int_t py)
User's moving mouse cursor, with middle mouse button pressed (for pad).
TGLTH3CompositionPainter & operator=(const TGLTH3CompositionPainter &rhs)
TGLTH3CompositionPainter(const TGLTH3CompositionPainter &rhs)
void StartPan(Int_t px, Int_t py)
Move plot or box cut.
char * GetPlotInfo(Int_t px, Int_t py)
Will be never called from TPad.
void ProcessEvent(Int_t event, Int_t px, Int_t py)
Switch on/off box cut.
TGLTH3CompositionPainter(TGLTH3Composition *data, TGLPlotCamera *camera, TGLPlotCoordinates *coord)
Ctor.
TGLTH3Composition(const TGLTH3Composition &rhs)
void AddTH3(const TH3 *hist, ETH3BinShape shape=kBox)
Add TH3 into collection.
void ExecuteEvent(Int_t event, Int_t px, Int_t py)
Mouse and keyboard events.
std::vector< TH3Pair_t > fHists
TGLTH3Composition()
I have to define it, since explicit copy ctor was declared.
TGLTH3Composition & operator=(const TGLTH3Composition &)
std::pair< const TH3 *, ETH3BinShape > TH3Pair_t
Int_t DistancetoPrimitive(Int_t px, Int_t py)
Check if "this" is under cursor.
void Paint(Option_t *option)
Paint a composition of 3d hists.
std::unique_ptr< TGLHistPainter > fPainter
void CheckRanges(const TH3 *hist)
char * GetObjectInfo(Int_t px, Int_t py) const
I cannot show bin content in a status bar - since there can be several bins in one.
3-D histogram with a byte per channel (see TH1 documentation)
Definition: TH3.h:158
The 3-D histogram classes derived from the 1-D histogram classes.
Definition: TH3.h:31
Basic string class.
Definition: TString.h:131