ROOT logo
// @(#)root/gl:$Id$
// Author:  Timur Pocheptsov  17/11/2005

/*************************************************************************
 * Copyright (C) 1995-2005, 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_TGLHistPainter
#define ROOT_TGLHistPainter

#include <memory>

#ifndef ROOT_TVirtualHistPainter
#include "TVirtualHistPainter.h"
#endif
#ifndef ROOT_TGLPlotPainter
#include "TGLPlotPainter.h"
#endif
#ifndef ROOT_TGLPlotCamera
#include "TGLPlotCamera.h"
#endif

/*
   TGLHistPainter is a proxy class. It inherits TVirtualHistPainter and
   overrides its virtual functions, but all actual work is done by :
      THistPainter - I name it "default" painter, it's the member of type
                     TVirtualHistPainter * and loaded via plugin-manager;
      TGLLegoPainter - it draws different legos (lego/lego1/lego2/lego3);
      TGLSurfacePainter - supports surfaces (surf/surf1/surf2/surf3/surf4/surf5);
      TGLBoxPainter - box option for TH3;
      TGLTF3Painter - TF3.
*/

class TGLParametricEquation;
class TGLTH3Composition;
class TGL5DDataSet;
class TString;
class TList;
class TF3;
class TH1;

class TGLHistPainter : public TVirtualHistPainter {
private:
   //Dynamic type is THistPainter, no problems with simultaneous inheritance and membership
   //TGLHistPainter delegates unsupported options/calls to this object
   std::auto_ptr<TVirtualHistPainter> fDefaultPainter;
   //This member can have different dynamic types: TGLLegoPainter, etc.
   std::auto_ptr<TGLPlotPainter>      fGLPainter;

   TGLParametricEquation *fEq;
   TH1                   *fHist;
   TF3                   *fF3;
   TList                 *fStack;
   EGLPlotType            fPlotType;
   TGLPlotCamera          fCamera;
   TGLPlotCoordinates     fCoord;

public:
   TGLHistPainter(TH1 *hist);
   TGLHistPainter(TGLParametricEquation *equation);
   TGLHistPainter(TGL5DDataSet *data);
   TGLHistPainter(TGLTH3Composition *comp);

   //TVirtualHistPainter final overriders
   Int_t          DistancetoPrimitive(Int_t px, Int_t py);
   void           DrawPanel();
   void           ExecuteEvent(Int_t event, Int_t px, Int_t py);
   TList         *GetContourList(Double_t contour)const;
   char          *GetObjectInfo(Int_t px, Int_t py)const;
   TList         *GetStack()const;
   Bool_t         IsInside(Int_t x, Int_t y);
   Bool_t         IsInside(Double_t x, Double_t y);
   void           Paint(Option_t *option);
   void           PaintStat(Int_t dostat, TF1 *fit);
   void           ProcessMessage(const char *message, const TObject *obj);
   void           SetHistogram(TH1 *hist);
   void           SetStack(TList *stack);
   Int_t          MakeCuts(char *cutsOpt);
   void           SetShowProjection(const char *option, Int_t nbins);

   TGLPlotPainter *GetRealPainter(){return fGLPainter.get();}
private:

   struct PlotOption_t;

   PlotOption_t   ParsePaintOption(const TString &option)const;
   void           CreatePainter(const PlotOption_t &parsed,
                                const TString &option);

   void           PadToViewport(Bool_t selectionPass = kFALSE);
                                
   TGLHistPainter(const TGLHistPainter &);
   TGLHistPainter &operator = (const TGLHistPainter &);

   ClassDef(TGLHistPainter, 0) //Proxy class for GL hist painters.
};

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