00001 // @(#)root/gl:$Id$ 00002 // Author: Timur Pocheptsov 31/08/2006 00003 00004 /************************************************************************* 00005 * Copyright (C) 1995-2006, Rene Brun and Fons Rademakers. * 00006 * All rights reserved. * 00007 * * 00008 * For the licensing terms see $ROOTSYS/LICENSE. * 00009 * For the list of contributors see $ROOTSYS/README/CREDITS. * 00010 *************************************************************************/ 00011 00012 #ifndef ROOT_TGLBoxPainter 00013 #define ROOT_TGLBoxPainter 00014 00015 #ifndef ROOT_TGLPlotPainter 00016 #include "TGLPlotPainter.h" 00017 #endif 00018 #ifndef ROOT_TGLQuadric 00019 #include "TGLQuadric.h" 00020 #endif 00021 #ifndef ROOT_TString 00022 #include "TString.h" 00023 #endif 00024 #ifndef ROOT_TGLUtil 00025 #include "TGLUtil.h" 00026 #endif 00027 00028 class TGLPlotCamera; 00029 class TAxis; 00030 class TH1; 00031 00032 class TGLBoxPainter : public TGLPlotPainter { 00033 private: 00034 TGLTH3Slice fXOZSlice; 00035 TGLTH3Slice fYOZSlice; 00036 TGLTH3Slice fXOYSlice; 00037 00038 enum EBoxType { 00039 kBox, //boxes, sizes are proportional to bin content 00040 kBox1 //spheres, not boxes 00041 }; 00042 00043 mutable EBoxType fType; 00044 00045 TString fPlotInfo; 00046 Rgl::Range_t fMinMaxVal; 00047 00048 mutable TGLQuadric fQuadric; 00049 00050 TGLBoxPainter(const TGLBoxPainter &); 00051 TGLBoxPainter &operator = (const TGLBoxPainter &); 00052 00053 public: 00054 TGLBoxPainter(TH1 *hist, TGLPlotCamera *camera, TGLPlotCoordinates *coord); 00055 00056 char *GetPlotInfo(Int_t px, Int_t py); 00057 Bool_t InitGeometry(); 00058 void StartPan(Int_t px, Int_t py); 00059 void Pan(Int_t px, Int_t py); 00060 void AddOption(const TString &stringOption); 00061 void ProcessEvent(Int_t event, Int_t px, Int_t py); 00062 00063 private: 00064 //Overriders 00065 void InitGL()const; 00066 void DeInitGL()const; 00067 00068 void DrawPlot()const; 00069 00070 void SetPlotColor()const; 00071 00072 void DrawSectionXOZ()const; 00073 void DrawSectionYOZ()const; 00074 void DrawSectionXOY()const; 00075 00076 void DrawPalette()const; 00077 void DrawPaletteAxis()const; 00078 00079 Bool_t HasSections()const; 00080 00081 ClassDef(TGLBoxPainter, 0)//Box painter 00082 }; 00083 00084 #endif