THistPainter.h

Go to the documentation of this file.
00001 // @(#)root/histpainter:$Id: THistPainter.h 36953 2010-11-25 17:27:16Z couet $
00002 // Author: Rene Brun   26/08/99
00003 
00004 /*************************************************************************
00005  * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers.               *
00006  * All rights reserved.                                                  *
00007  *                                                                       *
00008  * For the licensing terms see $ROOTSYS/LICENSE.                         *
00009  * For the list of contributors see $ROOTSYS/README/CREDITS.             *
00010  *************************************************************************/
00011 #ifndef ROOT_THistPainter
00012 #define ROOT_THistPainter
00013 
00014 
00015 //////////////////////////////////////////////////////////////////////////
00016 //                                                                      //
00017 // THistPainter                                                         //
00018 //                                                                      //
00019 // helper class to draw histograms                                      //
00020 //                                                                      //
00021 //////////////////////////////////////////////////////////////////////////
00022 
00023 
00024 #ifndef ROOT_TVirtualHistPainter
00025 #include "TVirtualHistPainter.h"
00026 #endif
00027 #ifndef ROOT_TString
00028 #include "TString.h"
00029 #endif
00030 
00031 
00032 class TH1;
00033 class TAxis;
00034 class TCutG;
00035 class TGaxis;
00036 class TPainter3dAlgorithms;
00037 class TGraph2DPainter;
00038 class TPie;
00039 const Int_t kMaxCuts = 16;
00040 
00041 class THistPainter : public TVirtualHistPainter {
00042 
00043 protected:
00044    TH1                  *fH;                 //pointer to histogram to paint
00045    TAxis                *fXaxis;             //pointer to X axis
00046    TAxis                *fYaxis;             //pointer to Y axis
00047    TAxis                *fZaxis;             //pointer to Z axis
00048    TList                *fFunctions;         //pointer to histogram list of functions
00049    TPainter3dAlgorithms *fLego;              //pointer to a TPainter3dAlgorithms object
00050    TGraph2DPainter      *fGraph2DPainter;    //pointer to a TGraph2DPainter object
00051    TPie                 *fPie;               //pointer to a TPie in case of option PIE
00052    Double_t             *fXbuf;              //X buffer coordinates
00053    Double_t             *fYbuf;              //Y buffer coordinates
00054    Int_t                 fNcuts;             //Number of graphical cuts
00055    Int_t                 fCutsOpt[kMaxCuts]; //sign of each cut
00056    TCutG                *fCuts[kMaxCuts];    //Pointers to graphical cuts
00057    TList                *fStack;             //Pointer to stack of histograms (if any)
00058    Int_t                 fShowProjection;    //True if a projection must be drawn
00059    TString               fShowOption;        //Option to draw the projection
00060 
00061 public:
00062    THistPainter();
00063    virtual ~THistPainter();
00064    virtual void       DefineColorLevels(Int_t ndivz);
00065    virtual Int_t      DistancetoPrimitive(Int_t px, Int_t py);
00066    virtual void       DrawPanel();
00067    virtual void       ExecuteEvent(Int_t event, Int_t px, Int_t py);
00068    virtual TList     *GetContourList(Double_t contour) const;
00069    virtual char      *GetObjectInfo(Int_t px, Int_t py) const;
00070    virtual TList     *GetStack() const {return fStack;}
00071    virtual Bool_t     IsInside(Int_t x, Int_t y);
00072    virtual Bool_t     IsInside(Double_t x, Double_t y);
00073    virtual Int_t      MakeChopt(Option_t *option);
00074    virtual Int_t      MakeCuts(char *cutsopt);
00075    virtual void       Paint(Option_t *option="");
00076    virtual void       PaintArrows(Option_t *option);
00077    virtual void       PaintAxis(Bool_t drawGridOnly=kFALSE);
00078    virtual void       PaintBar(Option_t *option);
00079    virtual void       PaintBarH(Option_t *option);
00080    virtual void       PaintBoxes(Option_t *option);
00081    virtual void       PaintColorLevels(Option_t *option);
00082    virtual void       PaintTH2PolyBins(Option_t *option);
00083    virtual void       PaintTH2PolyColorLevels(Option_t *option);
00084    virtual void       PaintTH2PolyScatterPlot(Option_t *option);
00085    virtual void       PaintTH2PolyText(Option_t *option);
00086    virtual void       PaintContour(Option_t *option);
00087    virtual Int_t      PaintContourLine(Double_t elev1, Int_t icont1, Double_t x1, Double_t y1,
00088                           Double_t elev2, Int_t icont2, Double_t x2, Double_t y2,
00089                           Double_t *xarr, Double_t *yarr, Int_t *itarr, Double_t *levels);
00090    virtual void       PaintErrors(Option_t *option);
00091    virtual void       Paint2DErrors(Option_t *option);
00092    virtual void       PaintFrame();
00093    virtual void       PaintFunction(Option_t *option);
00094    virtual void       PaintHist(Option_t *option);
00095    virtual void       PaintH3(Option_t *option="");
00096    virtual void       PaintH3Iso();
00097    virtual Int_t      PaintInit();
00098    virtual Int_t      PaintInitH();
00099    virtual void       PaintLego(Option_t *option);
00100    virtual void       PaintLegoAxis(TGaxis *axis, Double_t ang);
00101    virtual void       PaintPalette();
00102    virtual void       PaintScatterPlot(Option_t *option);
00103    virtual void       PaintStat(Int_t dostat, TF1 *fit);
00104    virtual void       PaintStat2(Int_t dostat, TF1 *fit);
00105    virtual void       PaintStat3(Int_t dostat, TF1 *fit);
00106    virtual void       PaintSurface(Option_t *option);
00107    virtual void       PaintTriangles(Option_t *option);
00108    virtual void       PaintTable(Option_t *option);
00109    virtual void       PaintText(Option_t *option);
00110    virtual void       PaintTitle();
00111    virtual void       PaintTF3();
00112    virtual void       ProcessMessage(const char *mess, const TObject *obj);
00113    static  Int_t      ProjectAitoff2xy(Double_t l, Double_t b, Double_t &Al, Double_t &Ab);
00114    static  Int_t      ProjectMercator2xy(Double_t l, Double_t b, Double_t &Al, Double_t &Ab);
00115    static  Int_t      ProjectSinusoidal2xy(Double_t l, Double_t b, Double_t &Al, Double_t &Ab);
00116    static  Int_t      ProjectParabolic2xy(Double_t l, Double_t b, Double_t &Al, Double_t &Ab);
00117    virtual void       RecalculateRange();
00118    virtual void       RecursiveRemove(TObject *) {;}
00119    virtual void       SetHistogram(TH1 *h);
00120    virtual void       SetStack(TList *stack) {fStack = stack;}
00121    virtual void       SetShowProjection(const char *option,Int_t nbins);
00122    virtual void       ShowProjectionX(Int_t px, Int_t py);
00123    virtual void       ShowProjectionY(Int_t px, Int_t py);
00124    virtual void       ShowProjection3(Int_t px, Int_t py);
00125    virtual Int_t      TableInit();
00126 
00127    static const char * GetBestFormat(Double_t v, Double_t e, const char *f);
00128    static void       PaintSpecialObjects(const TObject *obj, Option_t *option);
00129 
00130    ClassDef(THistPainter,0)  //Helper class to draw histograms
00131 };
00132 
00133 #endif

Generated on Tue Jul 5 14:24:23 2011 for ROOT_528-00b_version by  doxygen 1.5.1