ROOT logo
// @(#)root/gl:$Id$
// Author:  Timur Pocheptsov  31/08/2006

/*************************************************************************
 * Copyright (C) 1995-2006, Rene Brun and Fons Rademakers.               *
 * All rights reserved.                                                  *
 *                                                                       *
 * For the licensing terms see $ROOTSYS/LICENSE.                         *
 * For the list of contributors see $ROOTSYS/README/CREDITS.             *
 *************************************************************************/
#ifndef ROOT_TGLBoxPainter
#define ROOT_TGLBoxPainter

#include <vector>

#ifndef ROOT_TGLPlotPainter
#include "TGLPlotPainter.h"
#endif
#ifndef ROOT_TGLQuadric
#include "TGLQuadric.h"
#endif
#ifndef ROOT_TString
#include "TString.h"
#endif
#ifndef ROOT_TGLUtil
#include "TGLUtil.h"
#endif

//TGLScenePad creates box painter
//for the case TPad has poly marker and
//empty TH3 inside.
//Now it's up to box painter to do everything
//correctly.
class TPolyMarker3D;

class TGLPlotCamera;
class TAxis;
class TH1;

class TGLBoxPainter : public TGLPlotPainter {
private:
   TGLTH3Slice fXOZSlice;
   TGLTH3Slice fYOZSlice;
   TGLTH3Slice fXOYSlice;

   enum EBoxType {
      kBox, //boxes, sizes are proportional to bin content
      kBox1 //spheres, not boxes
   };

   mutable EBoxType        fType;

   TString                 fPlotInfo;
   Rgl::Range_t            fMinMaxVal;

   mutable TGLQuadric      fQuadric;

   const TPolyMarker3D    *fPolymarker; //Polymarker from TTree.
   std::vector<Double_t>   fPMPoints;   //Cache for polymarker's points.

   TGLBoxPainter(const TGLBoxPainter &);
   TGLBoxPainter &operator = (const TGLBoxPainter &);

public:
   TGLBoxPainter(TH1 *hist, TGLPlotCamera *camera, TGLPlotCoordinates *coord);

   TGLBoxPainter(TH1 *hist, TPolyMarker3D * pm,
                 TGLPlotCamera *camera, TGLPlotCoordinates *coord);

   char   *GetPlotInfo(Int_t px, Int_t py);
   Bool_t  InitGeometry();
   void    StartPan(Int_t px, Int_t py);
   void    Pan(Int_t px, Int_t py);
   void    AddOption(const TString &stringOption);
   void    ProcessEvent(Int_t event, Int_t px, Int_t py);

private:
   //Overriders
   void    InitGL()const;
   void    DeInitGL()const;
   
   void    DrawPlot()const;
   //Special type of TH3:
   void    DrawCloud()const;

   void    SetPlotColor()const;

   void    DrawSectionXOZ()const;
   void    DrawSectionYOZ()const;
   void    DrawSectionXOY()const;

   void    DrawPalette()const;
   void    DrawPaletteAxis()const;

   Bool_t  HasSections()const;

   ClassDef(TGLBoxPainter, 0)//Box painter
};

#endif
 TGLBoxPainter.h:1
 TGLBoxPainter.h:2
 TGLBoxPainter.h:3
 TGLBoxPainter.h:4
 TGLBoxPainter.h:5
 TGLBoxPainter.h:6
 TGLBoxPainter.h:7
 TGLBoxPainter.h:8
 TGLBoxPainter.h:9
 TGLBoxPainter.h:10
 TGLBoxPainter.h:11
 TGLBoxPainter.h:12
 TGLBoxPainter.h:13
 TGLBoxPainter.h:14
 TGLBoxPainter.h:15
 TGLBoxPainter.h:16
 TGLBoxPainter.h:17
 TGLBoxPainter.h:18
 TGLBoxPainter.h:19
 TGLBoxPainter.h:20
 TGLBoxPainter.h:21
 TGLBoxPainter.h:22
 TGLBoxPainter.h:23
 TGLBoxPainter.h:24
 TGLBoxPainter.h:25
 TGLBoxPainter.h:26
 TGLBoxPainter.h:27
 TGLBoxPainter.h:28
 TGLBoxPainter.h:29
 TGLBoxPainter.h:30
 TGLBoxPainter.h:31
 TGLBoxPainter.h:32
 TGLBoxPainter.h:33
 TGLBoxPainter.h:34
 TGLBoxPainter.h:35
 TGLBoxPainter.h:36
 TGLBoxPainter.h:37
 TGLBoxPainter.h:38
 TGLBoxPainter.h:39
 TGLBoxPainter.h:40
 TGLBoxPainter.h:41
 TGLBoxPainter.h:42
 TGLBoxPainter.h:43
 TGLBoxPainter.h:44
 TGLBoxPainter.h:45
 TGLBoxPainter.h:46
 TGLBoxPainter.h:47
 TGLBoxPainter.h:48
 TGLBoxPainter.h:49
 TGLBoxPainter.h:50
 TGLBoxPainter.h:51
 TGLBoxPainter.h:52
 TGLBoxPainter.h:53
 TGLBoxPainter.h:54
 TGLBoxPainter.h:55
 TGLBoxPainter.h:56
 TGLBoxPainter.h:57
 TGLBoxPainter.h:58
 TGLBoxPainter.h:59
 TGLBoxPainter.h:60
 TGLBoxPainter.h:61
 TGLBoxPainter.h:62
 TGLBoxPainter.h:63
 TGLBoxPainter.h:64
 TGLBoxPainter.h:65
 TGLBoxPainter.h:66
 TGLBoxPainter.h:67
 TGLBoxPainter.h:68
 TGLBoxPainter.h:69
 TGLBoxPainter.h:70
 TGLBoxPainter.h:71
 TGLBoxPainter.h:72
 TGLBoxPainter.h:73
 TGLBoxPainter.h:74
 TGLBoxPainter.h:75
 TGLBoxPainter.h:76
 TGLBoxPainter.h:77
 TGLBoxPainter.h:78
 TGLBoxPainter.h:79
 TGLBoxPainter.h:80
 TGLBoxPainter.h:81
 TGLBoxPainter.h:82
 TGLBoxPainter.h:83
 TGLBoxPainter.h:84
 TGLBoxPainter.h:85
 TGLBoxPainter.h:86
 TGLBoxPainter.h:87
 TGLBoxPainter.h:88
 TGLBoxPainter.h:89
 TGLBoxPainter.h:90
 TGLBoxPainter.h:91
 TGLBoxPainter.h:92
 TGLBoxPainter.h:93
 TGLBoxPainter.h:94
 TGLBoxPainter.h:95
 TGLBoxPainter.h:96
 TGLBoxPainter.h:97
 TGLBoxPainter.h:98
 TGLBoxPainter.h:99
 TGLBoxPainter.h:100