Logo ROOT   6.30.04
Reference Guide
 All Namespaces Files Pages
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.
26 class TPolyMarker3D;
27 
28 class TGLPlotCamera;
29 class TAxis;
30 class TH1;
31 
32 class TGLBoxPainter : public TGLPlotPainter {
33 private:
34  TGLTH3Slice fXOZSlice;
35  TGLTH3Slice fYOZSlice;
36  TGLTH3Slice fXOYSlice;
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 
45  TString fPlotInfo;
46  Rgl::Range_t fMinMaxVal;
47 
48  mutable TGLQuadric fQuadric;
49 
50  const TPolyMarker3D *fPolymarker; //Polymarker from TTree.
51  std::vector<Double_t> fPMPoints; //Cache for polymarker's points.
52 
53  TGLBoxPainter(const TGLBoxPainter &);
54  TGLBoxPainter &operator = (const TGLBoxPainter &);
55 
56 public:
57  TGLBoxPainter(TH1 *hist, TGLPlotCamera *camera, TGLPlotCoordinates *coord);
58 
59  TGLBoxPainter(TH1 *hist, TPolyMarker3D * pm,
60  TGLPlotCamera *camera, TGLPlotCoordinates *coord);
61 
62  char *GetPlotInfo(Int_t px, Int_t py);
63  Bool_t InitGeometry();
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 
69 private:
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