Logo ROOT   6.30.04
Reference Guide
 All Namespaces Files Pages
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 "TVirtualHistPainter.h"
16 #include "TGLPlotPainter.h"
17 #include "TGLPlotCamera.h"
18 
19 #include <memory>
20 
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 */
31 
32 class TGLParametricEquation;
33 class TGLTH3Composition;
34 class TGL5DDataSet;
35 class TString;
36 class TList;
37 class TF3;
38 class TH1;
39 
40 class TGLHistPainter : public TVirtualHistPainter {
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;
47 
48  TGLParametricEquation *fEq;
49  TH1 *fHist;
50  TF3 *fF3;
51  TList *fStack;
52  EGLPlotType fPlotType;
53  TGLPlotCamera fCamera;
54  TGLPlotCoordinates fCoord;
55 
56 public:
57  TGLHistPainter(TH1 *hist);
58  TGLHistPainter(TGLParametricEquation *equation);
59  TGLHistPainter(TGL5DDataSet *data);
60  TGLHistPainter(TGLTH3Composition *comp);
61 
62  //TVirtualHistPainter final overriders
63  Int_t DistancetoPrimitive(Int_t px, Int_t py);
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;
69  Bool_t IsInside(Int_t x, Int_t y);
70  Bool_t IsInside(Double_t x, Double_t y);
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 SetHighlight();
75  void SetHistogram(TH1 *hist);
76  void SetStack(TList *stack);
77  Int_t MakeCuts(char *cutsOpt);
78  void SetShowProjection(const char *option, Int_t nbins);
79 
80  TGLPlotPainter *GetRealPainter(){return fGLPainter.get();}
81 private:
82 
83  struct PlotOption_t;
84 
85  PlotOption_t ParsePaintOption(const TString &option)const;
86  void CreatePainter(const PlotOption_t &parsed,
87  const TString &option);
88 
89  void PadToViewport(Bool_t selectionPass = kFALSE);
90 
91  TGLHistPainter(const TGLHistPainter &);
92  TGLHistPainter &operator = (const TGLHistPainter &);
93 
94  ClassDef(TGLHistPainter, 0) //Proxy class for GL hist painters.
95 };
96 
97 #endif