Back to home page

EIC code displayed by LXR

 
 

    


Warning, file /include/root/TGLHistPainter.h was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

0001 // @(#)root/gl:$Id$
0002 // Author:  Timur Pocheptsov  17/11/2005
0003 
0004 /*************************************************************************
0005  * Copyright (C) 1995-2005, Rene Brun and Fons Rademakers.               *
0006  * All rights reserved.                                                  *
0007  *                                                                       *
0008  * For the licensing terms see $ROOTSYS/LICENSE.                         *
0009  * For the list of contributors see $ROOTSYS/README/CREDITS.             *
0010  *************************************************************************/
0011 
0012 #ifndef ROOT_TGLHistPainter
0013 #define ROOT_TGLHistPainter
0014 
0015 #include "TVirtualHistPainter.h"
0016 #include "TGLPlotPainter.h"
0017 #include "TGLPlotCamera.h"
0018 
0019 #include <memory>
0020 
0021 /*
0022    TGLHistPainter is a proxy class. It inherits TVirtualHistPainter and
0023    overrides its virtual functions, but all actual work is done by :
0024       THistPainter - I name it "default" painter, it's the member of type
0025                      TVirtualHistPainter * and loaded via plugin-manager;
0026       TGLLegoPainter - it draws different legos (lego/lego1/lego2/lego3);
0027       TGLSurfacePainter - supports surfaces (surf/surf1/surf2/surf3/surf4/surf5);
0028       TGLBoxPainter - box option for TH3;
0029       TGLTF3Painter - TF3.
0030 */
0031 
0032 class TGLParametricEquation;
0033 class TGLTH3Composition;
0034 class TGL5DDataSet;
0035 class TString;
0036 class TList;
0037 class TF3;
0038 class TH1;
0039 
0040 class TGLHistPainter : public TVirtualHistPainter {
0041 private:
0042    //Dynamic type is THistPainter, no problems with simultaneous inheritance and membership
0043    //TGLHistPainter delegates unsupported options/calls to this object
0044    std::unique_ptr<TVirtualHistPainter> fDefaultPainter;
0045    //This member can have different dynamic types: TGLLegoPainter, etc.
0046    std::unique_ptr<TGLPlotPainter>      fGLPainter;
0047 
0048    TGLParametricEquation *fEq;
0049    TH1                   *fHist;
0050    TF3                   *fF3;
0051    TList                 *fStack;
0052    EGLPlotType            fPlotType;
0053    TGLPlotCamera          fCamera;
0054    TGLPlotCoordinates     fCoord;
0055 
0056 public:
0057    TGLHistPainter(TH1 *hist);
0058    TGLHistPainter(TGLParametricEquation *equation);
0059    TGLHistPainter(TGL5DDataSet *data);
0060    TGLHistPainter(TGLTH3Composition *comp);
0061 
0062    //TVirtualHistPainter final overriders
0063    Int_t          DistancetoPrimitive(Int_t px, Int_t py) override;
0064    void           DrawPanel() override;
0065    void           ExecuteEvent(Int_t event, Int_t px, Int_t py) override;
0066    TList         *GetContourList(Double_t contour)const override;
0067    char          *GetObjectInfo(Int_t px, Int_t py)const override;
0068    TList         *GetStack()const override;
0069    Bool_t         IsInside(Int_t x, Int_t y) override;
0070    Bool_t         IsInside(Double_t x, Double_t y) override;
0071    void           Paint(Option_t *option) override;
0072    void           PaintStat(Int_t dostat, TF1 *fit) override;
0073    void           ProcessMessage(const char *message, const TObject *obj) override;
0074    void           SetHighlight() override;
0075    void           SetHistogram(TH1 *hist) override;
0076    void           SetStack(TList *stack) override;
0077    Int_t          MakeCuts(char *cutsOpt) override;
0078    void           SetShowProjection(const char *option, Int_t nbins) override;
0079    void           SetShowProjectionXY(const char *option, Int_t nbinsY, Int_t nbinsX) override;
0080 
0081    TGLPlotPainter *GetRealPainter(){return fGLPainter.get();}
0082 private:
0083 
0084    struct PlotOption_t;
0085 
0086    PlotOption_t   ParsePaintOption(const TString &option)const;
0087    void           CreatePainter(const PlotOption_t &parsed,
0088                                 const TString &option);
0089 
0090    void           PadToViewport(Bool_t selectionPass = kFALSE);
0091 
0092    TGLHistPainter(const TGLHistPainter &);
0093    TGLHistPainter &operator = (const TGLHistPainter &);
0094 
0095    ClassDefOverride(TGLHistPainter, 0) //Proxy class for GL hist painters.
0096 };
0097 
0098 #endif