ROOT  6.06/09
Reference Guide
TGLHistPainter.h
Go to the documentation of this file.
1 // @(#)root/gl:$Id$
2 // Author: Timur Pocheptsov 17/11/2005
3 
4 /*************************************************************************
5  * Copyright (C) 1995-2005, 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_TGLHistPainter
13 #define ROOT_TGLHistPainter
14 
15 #include <memory>
16 
17 #ifndef ROOT_TVirtualHistPainter
18 #include "TVirtualHistPainter.h"
19 #endif
20 #ifndef ROOT_TGLPlotPainter
21 #include "TGLPlotPainter.h"
22 #endif
23 #ifndef ROOT_TGLPlotCamera
24 #include "TGLPlotCamera.h"
25 #endif
26 
27 /*
28  TGLHistPainter is a proxy class. It inherits TVirtualHistPainter and
29  overrides its virtual functions, but all actual work is done by :
30  THistPainter - I name it "default" painter, it's the member of type
31  TVirtualHistPainter * and loaded via plugin-manager;
32  TGLLegoPainter - it draws different legos (lego/lego1/lego2/lego3);
33  TGLSurfacePainter - supports surfaces (surf/surf1/surf2/surf3/surf4/surf5);
34  TGLBoxPainter - box option for TH3;
35  TGLTF3Painter - TF3.
36 */
37 
39 class TGLTH3Composition;
40 class TGL5DDataSet;
41 class TString;
42 class TList;
43 class TF3;
44 class TH1;
45 
47 private:
48  //Dynamic type is THistPainter, no problems with simultaneous inheritance and membership
49  //TGLHistPainter delegates unsupported options/calls to this object
50  std::auto_ptr<TVirtualHistPainter> fDefaultPainter;
51  //This member can have different dynamic types: TGLLegoPainter, etc.
52  std::auto_ptr<TGLPlotPainter> fGLPainter;
53 
56  TF3 *fF3;
61 
62 public:
63  TGLHistPainter(TH1 *hist);
67 
68  //TVirtualHistPainter final overriders
70  void DrawPanel();
71  void ExecuteEvent(Int_t event, Int_t px, Int_t py);
72  TList *GetContourList(Double_t contour)const;
73  char *GetObjectInfo(Int_t px, Int_t py)const;
74  TList *GetStack()const;
77  void Paint(Option_t *option);
78  void PaintStat(Int_t dostat, TF1 *fit);
79  void ProcessMessage(const char *message, const TObject *obj);
80  void SetHistogram(TH1 *hist);
81  void SetStack(TList *stack);
82  Int_t MakeCuts(char *cutsOpt);
83  void SetShowProjection(const char *option, Int_t nbins);
84 
85  TGLPlotPainter *GetRealPainter(){return fGLPainter.get();}
86 private:
87 
88  struct PlotOption_t;
89 
90  PlotOption_t ParsePaintOption(const TString &option)const;
91  void CreatePainter(const PlotOption_t &parsed,
92  const TString &option);
93 
94  void PadToViewport(Bool_t selectionPass = kFALSE);
95 
98 
99  ClassDef(TGLHistPainter, 0) //Proxy class for GL hist painters.
100 };
101 
102 #endif
Camera for TGLPlotPainter and sub-classes.
Definition: TGLPlotCamera.h:21
void SetStack(TList *stack)
Set stack.
void CreatePainter(const PlotOption_t &parsed, const TString &option)
Create painter.
Bool_t IsInside(Int_t x, Int_t y)
Returns kTRUE if the cell ix, iy is inside one of the graphical cuts.
const char Option_t
Definition: RtypesCore.h:62
void SetHistogram(TH1 *hist)
Set histogram.
void DrawPanel()
Default implementation is OK This function is called from a context menu after right click on a plot'...
Basic string class.
Definition: TString.h:137
int Int_t
Definition: RtypesCore.h:41
bool Bool_t
Definition: RtypesCore.h:59
const Bool_t kFALSE
Definition: Rtypes.h:92
int nbins[3]
Int_t DistancetoPrimitive(Int_t px, Int_t py)
Selects plot or axis.
void Paint(Option_t *option)
Final-overrider for TObject::Paint.
Double_t x[n]
Definition: legend1.C:17
#define ClassDef(name, id)
Definition: Rtypes.h:254
Abstract interface to a histogram painter.
TGLPlotCoordinates fCoord
void PadToViewport(Bool_t selectionPass=kFALSE)
A doubly linked list.
Definition: TList.h:47
std::auto_ptr< TGLPlotPainter > fGLPainter
TGLParametricEquation * fEq
void ProcessMessage(const char *message, const TObject *obj)
Process message.
A 3-Dim function with parameters.
Definition: TF3.h:30
TGLHistPainter(TH1 *hist)
EGLPlotType fPlotType
TList * GetContourList(Double_t contour) const
Get contour list.
Helper class for plot-painters holding information about axis ranges, numbers of bins and flags if ce...
TList * GetStack() const
Get stack.
TGLHistPainter & operator=(const TGLHistPainter &)
char * GetObjectInfo(Int_t px, Int_t py) const
Overrides TObject::GetObjectInfo.
A parametric surface is a surface defined by a parametric equation, involving two parameters (u...
Definition: TGLParametric.h:43
Base class for plot-painters that provide GL rendering of various 2D and 3D histograms, functions and parametric surfaces.
TGLPlotPainter * GetRealPainter()
double Double_t
Definition: RtypesCore.h:55
TGLPlotCamera fCamera
Double_t y[n]
Definition: legend1.C:17
The TH1 histogram class.
Definition: TH1.h:80
PlotOption_t ParsePaintOption(const TString &option) const
In principle, we can have several conflicting options: "lego surf pol sph", surfbb: surf...
void SetShowProjection(const char *option, Int_t nbins)
Set show projection.
EGLPlotType
Definition: TGLUtil.h:53
The histogram painter class using OpenGL.
Mother of all ROOT objects.
Definition: TObject.h:58
std::auto_ptr< TVirtualHistPainter > fDefaultPainter
1-Dim function class
Definition: TF1.h:149
Int_t MakeCuts(char *cutsOpt)
Make cuts.
string message
Definition: ROOT.py:94
void ExecuteEvent(Int_t event, Int_t px, Int_t py)
Execute event.
TObject * obj
void PaintStat(Int_t dostat, TF1 *fit)
Paint statistics.