00001
00002
00003
00004 #ifndef ROOT_TGLTH3Composition
00005 #define ROOT_TGLTH3Composition
00006
00007 #include <utility>
00008 #include <memory>
00009 #include <vector>
00010
00011 #ifndef ROOT_TGLHistPainter
00012 #include "TGLHistPainter.h"
00013 #endif
00014 #ifndef ROOT_TGLPlotPainter
00015 #include "TGLPlotPainter.h"
00016 #endif
00017 #ifndef ROOT_TGLQuadric
00018 #include "TGLQuadric.h"
00019 #endif
00020 #ifndef ROOT_TH3
00021 #include "TH3.h"
00022 #endif
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035 class TGLTH3Composition : public TH3C {
00036 friend class TGLTH3CompositionPainter;
00037 public:
00038 TGLTH3Composition();
00039
00040 enum ETH3BinShape {
00041 kBox,
00042 kSphere
00043 };
00044
00045 void AddTH3(const TH3 *hist, ETH3BinShape shape = kBox);
00046
00047
00048
00049 Int_t DistancetoPrimitive(Int_t px, Int_t py);
00050 void ExecuteEvent(Int_t event, Int_t px, Int_t py);
00051 char *GetObjectInfo(Int_t px, Int_t py) const;
00052 void Paint(Option_t *option);
00053
00054 private:
00055 void CheckRanges(const TH3 *hist);
00056
00057 typedef std::pair<const TH3 *, ETH3BinShape> TH3Pair_t;
00058
00059 std::vector<TH3Pair_t> fHists;
00060 std::auto_ptr<TGLHistPainter> fPainter;
00061
00062 TGLTH3Composition(const TGLTH3Composition &rhs);
00063 TGLTH3Composition &operator = (const TGLTH3Composition &);
00064
00065 ClassDef(TGLTH3Composition, 0)
00066 };
00067
00068
00069
00070
00071 class TGLTH3CompositionPainter: public TGLPlotPainter {
00072 public:
00073 TGLTH3CompositionPainter(TGLTH3Composition *data, TGLPlotCamera *camera,
00074 TGLPlotCoordinates *coord);
00075
00076
00077 char *GetPlotInfo(Int_t px, Int_t py);
00078 Bool_t InitGeometry();
00079 void StartPan(Int_t px, Int_t py);
00080 void Pan(Int_t px, Int_t py);
00081 void AddOption(const TString &option);
00082 void ProcessEvent(Int_t event, Int_t px, Int_t py);
00083
00084 private:
00085
00086 void InitGL()const;
00087 void DeInitGL()const;
00088
00089 void DrawPlot()const;
00090
00091
00092 void DrawSectionXOZ()const{}
00093 void DrawSectionYOZ()const{}
00094 void DrawSectionXOY()const{}
00095
00096 void SetColor(Int_t color)const;
00097
00098 TGLTH3Composition *fData;
00099 std::pair<Double_t, Double_t> fMinMaxVal;
00100
00101 mutable TGLQuadric fQuadric;
00102
00103 TGLTH3CompositionPainter(const TGLTH3CompositionPainter &rhs);
00104 TGLTH3CompositionPainter &operator = (const TGLTH3CompositionPainter &rhs);
00105
00106 ClassDef(TGLTH3CompositionPainter, 0)
00107 };
00108
00109
00110 #endif