TGLHistPainter.h

Go to the documentation of this file.
00001 // @(#)root/gl:$Id$
00002 // Author:  Timur Pocheptsov  17/11/2005
00003 
00004 /*************************************************************************
00005  * Copyright (C) 1995-2005, 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 
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    TGLHistPainter is a proxy class. It inherits TVirtualHistPainter and
00029    overrides its virtual functions, but all actual work is done by :
00030       THistPainter - I name it "default" painter, it's the member of type
00031                      TVirtualHistPainter * and loaded via plugin-manager;
00032       TGLLegoPainter - it draws different legos (lego/lego1/lego2/lego3);
00033       TGLSurfacePainter - supports surfaces (surf/surf1/surf2/surf3/surf4/surf5);
00034       TGLBoxPainter - box option for TH3;
00035       TGLTF3Painter - TF3.
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    //Dynamic type is THistPainter, no problems with simultaneous inheritance and membership
00049    //TGLHistPainter delegates unsupported options/calls to this object
00050    std::auto_ptr<TVirtualHistPainter> fDefaultPainter;
00051    //This member can have different dynamic types: TGLLegoPainter, etc.
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    //TVirtualHistPainter final overriders
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) //Proxy class for GL hist painters.
00100 };
00101 
00102 #endif

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