00001 #ifndef ROOT_TGLH2PolyPainter
00002 #define ROOT_TGLH2PolyPainter
00003
00004 #include <vector>
00005 #include <list>
00006
00007 #ifndef ROOT_TGLPlotPainter
00008 #include "TGLPlotPainter.h"
00009 #endif
00010 #ifndef ROOT_TGLPadUtils
00011 #include "TGLPadUtils.h"
00012 #endif
00013 #ifndef ROOT_TString
00014 #include "TString.h"
00015 #endif
00016
00017 class TMultiGraph;
00018 class TGraph;
00019
00020 class TGLH2PolyPainter : public TGLPlotPainter {
00021 public:
00022 TGLH2PolyPainter(TH1 *hist, TGLPlotCamera *camera, TGLPlotCoordinates *coord);
00023
00024 char *GetPlotInfo(Int_t px, Int_t py);
00025 Bool_t InitGeometry();
00026 void StartPan(Int_t px, Int_t py);
00027 void Pan(Int_t px, Int_t py);
00028 void AddOption(const TString &stringOption);
00029 void ProcessEvent(Int_t event, Int_t px, Int_t py);
00030
00031 private:
00032
00033 void InitGL()const;
00034 void DeInitGL()const;
00035 void DrawPlot()const;
00036
00037
00038 void DrawExtrusion()const;
00039 void DrawExtrusion(const TGraph *polygon, Double_t zMin, Double_t zMax, Int_t nBin)const;
00040 void DrawExtrusion(const TMultiGraph *polygon, Double_t zMin, Double_t zMax, Int_t nBin)const;
00041
00042
00043 typedef std::list<Rgl::Pad::Tesselation_t>::const_iterator CIter_t;
00044 void DrawCaps()const;
00045 void DrawCap(CIter_t cap, Int_t bin)const;
00046
00047 Bool_t CacheGeometry();
00048 Bool_t BuildTesselation(Rgl::Pad::Tesselator & tess, const TGraph *g, Double_t z);
00049 Bool_t BuildTesselation(Rgl::Pad::Tesselator & tess, const TMultiGraph *mg, Double_t z);
00050 Bool_t UpdateGeometry();
00051
00052 void SetBinColor(Int_t bin)const;
00053
00054
00055 void DrawSectionXOZ()const;
00056 void DrawSectionYOZ()const;
00057 void DrawSectionXOY()const;
00058 void DrawPalette()const;
00059 void DrawPaletteAxis()const;
00060
00061
00062 void FillTemporaryPolygon(const Double_t *xs, const Double_t *ys, Double_t z, Int_t n)const;
00063 void MakePolygonCCW()const;
00064 Bool_t ClampZ(Double_t &zVal)const;
00065
00066 TString fBinInfo;
00067
00068 std::vector<Int_t> fBinColors;
00069
00070 mutable std::vector<Double_t> fPolygon;
00071 std::list<Rgl::Pad::Tesselation_t> fCaps;
00072
00073 Bool_t fZLog;
00074 Double_t fZMin;
00075
00076 ClassDef(TGLH2PolyPainter, 0);
00077 };
00078
00079 #endif