File indexing completed on 2026-09-29 09:28:35
0001
0002
0003
0004 #ifndef ROOT_TGLTH3Composition
0005 #define ROOT_TGLTH3Composition
0006
0007 #include <utility>
0008 #include <memory>
0009 #include <vector>
0010
0011 #include "TGLHistPainter.h"
0012 #include "TGLPlotPainter.h"
0013 #include "TGLQuadric.h"
0014 #include "TH3.h"
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027 class TGLTH3Composition : public TH3C {
0028 friend class TGLTH3CompositionPainter;
0029 public:
0030 TGLTH3Composition();
0031
0032 enum ETH3BinShape {
0033
0034 #if defined(__clang__) && __clang_major__ < 20
0035 #pragma clang diagnostic push
0036 #pragma clang diagnostic ignored "-Wshadow"
0037 #endif
0038 kBox,
0039 #if defined(__clang__) && __clang_major__ < 20
0040 #pragma clang diagnostic pop
0041 #endif
0042 kSphere
0043 };
0044
0045 void AddTH3(const TH3 *hist, ETH3BinShape shape = kBox);
0046
0047
0048
0049 Int_t DistancetoPrimitive(Int_t px, Int_t py) override;
0050 void ExecuteEvent(Int_t event, Int_t px, Int_t py) override;
0051 char *GetObjectInfo(Int_t px, Int_t py) const override;
0052 void Paint(Option_t *option) override;
0053
0054 private:
0055 void CheckRanges(const TH3 *hist);
0056
0057 typedef std::pair<const TH3 *, ETH3BinShape> TH3Pair_t;
0058
0059 std::vector<TH3Pair_t> fHists;
0060 std::unique_ptr<TGLHistPainter> fPainter;
0061
0062 TGLTH3Composition(const TGLTH3Composition &) = delete;
0063 TGLTH3Composition &operator = (const TGLTH3Composition &) = delete;
0064
0065 ClassDefOverride(TGLTH3Composition, 0)
0066 };
0067
0068
0069
0070
0071 class TGLTH3CompositionPainter: public TGLPlotPainter {
0072 public:
0073 TGLTH3CompositionPainter(TGLTH3Composition *data, TGLPlotCamera *camera,
0074 TGLPlotCoordinates *coord);
0075
0076
0077 char *GetPlotInfo(Int_t px, Int_t py) override;
0078 Bool_t InitGeometry() override;
0079 void StartPan(Int_t px, Int_t py) override;
0080 void Pan(Int_t px, Int_t py) override;
0081 void AddOption(const TString &option) override;
0082 void ProcessEvent(Int_t event, Int_t px, Int_t py) override;
0083
0084 private:
0085
0086 void InitGL()const override;
0087 void DeInitGL()const override;
0088
0089 void DrawPlot()const override;
0090
0091
0092 void DrawSectionXOZ()const override {}
0093 void DrawSectionYOZ()const override {}
0094 void DrawSectionXOY()const override {}
0095
0096 void SetColor(Int_t color)const;
0097
0098 TGLTH3Composition *fData;
0099 std::pair<Double_t, Double_t> fMinMaxVal;
0100
0101 mutable TGLQuadric fQuadric;
0102
0103 TGLTH3CompositionPainter(const TGLTH3CompositionPainter &) = delete;
0104 TGLTH3CompositionPainter &operator = (const TGLTH3CompositionPainter &) = delete;
0105
0106 ClassDefOverride(TGLTH3CompositionPainter, 0)
0107 };
0108
0109
0110 #endif