#ifndef ROOT_TGLH2PolyPainter
#define ROOT_TGLH2PolyPainter
#include <vector>
#include <list>
#ifndef ROOT_TGLPlotPainter
#include "TGLPlotPainter.h"
#endif
#ifndef ROOT_TGLPadUtils
#include "TGLPadUtils.h"
#endif
#ifndef ROOT_TString
#include "TString.h"
#endif
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:
void InitGL()const;
void DeInitGL()const;
void DrawPlot()const;
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;
typedef std::list<Rgl::Pad::Tesselation_t>::const_iterator CIter_t;
void DrawCaps()const;
void DrawCap(CIter_t cap, Int_t bin)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();
void SetBinColor(Int_t bin)const;
void DrawSectionXOZ()const;
void DrawSectionYOZ()const;
void DrawSectionXOY()const;
void DrawPalette()const;
void DrawPaletteAxis()const;
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;
std::vector<Int_t> fBinColors;
mutable std::vector<Double_t> fPolygon;
std::list<Rgl::Pad::Tesselation_t> fCaps;
Bool_t fZLog;
Double_t fZMin;
ClassDef(TGLH2PolyPainter, 0);
};
#endif