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.             *
 *************************************************************************/

#include <stdexcept>
#include <cstring>

#include "TVirtualGL.h"
#include "KeySymbols.h"
#include "Buttons.h"
#include "TH2Poly.h"
#include "TClass.h"
#include "TROOT.h"
#include "TGL5D.h"
#include "TMath.h"
#include "TPad.h"
#include "TH3.h"
#include "TF3.h"

#include "TGLSurfacePainter.h"
#include "TGLTH3Composition.h"
#include "TGLH2PolyPainter.h"
#include "TGLVoxelPainter.h"
#include "TGLHistPainter.h"
#include "TGLLegoPainter.h"
#include "TGLBoxPainter.h"
#include "TGLTF3Painter.h"
#include "TGLParametric.h"
#include "TGL5DPainter.h"
#include "TGLUtil.h"

ClassImp(TGLHistPainter)

//______________________________________________________________________________
/* Begin_Html
<center><h2>The histogram painter class using OpenGL</h2></center>

Histograms are, by default, drawn via the <tt>THistPainter</tt> class.
<tt>TGLHistPainter</tt> allows to paint them using the OpenGL 3D graphics
library. The plotting options provided by <tt>TGLHistPainter</tt> start with
<tt>GL</tt> keyword.

<h3>General information: plot types and supported options</h3>

The following types of plots are provided:
<ul>
<p><li><b>Lego - (<tt>TGLLegoPainter</tt>)</b>
  <br> The supported options are:
  <ul>
  <li> <tt>"GLLEGO"  :</tt> Draw a lego plot.
  <li> <tt>"GLLEGO2" :</tt> Bins with color levels.
  <li> <tt>"GLLEGO3" :</tt> Cylindrical bars.
  </ul>
  Lego painter in cartesian supports logarithmic scales for X, Y, Z.
  In polar only Z axis can be logarithmic, in cylindrical only Y (if you see
  what it means).


<p><li><b>Surfaces (<tt>TF2</tt> and <tt>TH2</tt> with <tt>"GLSURF"</tt> options) - (<tt>TGLSurfacePainter</tt>)</b>
  <br> The supported options are:
  <ul>
  <li> <tt>"GLSURF"  :</tt> Draw a surface.
  <li> <tt>"GLSURF1" :</tt> Surface with color levels
  <li> <tt>"GLSURF2" :</tt> The same as <tt>"GLSURF1"</tt> but without polygon outlines.
  <li> <tt>"GLSURF3" :</tt> Color level projection on top of plot (works only in cartesian coordinate system).
  <li> <tt>"GLSURF4" :</tt> Same as <tt>"GLSURF"</tt> but without polygon outlines.
  </ul>

  The surface painting in cartesian coordinates supports logarithmic scales along X, Y, Z axis.
  In polar coordinates only the Z axis can be logarithmic, in cylindrical coordinates only the Y axis.

<p><li><b>Additional options to <tt>SURF</tt> and <tt>LEGO</tt> - Coordinate systems:</b>
  <br> The supported options are:
  <ul>
  <li> <tt>" "   :</tt> Default, cartesian coordinates system.
  <li> <tt>"POL" :</tt> Polar coordinates system.
  <li> <tt>"CYL" :</tt> Cylindrical coordinates system.
  <li> <tt>"SPH" :</tt> Spherical coordinates system.
  </ul>

<p><li><b><tt>TH3</tt> as boxes (spheres) - (<tt>TGLBoxPainter</tt>)</b>
  <br> The supported options are:
  <ul>
  <li> <tt>"GLBOX" :</tt> TH3 as a set of boxes, size of box is proportional to bin content.
  <li> <tt>"GLBOX1":</tt> the same as "glbox", but spheres are drawn instead of boxes.
  </ul>

<p><li><b><tt>TH3</tt> as iso-surface(s) - (<tt>TGLIsoPainter</tt>)</b>
  <br> The supported option is:
  <ul>
  <li> <tt>"GLISO" :</tt> TH3 is drawn using iso-surfaces.
  </ul>

<p><li><b><tt>TH3</tt> as color boxes - (<tt>TGLVoxelPainter</tt>)</b>
  <br> The supported option is:
  <ul>
  <li> <tt>"GLCOL" :</tt> TH3 is drawn using semi-transparent colored boxes.
  <br>See <tt>$ROOTSYS/tutorials/gl/glvox1.C</tt>.
  </ul>

<p><li><b><tt>TF3</tt> (implicit function) - (<tt>TGLTF3Painter</tt>)</b>
  <br> The supported option is:
  <ul>
  <li> <tt>"GLTF3" :</tt> Draw a <tt>TF3</tt>.
  </ul>

<p><li><b>Parametric surfaces - (<tt>TGLParametricPlot</tt>)</b>
  <br><tt>$ROOTSYS/tutorials/gl/glparametric.C</tt> shows how to create parametric equations and
  visualize the surface.
</ul>

<h3>Interaction with the plots</h3>

<ul>
<p><li><b>General information.</b>
  <br>
  All the interactions are implemented via standard methods <tt>DistancetoPrimitive</tt> and
  <tt>ExecuteEvent</tt>. That's why all the interactions with the OpenGL plots are possible i
  only when the mouse cursor is in the plot's area (the plot's area is the part of a the pad
  occupied by gl-produced picture). If the mouse cursor is not above gl-picture,
  the standard pad interaction is performed.

<p><li><b>Selectable parts.</b>
  <br>
  Different parts of the plot can be selected:
  <ul>
  <li> <em>xoz, yoz, xoy back planes</em>:
     <br>When such a plane selected, it's highlighted in green if the dynamic slicing
     by this plane is supported, and it's highlighted in red, if the dynamic slicing
     is not supported.
  <li><em>The plot itself</em>:
     <br>On surfaces, the selected surface is outlined in red. (TF3 and ISO are not
     outlined). On lego plots, the selected bin is highlihted. The bin number and content are displayed in pad's status
     bar. In box plots, the box or sphere is highlighted and the bin info is displayed in pad's status bar.
  </ul>

<p><li><b>Rotation and zooming.</b>
  <br>
  <ul>
  <li> <em>Rotation</em>:
  <br>
  When the plot is selected, it can be rotated by pressing and holding the left mouse button and move the cursor.
  <li> <em>Zoom/Unzoom</em>:
  <br>
  Mouse wheel or <tt>'j'</tt>, <tt>'J'</tt>, <tt>'k'</tt>, <tt>'K'</tt> keys.
  </ul>

<p><li><b>Panning.</b>
 <br>
  The selected plot can be moved in a pad's area by
  pressing and holding the left mouse button and the shift key.
</ul>

<h3>Box cut</h3>
  Surface, iso, box, TF3 and parametric painters support box cut by pressing the <tt>'c'</tt> or
  <tt>'C'</tt> key when the mouse cursor is in a plot's area. That will display a transparent box,
  cutting away part of the surface (or boxes) in order to show internal part of plot.
  This box can be moved inside the plot's area (the full size of the box is equal to the plot's
  surrounding box) by selecting one of the box cut axes and pressing the left mouse button to move it.

<h3>Plot specific interactions (dynamic slicing etc.)</h3>
  Currently, all gl-plots support some form of slicing.
  When back plane is selected (and if it's highlighted in green)
  you can press and hold left mouse button and shift key
  and move this back plane inside plot's area, creating the slice.
  During this "slicing" plot becomes semi-transparent. To remove all slices (and projected curves for surfaces)
  - double click with left mouse button in a plot's area.
  <ul>
  <p><li><b>Surface with option <tt>"GLSURF"</tt></b>
  <br>
  The surface profile is displayed on the slicing plane.
  The profile projection is drawn on the back plane
  by pressing <tt>'p'</tt> or <tt>'P'</tt> key.

  <p><li><b>TF3</b>
  <br>
  The contour plot is drawn on the slicing plane.
  For <tt>TF3</tt> the color scheme can be changed by pressing <tt>'s'</tt> or <tt>'S'</tt>.

  <p><li><b>Box</b>
  <br>
  The contour plot corresponding to slice plane position is drawn in real time.

  <p><li><b>Iso</b>
  <br>
  Slicing is similar to <tt>"GLBOX"</tt> option.

  <p><li><b>Parametric plot</b>
  <br>
  No slicing. Additional keys: <tt>'s'</tt> or <tt>'S'</tt> to change color scheme - about 20 color schemes supported
  (<tt>'s'</tt> for "scheme"); <tt>'l'</tt> or <tt>'L'</tt> to increase number of polygons (<tt>'l'</tt> for "level" of details),
  <tt>'w'</tt> or <tt>'W'</tt> to show outlines (<tt>'w'</tt> for "wireframe").
  </ul>
End_Html */

//______________________________________________________________________________
TGLHistPainter::TGLHistPainter(TH1 *hist)
                   : fDefaultPainter(TVirtualHistPainter::HistPainter(hist)),
                     fEq(0),
                     fHist(hist),
                     fF3(0),
                     fStack(0),
                     fPlotType(kGLDefaultPlot)//THistPainter
{
   //ROOT does not use exceptions, so, if default painter's creation failed,
   //fDefaultPainter is 0. In each function, which use it, I have to check the pointer first.
}

//______________________________________________________________________________
TGLHistPainter::TGLHistPainter(TGLParametricEquation *equation)
                   : fEq(equation),
                     fHist(0),
                     fF3(0),
                     fStack(0),
                     fPlotType(kGLParametricPlot)//THistPainter
{
   //This ctor creates gl-parametric plot's painter.
   fGLPainter.reset(new TGLParametricPlot(equation, &fCamera));
}

//______________________________________________________________________________
TGLHistPainter::TGLHistPainter(TGL5DDataSet *data)
                   : fEq(0),
                     fHist(0),
                     fF3(0),
                     fStack(0),
                     fPlotType(kGL5D)//THistPainter
{
   //This ctor creates plot painter for TGL5DDataSet.
   fGLPainter.reset(new TGL5DPainter(data, &fCamera, &fCoord));
}

//______________________________________________________________________________
TGLHistPainter::TGLHistPainter(TGLTH3Composition *data)
                   : fEq(0),
                     fHist(data),
                     fF3(0),
                     fStack(0),
                     fPlotType(kGLTH3Composition)
{
   //This ctor creates plot painter for TGL5DDataSet.
   fGLPainter.reset(new TGLTH3CompositionPainter(data, &fCamera, &fCoord));
}

//______________________________________________________________________________
Int_t TGLHistPainter::DistancetoPrimitive(Int_t px, Int_t py)
{
   //Selects plot or axis.
   //9999 is the magic number, ROOT's classes use in DistancetoPrimitive.
   
   //[tp: return statement added.
   //tp]
   
   if (fPlotType == kGLDefaultPlot)
      return fDefaultPainter.get() ? fDefaultPainter->DistancetoPrimitive(px, py) : 9999;
   else {
      //Adjust px and py - canvas can have several pads inside, so we need to convert
      //the from canvas' system into pad's.
      
      //Retina-related adjustments must be done inside!!!
      
      py = gPad->GetWh() - py;

      //One hist can be appended to several pads,
      //the current pad should have valid OpenGL context.
      const Int_t glContext = gPad->GetGLDevice();

      if (glContext != -1) {
         //Add "viewport" extraction here.
         PadToViewport(kTRUE);

         if (!gGLManager->PlotSelected(fGLPainter.get(), px, py))
            gPad->SetSelected(gPad);
      } else {
         Error("DistancetoPrimitive",
               "Attempt to use TGLHistPainter, while the current pad (gPad) does not support gl");
         gPad->SetSelected(gPad);
      }

      return 0;
   }
}

//______________________________________________________________________________
void TGLHistPainter::DrawPanel()
{
   //Default implementation is OK
   //This function is called from a context menu
   //after right click on a plot's area. Opens window
   //("panel") with several controls.
   if (fDefaultPainter.get())
      fDefaultPainter->DrawPanel();
}

//______________________________________________________________________________
void TGLHistPainter::ExecuteEvent(Int_t event, Int_t px, Int_t py)
{
   //Execute event.
   //Events are: mouse events in a plot's area,
   //key presses (while mouse cursor is in plot's area).
   //"Event execution" means one of the following actions:
   //1. Rotation.
   //2. Panning.
   //3. Zoom changing.
   //4. Moving dynamic profile.
   //5. Plot specific events - for example, 's' or 'S' key press for TF3.
   if (fPlotType == kGLDefaultPlot) {
      if(fDefaultPainter.get()) {
         fDefaultPainter->ExecuteEvent(event, px, py);
      }
   } else {
      //One hist can be appended to several pads,
      //the current pad should have valid OpenGL context.
      const Int_t glContext = gPad->GetGLDevice();

      if (glContext == -1) {
         Error("ExecuteEvent",
               "Attempt to use TGLHistPainter, while the current pad (gPad) does not support gl");
         return;
      } else {
         //Add viewport extraction here.
         /*fGLDevice.SetGLDevice(glContext);
         fGLPainter->SetGLDevice(&fGLDevice);*/
         PadToViewport();
      }

      if (event != kKeyPress) {
         //Adjust px and py - canvas can have several pads inside, so we need to convert
         //the from canvas' system into pad's. If it was a key press event,
         //px and py ARE NOT coordinates.
         py -= Int_t((1 - gPad->GetHNDC() - gPad->GetYlowNDC()) * gPad->GetWh());
         px -= Int_t(gPad->GetXlowNDC() * gPad->GetWw());
         
         //We also have to take care of retina displays with a different viewports.
         TGLUtil::InitializeIfNeeded();
         const Float_t scale = TGLUtil::GetScreenScalingFactor();
         if (scale > 1) {
            px *= scale;
            py *= scale;
         }
      }

      switch (event) {
      case kButton1Double:
         //Left double click removes dynamic sections, user created (if plot type supports sections).
         fGLPainter->ProcessEvent(event, px, py);
         break;
      case kButton1Down:
         //Left mouse down in a plot area starts rotation.
         if (!fGLPainter->CutAxisSelected())
            fCamera.StartRotation(px, py);
         else
            fGLPainter->StartPan(px, py);
         //During rotation, usual TCanvas/TPad machinery (CopyPixmap/Flush/UpdateWindow/etc.)
         //is skipped - I use "bit blasting" functions to copy picture directly onto window.
         //gGLManager->MarkForDirectCopy(glContext, kTRUE);
         break;
      case kButton1Motion:
         //Rotation invalidates "selection buffer"
         // - (color-to-object map, previously read from gl-buffer).
         fGLPainter->InvalidateSelection();
         if (fGLPainter->CutAxisSelected())
            gGLManager->PanObject(fGLPainter.get(), px, py);
         else
            fCamera.RotateCamera(px, py);
         //Draw modified scene onto canvas' window.
         //gGLManager->PaintSingleObject(fGLPainter.get());
         gPad->Update();
         break;
      case kButton1Up:
      case kButton2Up:
         gGLManager->MarkForDirectCopy(glContext, kFALSE);
         break;
      case kMouseMotion:
         gPad->SetCursor(kRotate);
         break;
      case 7://kButton1Down + shift modifier
         //The current version of ROOT does not
         //have enumerators for button events + key modifiers,
         //so I use hardcoded literals. :(
         //With left mouse button down and shift pressed
         //we can move plot as the whole or move
         //plot's parts - dynamic sections.
         fGLPainter->StartPan(px, py);
         gGLManager->MarkForDirectCopy(glContext, kTRUE);
         break;
      case 8://kButton1Motion + shift modifier
         gGLManager->PanObject(fGLPainter.get(), px, py);
         //gGLManager->PaintSingleObject(fGLPainter.get());
         gPad->Update();
         break;
      case kKeyPress:
      case 5:
      case 6:
         //5, 6 are mouse wheel events (see comment about literals above).
         //'p'/'P' - specific events processed by TGLSurfacePainter,
         //'s'/'S' - specific events processed by TGLTF3Painter,
         //'c'/'C' - turn on/off box cut.
         gGLManager->MarkForDirectCopy(glContext, kTRUE);
         if (event == 6 || py == kKey_J || py == kKey_j) {
            fCamera.ZoomIn();
            fGLPainter->InvalidateSelection();
            //gGLManager->PaintSingleObject(fGLPainter.get());
            gPad->Update();
         } else if (event == 5 || py == kKey_K || py == kKey_k) {
            fCamera.ZoomOut();
            fGLPainter->InvalidateSelection();
            //gGLManager->PaintSingleObject(fGLPainter.get());
            gPad->Update();
         } else if (py == kKey_p || py == kKey_P || py == kKey_S || py == kKey_s
                    || py == kKey_c || py == kKey_C || py == kKey_x || py == kKey_X
                    || py == kKey_y || py == kKey_Y || py == kKey_z || py == kKey_Z
                    || py == kKey_w || py == kKey_W || py == kKey_l || py == kKey_L
                    /*|| py == kKey_r || py == kKey_R*/)
         {
            fGLPainter->ProcessEvent(event, px, py);
            //gGLManager->PaintSingleObject(fGLPainter.get());
            gPad->Update();
         }
         gGLManager->MarkForDirectCopy(glContext, kFALSE);
         break;
      }
   }
}

//______________________________________________________________________________
TList *TGLHistPainter::GetContourList(Double_t contour)const
{
   //Get contour list.
   //I do not use this function. Contours are implemented in
   //a completely different way by gl-painters.
   return fDefaultPainter.get() ? fDefaultPainter->GetContourList(contour) : 0;
}

//______________________________________________________________________________
char *TGLHistPainter::GetObjectInfo(Int_t px, Int_t py)const
{
   //Overrides TObject::GetObjectInfo.
   //For lego info is: bin numbers (i, j), bin content.
   //For TF2 info is: x,y,z 3d surface-point for 2d screen-point under cursor
   //(this can work incorrectly now, because of wrong code in TF2).
   //For TF3 no info now.
   //For box info is: bin numbers (i, j, k), bin content.
   static char errMsg[] = { "TGLHistPainter::GetObjectInfo: Error in a hist painter\n" };
   if (fPlotType == kGLDefaultPlot)
      return fDefaultPainter.get() ? fDefaultPainter->GetObjectInfo(px, py)
                                   : errMsg;
   else {
      TGLUtil::InitializeIfNeeded();
      const Float_t scale = TGLUtil::GetScreenScalingFactor();
      if (scale > 1.f) {
         px *= scale;
         py *= scale;
      }

      return gGLManager->GetPlotInfo(fGLPainter.get(), px, py);
   }
}

//______________________________________________________________________________
TList *TGLHistPainter::GetStack()const
{
   // Get stack.
   return fStack;
}

//______________________________________________________________________________
Bool_t TGLHistPainter::IsInside(Int_t x, Int_t y)
{
   //Returns kTRUE if the cell ix, iy is inside one of the graphical cuts.
   //I do not use this function anywhere, this is a "default implementation".
   if (fPlotType == kGLDefaultPlot)
      return fDefaultPainter.get() ? fDefaultPainter->IsInside(x, y) : kFALSE;

   return kFALSE;
}

//______________________________________________________________________________
Bool_t TGLHistPainter::IsInside(Double_t x, Double_t y)
{
   //Returns kTRUE if the cell x, y is inside one of the graphical cuts.
   //I do not use this function anywhere, this is a "default implementation".
   if (fPlotType == kGLDefaultPlot)
      return fDefaultPainter.get() ? fDefaultPainter->IsInside(x, y) : kFALSE;

   return kFALSE;
}

//______________________________________________________________________________
void TGLHistPainter::PaintStat(Int_t dostat, TF1 *fit)
{
   //Paint statistics.
   //This does not work on windows.
   if (fDefaultPainter.get())
      fDefaultPainter->PaintStat(dostat, fit);
}

//______________________________________________________________________________
void TGLHistPainter::ProcessMessage(const char *m, const TObject *o)
{
   // Process message.
   if (!std::strcmp(m, "SetF3"))
      fF3 = (TF3 *)o;

   if (fDefaultPainter.get())
      fDefaultPainter->ProcessMessage(m, o);
}

//______________________________________________________________________________
void TGLHistPainter::SetHistogram(TH1 *h)
{
   // Set histogram.
   fHist = h;

   if (fDefaultPainter.get())
      fDefaultPainter->SetHistogram(h);
}

//______________________________________________________________________________
void TGLHistPainter::SetStack(TList *s)
{
   // Set stack.
   fStack = s;

   if (fDefaultPainter.get())
      fDefaultPainter->SetStack(s);
}

//______________________________________________________________________________
Int_t TGLHistPainter::MakeCuts(char *o)
{
   // Make cuts.
   if (fPlotType == kGLDefaultPlot && fDefaultPainter.get())
      return fDefaultPainter->MakeCuts(o);

   return 0;
}

struct TGLHistPainter::PlotOption_t {
   EGLPlotType  fPlotType;
   EGLCoordType fCoordType;
   Bool_t       fBackBox;
   Bool_t       fFrontBox;
   Bool_t       fDrawAxes;
   Bool_t       fLogX;
   Bool_t       fLogY;
   Bool_t       fLogZ;
};

//______________________________________________________________________________
void TGLHistPainter::Paint(Option_t *o)
{
   //Final-overrider for TObject::Paint.
   TString option(o);
   option.ToLower();

   const Ssiz_t glPos = option.Index("gl");
   if (glPos != kNPOS)
      option.Remove(glPos, 2);
   else if (fPlotType != kGLParametricPlot && fPlotType != kGL5D && fPlotType != kGLTH3Composition) {
      gPad->SetCopyGLDevice(kFALSE);
      if (fDefaultPainter.get())
         fDefaultPainter->Paint(o);//option.Data());
      return;
   }

   if (fPlotType != kGLParametricPlot && fPlotType != kGL5D && fPlotType != kGLTH3Composition)
      CreatePainter(ParsePaintOption(option), option);

   if (fPlotType == kGLDefaultPlot) {
      //In case of default plot pad
      //should not copy gl-buffer (it will be simply black)
      
      //[tp: code was commented.
      //gPad->SetCopyGLDevice(kFALSE);
      //tp]

      if (fDefaultPainter.get())
         fDefaultPainter->Paint(option.Data());
   } else {
      Int_t glContext = gPad->GetGLDevice();

      if (glContext != -1) {
         //With gl-plot, pad should copy
         //gl-buffer into the final pad/canvas pixmap/DIB.
         //fGLDevice.SetGLDevice(glContext);
         
         //[tp: code commented.
         //gPad->SetCopyGLDevice(kTRUE);
         //tp]
         //fGLPainter->SetGLDevice(&fGLDevice);
         //Add viewport extraction here.
         PadToViewport();
         if (gPad->GetFrameFillColor() != kWhite)
            fGLPainter->SetFrameColor(gROOT->GetColor(gPad->GetFrameFillColor()));
         fGLPainter->SetPadColor(gROOT->GetColor(gPad->GetFillColor()));
         if (fGLPainter->InitGeometry())
            gGLManager->PaintSingleObject(fGLPainter.get());
      }
   }
}

namespace {

Bool_t FindAndRemoveOption(TString &options, const char *toFind)
{
   const UInt_t len = std::strlen(toFind);
   const Ssiz_t index = options.Index(toFind);

   if (index != kNPOS) {
      options.Remove(index, len);
      return kTRUE;
   }
   
   return kFALSE;
}

}

//______________________________________________________________________________
TGLHistPainter::PlotOption_t
TGLHistPainter::ParsePaintOption(const TString &o)const
{
   //In principle, we can have several conflicting options: "lego surf pol sph", surfbb: surf, fb, bb.
   //but only one will be selected, which one - depends on parsing order in this function.
   
   TString options(o);
   
   PlotOption_t parsedOption = {kGLDefaultPlot, kGLCartesian,
                                kTRUE, kTRUE, kTRUE, //Show back box, show front box, show axes.
                                Bool_t(gPad->GetLogx()), Bool_t(gPad->GetLogy()),
                                Bool_t(gPad->GetLogz())};

   //Check coordinate system type.
   if (FindAndRemoveOption(options, "pol"))
      parsedOption.fCoordType = kGLPolar;
   if (FindAndRemoveOption(options, "cyl"))
      parsedOption.fCoordType = kGLCylindrical;
   if (FindAndRemoveOption(options, "sph"))
      parsedOption.fCoordType = kGLSpherical;

   //Define plot type.
   if (FindAndRemoveOption(options, "lego"))
      fStack ? parsedOption.fPlotType = kGLStackPlot : parsedOption.fPlotType = kGLLegoPlot;
   if (FindAndRemoveOption(options, "surf"))
      parsedOption.fPlotType = kGLSurfacePlot;
   if (FindAndRemoveOption(options, "tf3"))
      parsedOption.fPlotType = kGLTF3Plot;
   if (FindAndRemoveOption(options, "box"))
      parsedOption.fPlotType = kGLBoxPlot;
   if (FindAndRemoveOption(options, "iso"))
      parsedOption.fPlotType = kGLIsoPlot;
   if (FindAndRemoveOption(options, "col"))
      parsedOption.fPlotType = kGLVoxel;

   //Check BB and FB options.
   if (FindAndRemoveOption(options, "bb"))
      parsedOption.fBackBox = kFALSE;
   if (FindAndRemoveOption(options, "fb"))
      parsedOption.fFrontBox = kFALSE;
      
   //Check A option.
   if (FindAndRemoveOption(options, "a"))
      parsedOption.fDrawAxes = kFALSE;

   return parsedOption;
}

//______________________________________________________________________________
void TGLHistPainter::CreatePainter(const PlotOption_t &option, const TString &addOption)
{
   // Create painter.
   if (option.fPlotType != fPlotType) {
      fCoord.ResetModified();
      fGLPainter.reset(0);
   }

   if (option.fPlotType == kGLLegoPlot) {
      if (!fGLPainter.get()) {
         if (dynamic_cast<TH2Poly*>(fHist))
            fGLPainter.reset(new TGLH2PolyPainter(fHist, &fCamera, &fCoord));
         else
            fGLPainter.reset(new TGLLegoPainter(fHist, &fCamera, &fCoord));
      }
   } else if (option.fPlotType == kGLSurfacePlot) {
      if (!fGLPainter.get())
         fGLPainter.reset(new TGLSurfacePainter(fHist, &fCamera, &fCoord));
   } else if (option.fPlotType == kGLBoxPlot) {
      if (!fGLPainter.get())
         fGLPainter.reset(new TGLBoxPainter(fHist, &fCamera, &fCoord));
   } else if (option.fPlotType == kGLTF3Plot) {
      if (!fGLPainter.get())
         fGLPainter.reset(new TGLTF3Painter(fF3, fHist, &fCamera, &fCoord));
   } else if (option.fPlotType == kGLIsoPlot) {
      if (!fGLPainter.get())
         fGLPainter.reset(new TGLIsoPainter(fHist, &fCamera, &fCoord));
   } else if (option.fPlotType == kGLVoxel) {
      if (!fGLPainter.get())
         fGLPainter.reset(new TGLVoxelPainter(fHist, &fCamera, &fCoord));
   }

   if (fGLPainter.get()) {
      fPlotType = option.fPlotType;
      fCoord.SetXLog(gPad->GetLogx());
      fCoord.SetYLog(gPad->GetLogy());
      fCoord.SetZLog(gPad->GetLogz());
      fCoord.SetCoordType(option.fCoordType);
      fGLPainter->AddOption(addOption);
      
      fGLPainter->SetDrawFrontBox(option.fFrontBox);
      fGLPainter->SetDrawBackBox(option.fBackBox);
      fGLPainter->SetDrawAxes(option.fDrawAxes);
   } else
      fPlotType = kGLDefaultPlot;
}

//______________________________________________________________________________
void TGLHistPainter::SetShowProjection(const char *option, Int_t nbins)
{
   // Set show projection.

   if (fDefaultPainter.get()) fDefaultPainter->SetShowProjection(option, nbins);
}

//______________________________________________________________________________
void TGLHistPainter::PadToViewport(Bool_t /*selectionPass*/)
{
   if (!fGLPainter.get())
      return;

   TGLRect vp;
   vp.Width()  = Int_t(gPad->GetAbsWNDC() * gPad->GetWw());
   vp.Height() = Int_t(gPad->GetAbsHNDC() * gPad->GetWh());
   
   vp.X() = Int_t(gPad->XtoAbsPixel(gPad->GetX1()));
   vp.Y() = Int_t((gPad->GetWh() - gPad->YtoAbsPixel(gPad->GetY1())));
   
   TGLUtil::InitializeIfNeeded();
   const Float_t scale = TGLUtil::GetScreenScalingFactor();

   if (scale > 1.f) {
      vp.X() = Int_t(vp.X() * scale);
      vp.Y() = Int_t(vp.Y() * scale);
      
      vp.Width() = Int_t(vp.Width() * scale);
      vp.Height() = Int_t(vp.Height() * scale);
   }
   
   fCamera.SetViewport(vp);
   if (fCamera.ViewportChanged() && fGLPainter.get())
      fGLPainter->InvalidateSelection();
}
 TGLHistPainter.cxx:1
 TGLHistPainter.cxx:2
 TGLHistPainter.cxx:3
 TGLHistPainter.cxx:4
 TGLHistPainter.cxx:5
 TGLHistPainter.cxx:6
 TGLHistPainter.cxx:7
 TGLHistPainter.cxx:8
 TGLHistPainter.cxx:9
 TGLHistPainter.cxx:10
 TGLHistPainter.cxx:11
 TGLHistPainter.cxx:12
 TGLHistPainter.cxx:13
 TGLHistPainter.cxx:14
 TGLHistPainter.cxx:15
 TGLHistPainter.cxx:16
 TGLHistPainter.cxx:17
 TGLHistPainter.cxx:18
 TGLHistPainter.cxx:19
 TGLHistPainter.cxx:20
 TGLHistPainter.cxx:21
 TGLHistPainter.cxx:22
 TGLHistPainter.cxx:23
 TGLHistPainter.cxx:24
 TGLHistPainter.cxx:25
 TGLHistPainter.cxx:26
 TGLHistPainter.cxx:27
 TGLHistPainter.cxx:28
 TGLHistPainter.cxx:29
 TGLHistPainter.cxx:30
 TGLHistPainter.cxx:31
 TGLHistPainter.cxx:32
 TGLHistPainter.cxx:33
 TGLHistPainter.cxx:34
 TGLHistPainter.cxx:35
 TGLHistPainter.cxx:36
 TGLHistPainter.cxx:37
 TGLHistPainter.cxx:38
 TGLHistPainter.cxx:39
 TGLHistPainter.cxx:40
 TGLHistPainter.cxx:41
 TGLHistPainter.cxx:42
 TGLHistPainter.cxx:43
 TGLHistPainter.cxx:44
 TGLHistPainter.cxx:45
 TGLHistPainter.cxx:46
 TGLHistPainter.cxx:47
 TGLHistPainter.cxx:48
 TGLHistPainter.cxx:49
 TGLHistPainter.cxx:50
 TGLHistPainter.cxx:51
 TGLHistPainter.cxx:52
 TGLHistPainter.cxx:53
 TGLHistPainter.cxx:54
 TGLHistPainter.cxx:55
 TGLHistPainter.cxx:56
 TGLHistPainter.cxx:57
 TGLHistPainter.cxx:58
 TGLHistPainter.cxx:59
 TGLHistPainter.cxx:60
 TGLHistPainter.cxx:61
 TGLHistPainter.cxx:62
 TGLHistPainter.cxx:63
 TGLHistPainter.cxx:64
 TGLHistPainter.cxx:65
 TGLHistPainter.cxx:66
 TGLHistPainter.cxx:67
 TGLHistPainter.cxx:68
 TGLHistPainter.cxx:69
 TGLHistPainter.cxx:70
 TGLHistPainter.cxx:71
 TGLHistPainter.cxx:72
 TGLHistPainter.cxx:73
 TGLHistPainter.cxx:74
 TGLHistPainter.cxx:75
 TGLHistPainter.cxx:76
 TGLHistPainter.cxx:77
 TGLHistPainter.cxx:78
 TGLHistPainter.cxx:79
 TGLHistPainter.cxx:80
 TGLHistPainter.cxx:81
 TGLHistPainter.cxx:82
 TGLHistPainter.cxx:83
 TGLHistPainter.cxx:84
 TGLHistPainter.cxx:85
 TGLHistPainter.cxx:86
 TGLHistPainter.cxx:87
 TGLHistPainter.cxx:88
 TGLHistPainter.cxx:89
 TGLHistPainter.cxx:90
 TGLHistPainter.cxx:91
 TGLHistPainter.cxx:92
 TGLHistPainter.cxx:93
 TGLHistPainter.cxx:94
 TGLHistPainter.cxx:95
 TGLHistPainter.cxx:96
 TGLHistPainter.cxx:97
 TGLHistPainter.cxx:98
 TGLHistPainter.cxx:99
 TGLHistPainter.cxx:100
 TGLHistPainter.cxx:101
 TGLHistPainter.cxx:102
 TGLHistPainter.cxx:103
 TGLHistPainter.cxx:104
 TGLHistPainter.cxx:105
 TGLHistPainter.cxx:106
 TGLHistPainter.cxx:107
 TGLHistPainter.cxx:108
 TGLHistPainter.cxx:109
 TGLHistPainter.cxx:110
 TGLHistPainter.cxx:111
 TGLHistPainter.cxx:112
 TGLHistPainter.cxx:113
 TGLHistPainter.cxx:114
 TGLHistPainter.cxx:115
 TGLHistPainter.cxx:116
 TGLHistPainter.cxx:117
 TGLHistPainter.cxx:118
 TGLHistPainter.cxx:119
 TGLHistPainter.cxx:120
 TGLHistPainter.cxx:121
 TGLHistPainter.cxx:122
 TGLHistPainter.cxx:123
 TGLHistPainter.cxx:124
 TGLHistPainter.cxx:125
 TGLHistPainter.cxx:126
 TGLHistPainter.cxx:127
 TGLHistPainter.cxx:128
 TGLHistPainter.cxx:129
 TGLHistPainter.cxx:130
 TGLHistPainter.cxx:131
 TGLHistPainter.cxx:132
 TGLHistPainter.cxx:133
 TGLHistPainter.cxx:134
 TGLHistPainter.cxx:135
 TGLHistPainter.cxx:136
 TGLHistPainter.cxx:137
 TGLHistPainter.cxx:138
 TGLHistPainter.cxx:139
 TGLHistPainter.cxx:140
 TGLHistPainter.cxx:141
 TGLHistPainter.cxx:142
 TGLHistPainter.cxx:143
 TGLHistPainter.cxx:144
 TGLHistPainter.cxx:145
 TGLHistPainter.cxx:146
 TGLHistPainter.cxx:147
 TGLHistPainter.cxx:148
 TGLHistPainter.cxx:149
 TGLHistPainter.cxx:150
 TGLHistPainter.cxx:151
 TGLHistPainter.cxx:152
 TGLHistPainter.cxx:153
 TGLHistPainter.cxx:154
 TGLHistPainter.cxx:155
 TGLHistPainter.cxx:156
 TGLHistPainter.cxx:157
 TGLHistPainter.cxx:158
 TGLHistPainter.cxx:159
 TGLHistPainter.cxx:160
 TGLHistPainter.cxx:161
 TGLHistPainter.cxx:162
 TGLHistPainter.cxx:163
 TGLHistPainter.cxx:164
 TGLHistPainter.cxx:165
 TGLHistPainter.cxx:166
 TGLHistPainter.cxx:167
 TGLHistPainter.cxx:168
 TGLHistPainter.cxx:169
 TGLHistPainter.cxx:170
 TGLHistPainter.cxx:171
 TGLHistPainter.cxx:172
 TGLHistPainter.cxx:173
 TGLHistPainter.cxx:174
 TGLHistPainter.cxx:175
 TGLHistPainter.cxx:176
 TGLHistPainter.cxx:177
 TGLHistPainter.cxx:178
 TGLHistPainter.cxx:179
 TGLHistPainter.cxx:180
 TGLHistPainter.cxx:181
 TGLHistPainter.cxx:182
 TGLHistPainter.cxx:183
 TGLHistPainter.cxx:184
 TGLHistPainter.cxx:185
 TGLHistPainter.cxx:186
 TGLHistPainter.cxx:187
 TGLHistPainter.cxx:188
 TGLHistPainter.cxx:189
 TGLHistPainter.cxx:190
 TGLHistPainter.cxx:191
 TGLHistPainter.cxx:192
 TGLHistPainter.cxx:193
 TGLHistPainter.cxx:194
 TGLHistPainter.cxx:195
 TGLHistPainter.cxx:196
 TGLHistPainter.cxx:197
 TGLHistPainter.cxx:198
 TGLHistPainter.cxx:199
 TGLHistPainter.cxx:200
 TGLHistPainter.cxx:201
 TGLHistPainter.cxx:202
 TGLHistPainter.cxx:203
 TGLHistPainter.cxx:204
 TGLHistPainter.cxx:205
 TGLHistPainter.cxx:206
 TGLHistPainter.cxx:207
 TGLHistPainter.cxx:208
 TGLHistPainter.cxx:209
 TGLHistPainter.cxx:210
 TGLHistPainter.cxx:211
 TGLHistPainter.cxx:212
 TGLHistPainter.cxx:213
 TGLHistPainter.cxx:214
 TGLHistPainter.cxx:215
 TGLHistPainter.cxx:216
 TGLHistPainter.cxx:217
 TGLHistPainter.cxx:218
 TGLHistPainter.cxx:219
 TGLHistPainter.cxx:220
 TGLHistPainter.cxx:221
 TGLHistPainter.cxx:222
 TGLHistPainter.cxx:223
 TGLHistPainter.cxx:224
 TGLHistPainter.cxx:225
 TGLHistPainter.cxx:226
 TGLHistPainter.cxx:227
 TGLHistPainter.cxx:228
 TGLHistPainter.cxx:229
 TGLHistPainter.cxx:230
 TGLHistPainter.cxx:231
 TGLHistPainter.cxx:232
 TGLHistPainter.cxx:233
 TGLHistPainter.cxx:234
 TGLHistPainter.cxx:235
 TGLHistPainter.cxx:236
 TGLHistPainter.cxx:237
 TGLHistPainter.cxx:238
 TGLHistPainter.cxx:239
 TGLHistPainter.cxx:240
 TGLHistPainter.cxx:241
 TGLHistPainter.cxx:242
 TGLHistPainter.cxx:243
 TGLHistPainter.cxx:244
 TGLHistPainter.cxx:245
 TGLHistPainter.cxx:246
 TGLHistPainter.cxx:247
 TGLHistPainter.cxx:248
 TGLHistPainter.cxx:249
 TGLHistPainter.cxx:250
 TGLHistPainter.cxx:251
 TGLHistPainter.cxx:252
 TGLHistPainter.cxx:253
 TGLHistPainter.cxx:254
 TGLHistPainter.cxx:255
 TGLHistPainter.cxx:256
 TGLHistPainter.cxx:257
 TGLHistPainter.cxx:258
 TGLHistPainter.cxx:259
 TGLHistPainter.cxx:260
 TGLHistPainter.cxx:261
 TGLHistPainter.cxx:262
 TGLHistPainter.cxx:263
 TGLHistPainter.cxx:264
 TGLHistPainter.cxx:265
 TGLHistPainter.cxx:266
 TGLHistPainter.cxx:267
 TGLHistPainter.cxx:268
 TGLHistPainter.cxx:269
 TGLHistPainter.cxx:270
 TGLHistPainter.cxx:271
 TGLHistPainter.cxx:272
 TGLHistPainter.cxx:273
 TGLHistPainter.cxx:274
 TGLHistPainter.cxx:275
 TGLHistPainter.cxx:276
 TGLHistPainter.cxx:277
 TGLHistPainter.cxx:278
 TGLHistPainter.cxx:279
 TGLHistPainter.cxx:280
 TGLHistPainter.cxx:281
 TGLHistPainter.cxx:282
 TGLHistPainter.cxx:283
 TGLHistPainter.cxx:284
 TGLHistPainter.cxx:285
 TGLHistPainter.cxx:286
 TGLHistPainter.cxx:287
 TGLHistPainter.cxx:288
 TGLHistPainter.cxx:289
 TGLHistPainter.cxx:290
 TGLHistPainter.cxx:291
 TGLHistPainter.cxx:292
 TGLHistPainter.cxx:293
 TGLHistPainter.cxx:294
 TGLHistPainter.cxx:295
 TGLHistPainter.cxx:296
 TGLHistPainter.cxx:297
 TGLHistPainter.cxx:298
 TGLHistPainter.cxx:299
 TGLHistPainter.cxx:300
 TGLHistPainter.cxx:301
 TGLHistPainter.cxx:302
 TGLHistPainter.cxx:303
 TGLHistPainter.cxx:304
 TGLHistPainter.cxx:305
 TGLHistPainter.cxx:306
 TGLHistPainter.cxx:307
 TGLHistPainter.cxx:308
 TGLHistPainter.cxx:309
 TGLHistPainter.cxx:310
 TGLHistPainter.cxx:311
 TGLHistPainter.cxx:312
 TGLHistPainter.cxx:313
 TGLHistPainter.cxx:314
 TGLHistPainter.cxx:315
 TGLHistPainter.cxx:316
 TGLHistPainter.cxx:317
 TGLHistPainter.cxx:318
 TGLHistPainter.cxx:319
 TGLHistPainter.cxx:320
 TGLHistPainter.cxx:321
 TGLHistPainter.cxx:322
 TGLHistPainter.cxx:323
 TGLHistPainter.cxx:324
 TGLHistPainter.cxx:325
 TGLHistPainter.cxx:326
 TGLHistPainter.cxx:327
 TGLHistPainter.cxx:328
 TGLHistPainter.cxx:329
 TGLHistPainter.cxx:330
 TGLHistPainter.cxx:331
 TGLHistPainter.cxx:332
 TGLHistPainter.cxx:333
 TGLHistPainter.cxx:334
 TGLHistPainter.cxx:335
 TGLHistPainter.cxx:336
 TGLHistPainter.cxx:337
 TGLHistPainter.cxx:338
 TGLHistPainter.cxx:339
 TGLHistPainter.cxx:340
 TGLHistPainter.cxx:341
 TGLHistPainter.cxx:342
 TGLHistPainter.cxx:343
 TGLHistPainter.cxx:344
 TGLHistPainter.cxx:345
 TGLHistPainter.cxx:346
 TGLHistPainter.cxx:347
 TGLHistPainter.cxx:348
 TGLHistPainter.cxx:349
 TGLHistPainter.cxx:350
 TGLHistPainter.cxx:351
 TGLHistPainter.cxx:352
 TGLHistPainter.cxx:353
 TGLHistPainter.cxx:354
 TGLHistPainter.cxx:355
 TGLHistPainter.cxx:356
 TGLHistPainter.cxx:357
 TGLHistPainter.cxx:358
 TGLHistPainter.cxx:359
 TGLHistPainter.cxx:360
 TGLHistPainter.cxx:361
 TGLHistPainter.cxx:362
 TGLHistPainter.cxx:363
 TGLHistPainter.cxx:364
 TGLHistPainter.cxx:365
 TGLHistPainter.cxx:366
 TGLHistPainter.cxx:367
 TGLHistPainter.cxx:368
 TGLHistPainter.cxx:369
 TGLHistPainter.cxx:370
 TGLHistPainter.cxx:371
 TGLHistPainter.cxx:372
 TGLHistPainter.cxx:373
 TGLHistPainter.cxx:374
 TGLHistPainter.cxx:375
 TGLHistPainter.cxx:376
 TGLHistPainter.cxx:377
 TGLHistPainter.cxx:378
 TGLHistPainter.cxx:379
 TGLHistPainter.cxx:380
 TGLHistPainter.cxx:381
 TGLHistPainter.cxx:382
 TGLHistPainter.cxx:383
 TGLHistPainter.cxx:384
 TGLHistPainter.cxx:385
 TGLHistPainter.cxx:386
 TGLHistPainter.cxx:387
 TGLHistPainter.cxx:388
 TGLHistPainter.cxx:389
 TGLHistPainter.cxx:390
 TGLHistPainter.cxx:391
 TGLHistPainter.cxx:392
 TGLHistPainter.cxx:393
 TGLHistPainter.cxx:394
 TGLHistPainter.cxx:395
 TGLHistPainter.cxx:396
 TGLHistPainter.cxx:397
 TGLHistPainter.cxx:398
 TGLHistPainter.cxx:399
 TGLHistPainter.cxx:400
 TGLHistPainter.cxx:401
 TGLHistPainter.cxx:402
 TGLHistPainter.cxx:403
 TGLHistPainter.cxx:404
 TGLHistPainter.cxx:405
 TGLHistPainter.cxx:406
 TGLHistPainter.cxx:407
 TGLHistPainter.cxx:408
 TGLHistPainter.cxx:409
 TGLHistPainter.cxx:410
 TGLHistPainter.cxx:411
 TGLHistPainter.cxx:412
 TGLHistPainter.cxx:413
 TGLHistPainter.cxx:414
 TGLHistPainter.cxx:415
 TGLHistPainter.cxx:416
 TGLHistPainter.cxx:417
 TGLHistPainter.cxx:418
 TGLHistPainter.cxx:419
 TGLHistPainter.cxx:420
 TGLHistPainter.cxx:421
 TGLHistPainter.cxx:422
 TGLHistPainter.cxx:423
 TGLHistPainter.cxx:424
 TGLHistPainter.cxx:425
 TGLHistPainter.cxx:426
 TGLHistPainter.cxx:427
 TGLHistPainter.cxx:428
 TGLHistPainter.cxx:429
 TGLHistPainter.cxx:430
 TGLHistPainter.cxx:431
 TGLHistPainter.cxx:432
 TGLHistPainter.cxx:433
 TGLHistPainter.cxx:434
 TGLHistPainter.cxx:435
 TGLHistPainter.cxx:436
 TGLHistPainter.cxx:437
 TGLHistPainter.cxx:438
 TGLHistPainter.cxx:439
 TGLHistPainter.cxx:440
 TGLHistPainter.cxx:441
 TGLHistPainter.cxx:442
 TGLHistPainter.cxx:443
 TGLHistPainter.cxx:444
 TGLHistPainter.cxx:445
 TGLHistPainter.cxx:446
 TGLHistPainter.cxx:447
 TGLHistPainter.cxx:448
 TGLHistPainter.cxx:449
 TGLHistPainter.cxx:450
 TGLHistPainter.cxx:451
 TGLHistPainter.cxx:452
 TGLHistPainter.cxx:453
 TGLHistPainter.cxx:454
 TGLHistPainter.cxx:455
 TGLHistPainter.cxx:456
 TGLHistPainter.cxx:457
 TGLHistPainter.cxx:458
 TGLHistPainter.cxx:459
 TGLHistPainter.cxx:460
 TGLHistPainter.cxx:461
 TGLHistPainter.cxx:462
 TGLHistPainter.cxx:463
 TGLHistPainter.cxx:464
 TGLHistPainter.cxx:465
 TGLHistPainter.cxx:466
 TGLHistPainter.cxx:467
 TGLHistPainter.cxx:468
 TGLHistPainter.cxx:469
 TGLHistPainter.cxx:470
 TGLHistPainter.cxx:471
 TGLHistPainter.cxx:472
 TGLHistPainter.cxx:473
 TGLHistPainter.cxx:474
 TGLHistPainter.cxx:475
 TGLHistPainter.cxx:476
 TGLHistPainter.cxx:477
 TGLHistPainter.cxx:478
 TGLHistPainter.cxx:479
 TGLHistPainter.cxx:480
 TGLHistPainter.cxx:481
 TGLHistPainter.cxx:482
 TGLHistPainter.cxx:483
 TGLHistPainter.cxx:484
 TGLHistPainter.cxx:485
 TGLHistPainter.cxx:486
 TGLHistPainter.cxx:487
 TGLHistPainter.cxx:488
 TGLHistPainter.cxx:489
 TGLHistPainter.cxx:490
 TGLHistPainter.cxx:491
 TGLHistPainter.cxx:492
 TGLHistPainter.cxx:493
 TGLHistPainter.cxx:494
 TGLHistPainter.cxx:495
 TGLHistPainter.cxx:496
 TGLHistPainter.cxx:497
 TGLHistPainter.cxx:498
 TGLHistPainter.cxx:499
 TGLHistPainter.cxx:500
 TGLHistPainter.cxx:501
 TGLHistPainter.cxx:502
 TGLHistPainter.cxx:503
 TGLHistPainter.cxx:504
 TGLHistPainter.cxx:505
 TGLHistPainter.cxx:506
 TGLHistPainter.cxx:507
 TGLHistPainter.cxx:508
 TGLHistPainter.cxx:509
 TGLHistPainter.cxx:510
 TGLHistPainter.cxx:511
 TGLHistPainter.cxx:512
 TGLHistPainter.cxx:513
 TGLHistPainter.cxx:514
 TGLHistPainter.cxx:515
 TGLHistPainter.cxx:516
 TGLHistPainter.cxx:517
 TGLHistPainter.cxx:518
 TGLHistPainter.cxx:519
 TGLHistPainter.cxx:520
 TGLHistPainter.cxx:521
 TGLHistPainter.cxx:522
 TGLHistPainter.cxx:523
 TGLHistPainter.cxx:524
 TGLHistPainter.cxx:525
 TGLHistPainter.cxx:526
 TGLHistPainter.cxx:527
 TGLHistPainter.cxx:528
 TGLHistPainter.cxx:529
 TGLHistPainter.cxx:530
 TGLHistPainter.cxx:531
 TGLHistPainter.cxx:532
 TGLHistPainter.cxx:533
 TGLHistPainter.cxx:534
 TGLHistPainter.cxx:535
 TGLHistPainter.cxx:536
 TGLHistPainter.cxx:537
 TGLHistPainter.cxx:538
 TGLHistPainter.cxx:539
 TGLHistPainter.cxx:540
 TGLHistPainter.cxx:541
 TGLHistPainter.cxx:542
 TGLHistPainter.cxx:543
 TGLHistPainter.cxx:544
 TGLHistPainter.cxx:545
 TGLHistPainter.cxx:546
 TGLHistPainter.cxx:547
 TGLHistPainter.cxx:548
 TGLHistPainter.cxx:549
 TGLHistPainter.cxx:550
 TGLHistPainter.cxx:551
 TGLHistPainter.cxx:552
 TGLHistPainter.cxx:553
 TGLHistPainter.cxx:554
 TGLHistPainter.cxx:555
 TGLHistPainter.cxx:556
 TGLHistPainter.cxx:557
 TGLHistPainter.cxx:558
 TGLHistPainter.cxx:559
 TGLHistPainter.cxx:560
 TGLHistPainter.cxx:561
 TGLHistPainter.cxx:562
 TGLHistPainter.cxx:563
 TGLHistPainter.cxx:564
 TGLHistPainter.cxx:565
 TGLHistPainter.cxx:566
 TGLHistPainter.cxx:567
 TGLHistPainter.cxx:568
 TGLHistPainter.cxx:569
 TGLHistPainter.cxx:570
 TGLHistPainter.cxx:571
 TGLHistPainter.cxx:572
 TGLHistPainter.cxx:573
 TGLHistPainter.cxx:574
 TGLHistPainter.cxx:575
 TGLHistPainter.cxx:576
 TGLHistPainter.cxx:577
 TGLHistPainter.cxx:578
 TGLHistPainter.cxx:579
 TGLHistPainter.cxx:580
 TGLHistPainter.cxx:581
 TGLHistPainter.cxx:582
 TGLHistPainter.cxx:583
 TGLHistPainter.cxx:584
 TGLHistPainter.cxx:585
 TGLHistPainter.cxx:586
 TGLHistPainter.cxx:587
 TGLHistPainter.cxx:588
 TGLHistPainter.cxx:589
 TGLHistPainter.cxx:590
 TGLHistPainter.cxx:591
 TGLHistPainter.cxx:592
 TGLHistPainter.cxx:593
 TGLHistPainter.cxx:594
 TGLHistPainter.cxx:595
 TGLHistPainter.cxx:596
 TGLHistPainter.cxx:597
 TGLHistPainter.cxx:598
 TGLHistPainter.cxx:599
 TGLHistPainter.cxx:600
 TGLHistPainter.cxx:601
 TGLHistPainter.cxx:602
 TGLHistPainter.cxx:603
 TGLHistPainter.cxx:604
 TGLHistPainter.cxx:605
 TGLHistPainter.cxx:606
 TGLHistPainter.cxx:607
 TGLHistPainter.cxx:608
 TGLHistPainter.cxx:609
 TGLHistPainter.cxx:610
 TGLHistPainter.cxx:611
 TGLHistPainter.cxx:612
 TGLHistPainter.cxx:613
 TGLHistPainter.cxx:614
 TGLHistPainter.cxx:615
 TGLHistPainter.cxx:616
 TGLHistPainter.cxx:617
 TGLHistPainter.cxx:618
 TGLHistPainter.cxx:619
 TGLHistPainter.cxx:620
 TGLHistPainter.cxx:621
 TGLHistPainter.cxx:622
 TGLHistPainter.cxx:623
 TGLHistPainter.cxx:624
 TGLHistPainter.cxx:625
 TGLHistPainter.cxx:626
 TGLHistPainter.cxx:627
 TGLHistPainter.cxx:628
 TGLHistPainter.cxx:629
 TGLHistPainter.cxx:630
 TGLHistPainter.cxx:631
 TGLHistPainter.cxx:632
 TGLHistPainter.cxx:633
 TGLHistPainter.cxx:634
 TGLHistPainter.cxx:635
 TGLHistPainter.cxx:636
 TGLHistPainter.cxx:637
 TGLHistPainter.cxx:638
 TGLHistPainter.cxx:639
 TGLHistPainter.cxx:640
 TGLHistPainter.cxx:641
 TGLHistPainter.cxx:642
 TGLHistPainter.cxx:643
 TGLHistPainter.cxx:644
 TGLHistPainter.cxx:645
 TGLHistPainter.cxx:646
 TGLHistPainter.cxx:647
 TGLHistPainter.cxx:648
 TGLHistPainter.cxx:649
 TGLHistPainter.cxx:650
 TGLHistPainter.cxx:651
 TGLHistPainter.cxx:652
 TGLHistPainter.cxx:653
 TGLHistPainter.cxx:654
 TGLHistPainter.cxx:655
 TGLHistPainter.cxx:656
 TGLHistPainter.cxx:657
 TGLHistPainter.cxx:658
 TGLHistPainter.cxx:659
 TGLHistPainter.cxx:660
 TGLHistPainter.cxx:661
 TGLHistPainter.cxx:662
 TGLHistPainter.cxx:663
 TGLHistPainter.cxx:664
 TGLHistPainter.cxx:665
 TGLHistPainter.cxx:666
 TGLHistPainter.cxx:667
 TGLHistPainter.cxx:668
 TGLHistPainter.cxx:669
 TGLHistPainter.cxx:670
 TGLHistPainter.cxx:671
 TGLHistPainter.cxx:672
 TGLHistPainter.cxx:673
 TGLHistPainter.cxx:674
 TGLHistPainter.cxx:675
 TGLHistPainter.cxx:676
 TGLHistPainter.cxx:677
 TGLHistPainter.cxx:678
 TGLHistPainter.cxx:679
 TGLHistPainter.cxx:680
 TGLHistPainter.cxx:681
 TGLHistPainter.cxx:682
 TGLHistPainter.cxx:683
 TGLHistPainter.cxx:684
 TGLHistPainter.cxx:685
 TGLHistPainter.cxx:686
 TGLHistPainter.cxx:687
 TGLHistPainter.cxx:688
 TGLHistPainter.cxx:689
 TGLHistPainter.cxx:690
 TGLHistPainter.cxx:691
 TGLHistPainter.cxx:692
 TGLHistPainter.cxx:693
 TGLHistPainter.cxx:694
 TGLHistPainter.cxx:695
 TGLHistPainter.cxx:696
 TGLHistPainter.cxx:697
 TGLHistPainter.cxx:698
 TGLHistPainter.cxx:699
 TGLHistPainter.cxx:700
 TGLHistPainter.cxx:701
 TGLHistPainter.cxx:702
 TGLHistPainter.cxx:703
 TGLHistPainter.cxx:704
 TGLHistPainter.cxx:705
 TGLHistPainter.cxx:706
 TGLHistPainter.cxx:707
 TGLHistPainter.cxx:708
 TGLHistPainter.cxx:709
 TGLHistPainter.cxx:710
 TGLHistPainter.cxx:711
 TGLHistPainter.cxx:712
 TGLHistPainter.cxx:713
 TGLHistPainter.cxx:714
 TGLHistPainter.cxx:715
 TGLHistPainter.cxx:716
 TGLHistPainter.cxx:717
 TGLHistPainter.cxx:718
 TGLHistPainter.cxx:719
 TGLHistPainter.cxx:720
 TGLHistPainter.cxx:721
 TGLHistPainter.cxx:722
 TGLHistPainter.cxx:723
 TGLHistPainter.cxx:724
 TGLHistPainter.cxx:725
 TGLHistPainter.cxx:726
 TGLHistPainter.cxx:727
 TGLHistPainter.cxx:728
 TGLHistPainter.cxx:729
 TGLHistPainter.cxx:730
 TGLHistPainter.cxx:731
 TGLHistPainter.cxx:732
 TGLHistPainter.cxx:733
 TGLHistPainter.cxx:734
 TGLHistPainter.cxx:735
 TGLHistPainter.cxx:736
 TGLHistPainter.cxx:737
 TGLHistPainter.cxx:738
 TGLHistPainter.cxx:739
 TGLHistPainter.cxx:740
 TGLHistPainter.cxx:741
 TGLHistPainter.cxx:742
 TGLHistPainter.cxx:743
 TGLHistPainter.cxx:744
 TGLHistPainter.cxx:745
 TGLHistPainter.cxx:746
 TGLHistPainter.cxx:747
 TGLHistPainter.cxx:748
 TGLHistPainter.cxx:749
 TGLHistPainter.cxx:750
 TGLHistPainter.cxx:751
 TGLHistPainter.cxx:752
 TGLHistPainter.cxx:753
 TGLHistPainter.cxx:754
 TGLHistPainter.cxx:755
 TGLHistPainter.cxx:756
 TGLHistPainter.cxx:757
 TGLHistPainter.cxx:758
 TGLHistPainter.cxx:759