00001 
00002 
00003 
00004 
00005 
00006 
00007 
00008 
00009 
00010 
00011 
00012 #ifndef ROOT_TGLHistPainter
00013 #define ROOT_TGLHistPainter
00014 
00015 #include <memory>
00016 
00017 #ifndef ROOT_TVirtualHistPainter
00018 #include "TVirtualHistPainter.h"
00019 #endif
00020 #ifndef ROOT_TGLPlotPainter
00021 #include "TGLPlotPainter.h"
00022 #endif
00023 #ifndef ROOT_TGLPlotCamera
00024 #include "TGLPlotCamera.h"
00025 #endif
00026 
00027 
00028 
00029 
00030 
00031 
00032 
00033 
00034 
00035 
00036 
00037 
00038 class TGLParametricEquation;
00039 class TGLTH3Composition;
00040 class TGL5DDataSet;
00041 class TString;
00042 class TList;
00043 class TF3;
00044 class TH1;
00045 
00046 class TGLHistPainter : public TVirtualHistPainter {
00047 private:
00048    
00049    
00050    std::auto_ptr<TVirtualHistPainter> fDefaultPainter;
00051    
00052    std::auto_ptr<TGLPlotPainter>      fGLPainter;
00053 
00054    TGLParametricEquation *fEq;
00055    TH1                   *fHist;
00056    TF3                   *fF3;
00057    TList                 *fStack;
00058    EGLPlotType            fPlotType;
00059    TGLPlotCamera          fCamera;
00060    TGLPlotCoordinates     fCoord;
00061 
00062 public:
00063    TGLHistPainter(TH1 *hist);
00064    TGLHistPainter(TGLParametricEquation *equation);
00065    TGLHistPainter(TGL5DDataSet *data);
00066    TGLHistPainter(TGLTH3Composition *comp);
00067 
00068    
00069    Int_t          DistancetoPrimitive(Int_t px, Int_t py);
00070    void           DrawPanel();
00071    void           ExecuteEvent(Int_t event, Int_t px, Int_t py);
00072    TList         *GetContourList(Double_t contour)const;
00073    char          *GetObjectInfo(Int_t px, Int_t py)const;
00074    TList         *GetStack()const;
00075    Bool_t         IsInside(Int_t x, Int_t y);
00076    Bool_t         IsInside(Double_t x, Double_t y);
00077    void           Paint(Option_t *option);
00078    void           PaintStat(Int_t dostat, TF1 *fit);
00079    void           ProcessMessage(const char *message, const TObject *obj);
00080    void           SetHistogram(TH1 *hist);
00081    void           SetStack(TList *stack);
00082    Int_t          MakeCuts(char *cutsOpt);
00083    void           SetShowProjection(const char *option, Int_t nbins);
00084 
00085    TGLPlotPainter *GetRealPainter(){return fGLPainter.get();}
00086 private:
00087 
00088    struct PlotOption_t;
00089 
00090    PlotOption_t   ParsePaintOption(const TString &option)const;
00091    void           CreatePainter(const PlotOption_t &parsed,
00092                                 const TString &option);
00093 
00094    void           PadToViewport(Bool_t selectionPass = kFALSE);
00095                                 
00096    TGLHistPainter(const TGLHistPainter &);
00097    TGLHistPainter &operator = (const TGLHistPainter &);
00098 
00099    ClassDef(TGLHistPainter, 0) 
00100 };
00101 
00102 #endif