Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-09-20 09:27:11

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 // clang++ <v20 (-Wshadow) complains about shadowing Buttons.h global enum EEditMode. Let's silence warning:
0040 #if defined(__clang__) && __clang_major__ < 20
0041 #pragma clang diagnostic push
0042 #pragma clang diagnostic ignored "-Wshadow"
0043 #endif
0044       kBox, //boxes, sizes are proportional to bin content
0045 #if defined(__clang__) && __clang_major__ < 20
0046 #pragma clang diagnostic pop
0047 #endif
0048       kBox1 //spheres, not boxes
0049    };
0050 
0051    mutable EBoxType        fType;
0052 
0053    TString                 fPlotInfo;
0054    Rgl::Range_t            fMinMaxVal;
0055 
0056    mutable TGLQuadric      fQuadric;
0057 
0058    const TPolyMarker3D    *fPolymarker; //Polymarker from TTree.
0059    std::vector<Double_t>   fPMPoints;   //Cache for polymarker's points.
0060 
0061    TGLBoxPainter(const TGLBoxPainter &);
0062    TGLBoxPainter &operator = (const TGLBoxPainter &);
0063 
0064 public:
0065    TGLBoxPainter(TH1 *hist, TGLPlotCamera *camera, TGLPlotCoordinates *coord);
0066 
0067    TGLBoxPainter(TH1 *hist, TPolyMarker3D * pm,
0068                  TGLPlotCamera *camera, TGLPlotCoordinates *coord);
0069 
0070    char   *GetPlotInfo(Int_t px, Int_t py) override;
0071    Bool_t  InitGeometry() override;
0072    void    StartPan(Int_t px, Int_t py) override;
0073    void    Pan(Int_t px, Int_t py) override;
0074    void    AddOption(const TString &stringOption) override;
0075    void    ProcessEvent(Int_t event, Int_t px, Int_t py) override;
0076 
0077 private:
0078    //Overriders
0079    void    InitGL()const override;
0080    void    DeInitGL()const override;
0081 
0082    void    DrawPlot()const override;
0083    //Special type of TH3:
0084    void    DrawCloud()const;
0085 
0086    void    SetPlotColor()const;
0087 
0088    void    DrawSectionXOZ()const override;
0089    void    DrawSectionYOZ()const override;
0090    void    DrawSectionXOY()const override;
0091 
0092    void    DrawPalette()const;
0093    void    DrawPaletteAxis()const override;
0094 
0095    Bool_t  HasSections()const;
0096 
0097    ClassDefOverride(TGLBoxPainter, 0)//Box painter
0098 };
0099 
0100 #endif