forked from root-project/root
-
Notifications
You must be signed in to change notification settings - Fork 0
/
TGLH2PolyPainter.h
73 lines (58 loc) · 2.46 KB
/
TGLH2PolyPainter.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
#ifndef ROOT_TGLH2PolyPainter
#define ROOT_TGLH2PolyPainter
#include <vector>
#include <list>
#include "TGLPlotPainter.h"
#include "TGLPadUtils.h"
#include "TString.h"
class TMultiGraph;
class TGraph;
class TGLH2PolyPainter : public TGLPlotPainter {
public:
TGLH2PolyPainter(TH1 *hist, TGLPlotCamera *camera, TGLPlotCoordinates *coord);
char *GetPlotInfo(Int_t px, Int_t py);
Bool_t InitGeometry();
void StartPan(Int_t px, Int_t py);
void Pan(Int_t px, Int_t py);
void AddOption(const TString &stringOption);
void ProcessEvent(Int_t event, Int_t px, Int_t py);
private:
//Overriders
void InitGL()const;
void DeInitGL()const;
void DrawPlot()const;
//Aux. functions.
//Draw edges of a bin.
void DrawExtrusion()const;
void DrawExtrusion(const TGraph *polygon, Double_t zMin, Double_t zMax, Int_t nBin)const;
void DrawExtrusion(const TMultiGraph *polygon, Double_t zMin, Double_t zMax, Int_t nBin)const;
//Draw caps for a bin.
typedef std::list<Rgl::Pad::Tesselation_t>::const_iterator CIter_t;
void DrawCaps()const;
void DrawCap(CIter_t cap, Int_t bin, bool bottomCap)const;
//
Bool_t CacheGeometry();
Bool_t BuildTesselation(Rgl::Pad::Tesselator & tess, const TGraph *g, Double_t z);
Bool_t BuildTesselation(Rgl::Pad::Tesselator & tess, const TMultiGraph *mg, Double_t z);
Bool_t UpdateGeometry();
//Find the color in palette using bin content.
void SetBinColor(Int_t bin)const;
//Empty overriders.
void DrawSectionXOZ()const;
void DrawSectionYOZ()const;
void DrawSectionXOY()const;
void DrawPalette()const;
void DrawPaletteAxis()const;
//Aux. staff.
void FillTemporaryPolygon(const Double_t *xs, const Double_t *ys, Double_t z, Int_t n)const;
void MakePolygonCCW()const;
Bool_t ClampZ(Double_t &zVal)const;
TString fBinInfo; //Used by GetPlotInfo.
std::vector<Int_t> fBinColors;
mutable std::vector<Double_t> fPolygon; //Temporary array for polygon's vertices.
std::list<Rgl::Pad::Tesselation_t> fCaps;//Caps for all bins.
Bool_t fZLog;//Change in logZ updates only bin heights.
Double_t fZMin;
ClassDef(TGLH2PolyPainter, 0); //Painter class for TH2Poly.
};
#endif