Back to home page

EIC code displayed by LXR

 
 

    


Warning, file /include/root/TGLBoxPainter.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  31/08/2006
0003 
0004 /*************************************************************************
0005  * Copyright (C) 1995-2006, 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 #ifndef ROOT_TGLBoxPainter
0012 #define ROOT_TGLBoxPainter
0013 
0014 #include <vector>
0015 
0016 #include "TGLPlotPainter.h"
0017 #include "TGLQuadric.h"
0018 #include "TString.h"
0019 #include "TGLUtil.h"
0020 
0021 //TGLScenePad creates box painter
0022 //for the case TPad has poly marker and
0023 //empty TH3 inside.
0024 //Now it's up to box painter to do everything
0025 //correctly.
0026 class TPolyMarker3D;
0027 
0028 class TGLPlotCamera;
0029 class TAxis;
0030 class TH1;
0031 
0032 class TGLBoxPainter : public TGLPlotPainter {
0033 private:
0034    TGLTH3Slice fXOZSlice;
0035    TGLTH3Slice fYOZSlice;
0036    TGLTH3Slice fXOYSlice;
0037 
0038    enum EBoxType {
0039       kBox, //boxes, sizes are proportional to bin content
0040       kBox1 //spheres, not boxes
0041    };
0042 
0043    mutable EBoxType        fType;
0044 
0045    TString                 fPlotInfo;
0046    Rgl::Range_t            fMinMaxVal;
0047 
0048    mutable TGLQuadric      fQuadric;
0049 
0050    const TPolyMarker3D    *fPolymarker; //Polymarker from TTree.
0051    std::vector<Double_t>   fPMPoints;   //Cache for polymarker's points.
0052 
0053    TGLBoxPainter(const TGLBoxPainter &);
0054    TGLBoxPainter &operator = (const TGLBoxPainter &);
0055 
0056 public:
0057    TGLBoxPainter(TH1 *hist, TGLPlotCamera *camera, TGLPlotCoordinates *coord);
0058 
0059    TGLBoxPainter(TH1 *hist, TPolyMarker3D * pm,
0060                  TGLPlotCamera *camera, TGLPlotCoordinates *coord);
0061 
0062    char   *GetPlotInfo(Int_t px, Int_t py) override;
0063    Bool_t  InitGeometry() override;
0064    void    StartPan(Int_t px, Int_t py) override;
0065    void    Pan(Int_t px, Int_t py) override;
0066    void    AddOption(const TString &stringOption) override;
0067    void    ProcessEvent(Int_t event, Int_t px, Int_t py) override;
0068 
0069 private:
0070    //Overriders
0071    void    InitGL()const override;
0072    void    DeInitGL()const override;
0073 
0074    void    DrawPlot()const override;
0075    //Special type of TH3:
0076    void    DrawCloud()const;
0077 
0078    void    SetPlotColor()const;
0079 
0080    void    DrawSectionXOZ()const override;
0081    void    DrawSectionYOZ()const override;
0082    void    DrawSectionXOY()const override;
0083 
0084    void    DrawPalette()const;
0085    void    DrawPaletteAxis()const override;
0086 
0087    Bool_t  HasSections()const;
0088 
0089    ClassDefOverride(TGLBoxPainter, 0)//Box painter
0090 };
0091 
0092 #endif