Logo ROOT   6.14/05
Reference Guide
Go to the documentation of this file.
1 // @(#)root/gl:$Id$
2 // Author: Timur Pocheptsov 17/11/2005
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  *************************************************************************/
12 #ifndef ROOT_TGLHistPainter
13 #define ROOT_TGLHistPainter
15 #include "TVirtualHistPainter.h"
16 #include "TGLPlotPainter.h"
17 #include "TGLPlotCamera.h"
19 #include <memory>
21 /*
22  TGLHistPainter is a proxy class. It inherits TVirtualHistPainter and
23  overrides its virtual functions, but all actual work is done by :
24  THistPainter - I name it "default" painter, it's the member of type
25  TVirtualHistPainter * and loaded via plugin-manager;
26  TGLLegoPainter - it draws different legos (lego/lego1/lego2/lego3);
27  TGLSurfacePainter - supports surfaces (surf/surf1/surf2/surf3/surf4/surf5);
28  TGLBoxPainter - box option for TH3;
29  TGLTF3Painter - TF3.
30 */
33 class TGLTH3Composition;
34 class TGL5DDataSet;
35 class TString;
36 class TList;
37 class TF3;
38 class TH1;
41 private:
42  //Dynamic type is THistPainter, no problems with simultaneous inheritance and membership
43  //TGLHistPainter delegates unsupported options/calls to this object
44  std::unique_ptr<TVirtualHistPainter> fDefaultPainter;
45  //This member can have different dynamic types: TGLLegoPainter, etc.
46  std::unique_ptr<TGLPlotPainter> fGLPainter;
50  TF3 *fF3;
56 public:
57  TGLHistPainter(TH1 *hist);
62  //TVirtualHistPainter final overriders
64  void DrawPanel();
65  void ExecuteEvent(Int_t event, Int_t px, Int_t py);
66  TList *GetContourList(Double_t contour)const;
67  char *GetObjectInfo(Int_t px, Int_t py)const;
68  TList *GetStack()const;
71  void Paint(Option_t *option);
72  void PaintStat(Int_t dostat, TF1 *fit);
73  void ProcessMessage(const char *message, const TObject *obj);
74  void SetHistogram(TH1 *hist);
75  void SetStack(TList *stack);
76  Int_t MakeCuts(char *cutsOpt);
77  void SetShowProjection(const char *option, Int_t nbins);
79  TGLPlotPainter *GetRealPainter(){return fGLPainter.get();}
80 private:
82  struct PlotOption_t;
84  PlotOption_t ParsePaintOption(const TString &option)const;
85  void CreatePainter(const PlotOption_t &parsed,
86  const TString &option);
88  void PadToViewport(Bool_t selectionPass = kFALSE);
93  ClassDef(TGLHistPainter, 0) //Proxy class for GL hist painters.
94 };
96 #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.
PlotOption_t ParsePaintOption(const TString &option) const
In principle, we can have several conflicting options: "lego surf pol sph", surfbb: surf...
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&#39;...
Basic string class.
Definition: TString.h:131
int Int_t
Definition: RtypesCore.h:41
bool Bool_t
Definition: RtypesCore.h:59
char * GetObjectInfo(Int_t px, Int_t py) const
Overrides TObject::GetObjectInfo.
Int_t DistancetoPrimitive(Int_t px, Int_t py)
Selects plot or axis.
void Paint(Option_t *option)
Final-overrider for TObject::Paint.
TList * GetContourList(Double_t contour) const
Get contour list.
Double_t x[n]
Definition: legend1.C:17
#define ClassDef(name, id)
Definition: Rtypes.h:320
std::unique_ptr< TGLPlotPainter > fGLPainter
Abstract interface to a histogram painter.
TGLPlotCoordinates fCoord
void PadToViewport(Bool_t selectionPass=kFALSE)
A doubly linked list.
Definition: TList.h:44
std::unique_ptr< TVirtualHistPainter > fDefaultPainter
TGLParametricEquation * fEq
void ProcessMessage(const char *message, const TObject *obj)
Process message.
A 3-Dim function with parameters.
Definition: TF3.h:28
TGLHistPainter(TH1 *hist)
ROOT does not use exceptions, so, if default painter&#39;s creation failed, fDefaultPainter is 0...
EGLPlotType fPlotType
Helper class for plot-painters holding information about axis ranges, numbers of bins and flags if ce...
TGLHistPainter & operator=(const TGLHistPainter &)
A parametric surface is a surface defined by a parametric equation, involving two parameters (u...
Definition: TGLParametric.h:35
Base class for plot-painters that provide GL rendering of various 2D and 3D histograms, functions and parametric surfaces.
const Bool_t kFALSE
Definition: RtypesCore.h:88
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:56
void SetShowProjection(const char *option, Int_t nbins)
Set show projection.
Definition: TGLUtil.h:49
The histogram painter class using OpenGL.
Mother of all ROOT objects.
Definition: TObject.h:37
1-Dim function class
Definition: TF1.h:211
Int_t MakeCuts(char *cutsOpt)
Make cuts.
void ExecuteEvent(Int_t event, Int_t px, Int_t py)
Execute event.
TList * GetStack() const
Get stack.
void PaintStat(Int_t dostat, TF1 *fit)
Paint statistics.