Warning, file /include/root/TGLTH3Composition.h was not indexed
or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).
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 kBox,
0034 kSphere
0035 };
0036
0037 void AddTH3(const TH3 *hist, ETH3BinShape shape = kBox);
0038
0039
0040
0041 Int_t DistancetoPrimitive(Int_t px, Int_t py) override;
0042 void ExecuteEvent(Int_t event, Int_t px, Int_t py) override;
0043 char *GetObjectInfo(Int_t px, Int_t py) const override;
0044 void Paint(Option_t *option) override;
0045
0046 private:
0047 void CheckRanges(const TH3 *hist);
0048
0049 typedef std::pair<const TH3 *, ETH3BinShape> TH3Pair_t;
0050
0051 std::vector<TH3Pair_t> fHists;
0052 std::unique_ptr<TGLHistPainter> fPainter;
0053
0054 TGLTH3Composition(const TGLTH3Composition &) = delete;
0055 TGLTH3Composition &operator = (const TGLTH3Composition &) = delete;
0056
0057 ClassDefOverride(TGLTH3Composition, 0)
0058 };
0059
0060
0061
0062
0063 class TGLTH3CompositionPainter: public TGLPlotPainter {
0064 public:
0065 TGLTH3CompositionPainter(TGLTH3Composition *data, TGLPlotCamera *camera,
0066 TGLPlotCoordinates *coord);
0067
0068
0069 char *GetPlotInfo(Int_t px, Int_t py) override;
0070 Bool_t InitGeometry() override;
0071 void StartPan(Int_t px, Int_t py) override;
0072 void Pan(Int_t px, Int_t py) override;
0073 void AddOption(const TString &option) override;
0074 void ProcessEvent(Int_t event, Int_t px, Int_t py) override;
0075
0076 private:
0077
0078 void InitGL()const override;
0079 void DeInitGL()const override;
0080
0081 void DrawPlot()const override;
0082
0083
0084 void DrawSectionXOZ()const override {}
0085 void DrawSectionYOZ()const override {}
0086 void DrawSectionXOY()const override {}
0087
0088 void SetColor(Int_t color)const;
0089
0090 TGLTH3Composition *fData;
0091 std::pair<Double_t, Double_t> fMinMaxVal;
0092
0093 mutable TGLQuadric fQuadric;
0094
0095 TGLTH3CompositionPainter(const TGLTH3CompositionPainter &) = delete;
0096 TGLTH3CompositionPainter &operator = (const TGLTH3CompositionPainter &) = delete;
0097
0098 ClassDefOverride(TGLTH3CompositionPainter, 0)
0099 };
0100
0101
0102 #endif