// @(#)root/gl:$Id$
// Author:  Timur Pocheptsov  06/05/2009

/*************************************************************************
 * Copyright (C) 1995-2009, 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 <cassert>
#include <limits>
#include <memory>
#include <vector>

#include "TAttMarker.h"
#include "TObjArray.h"
#include "TVirtualX.h"
#include "TError.h"
#include "TImage.h"
#include "TROOT.h"
#include "TPad.h"

#include "TColorGradient.h"
#include "TGLPadPainter.h"
#include "TGLIncludes.h"
#include "TGLUtil.h"
#include "TError.h"
#include "TMath.h"

namespace {

//______________________________________________________________________________
bool IsGradientFill(Color_t fillColorIndex)
{
   //Not a bad idea to assert on gVirtualX != nullptr
   return dynamic_cast<TColorGradient *>(gROOT->GetColor(fillColorIndex));
}

}

//______________________________________________________________________________
   //"Delegating" part of TGLPadPainter. Line/fill/etc. attributes can be
   //set inside TPad, but not only there:
   //many of them are set by base sub-objects of 2d primitives
   //(2d primitives usually inherit TAttLine or TAttFill etc.).  And these sub-objects
   //call gVirtualX->SetLineWidth ... etc. So, if I save some attributes in my painter,
   //it will be mess - at any moment I do not know, where to take line attribute - from
   //gVirtualX or from my own member. So! All attributed, _ALL_ go to/from gVirtualX.

ClassImp(TGLPadPainter)

//______________________________________________________________________________
TGLPadPainter::TGLPadPainter()
                  : fIsHollowArea(kFALSE),
                    fLocked(kTRUE)
{
   fVp[0] = fVp[1] = fVp[2] = fVp[3] = 0;
}


//______________________________________________________________________________
Color_t TGLPadPainter::GetLineColor() const
{
   //Delegate to gVirtualX.
   return gVirtualX->GetLineColor();
}

//______________________________________________________________________________
Style_t TGLPadPainter::GetLineStyle() const
{
   //Delegate to gVirtualX.
   return gVirtualX->GetLineStyle();
}

//______________________________________________________________________________
Width_t TGLPadPainter::GetLineWidth() const
{
   //Delegate to gVirtualX.
   return gVirtualX->GetLineWidth();
}

//______________________________________________________________________________
void TGLPadPainter::SetLineColor(Color_t lcolor)
{
   //Delegate to gVirtualX.
   gVirtualX->SetLineColor(lcolor);
}

//______________________________________________________________________________
void TGLPadPainter::SetLineStyle(Style_t lstyle)
{
   //Delegate to gVirtualX.
   gVirtualX->SetLineStyle(lstyle);
}

//______________________________________________________________________________
void TGLPadPainter::SetLineWidth(Width_t lwidth)
{
   //Delegate to gVirtualX.
   gVirtualX->SetLineWidth(lwidth);
}

//______________________________________________________________________________
Color_t TGLPadPainter::GetFillColor() const
{
   //Delegate to gVirtualX.
   return gVirtualX->GetFillColor();
}

//______________________________________________________________________________
Style_t TGLPadPainter::GetFillStyle() const
{
   //Delegate to gVirtualX.
   return gVirtualX->GetFillStyle();
}

//______________________________________________________________________________
Bool_t TGLPadPainter::IsTransparent() const
{
   //Delegate to gVirtualX.
   //IsTransparent is implemented as inline function in TAttFill.
   return gVirtualX->IsTransparent();
}

//______________________________________________________________________________
void TGLPadPainter::SetFillColor(Color_t fcolor)
{
   //Delegate to gVirtualX.
   gVirtualX->SetFillColor(fcolor);
}

//______________________________________________________________________________
void TGLPadPainter::SetFillStyle(Style_t fstyle)
{
   //Delegate to gVirtualX.
   gVirtualX->SetFillStyle(fstyle);
}

//______________________________________________________________________________
void TGLPadPainter::SetOpacity(Int_t percent)
{
   //Delegate to gVirtualX.
   gVirtualX->SetOpacity(percent);
}

//______________________________________________________________________________
Short_t TGLPadPainter::GetTextAlign() const
{
   //Delegate to gVirtualX.
   return gVirtualX->GetTextAlign();
}

//______________________________________________________________________________
Float_t TGLPadPainter::GetTextAngle() const
{
   //Delegate to gVirtualX.
   return gVirtualX->GetTextAngle();
}

//______________________________________________________________________________
Color_t TGLPadPainter::GetTextColor() const
{
   //Delegate to gVirtualX.
   return gVirtualX->GetTextColor();
}

//______________________________________________________________________________
Font_t TGLPadPainter::GetTextFont() const
{
   //Delegate to gVirtualX.
   return gVirtualX->GetTextFont();
}

//______________________________________________________________________________
Float_t TGLPadPainter::GetTextSize() const
{
   //Delegate to gVirtualX.
   return gVirtualX->GetTextSize();
}

//______________________________________________________________________________
Float_t TGLPadPainter::GetTextMagnitude() const
{
   //Delegate to gVirtualX.
   return gVirtualX->GetTextMagnitude();
}

//______________________________________________________________________________
void TGLPadPainter::SetTextAlign(Short_t align)
{
   //Delegate to gVirtualX.
   gVirtualX->SetTextAlign(align);
}

//______________________________________________________________________________
void TGLPadPainter::SetTextAngle(Float_t tangle)
{
   //Delegate to gVirtualX.
   gVirtualX->SetTextAngle(tangle);
}

//______________________________________________________________________________
void TGLPadPainter::SetTextColor(Color_t tcolor)
{
   //Delegate to gVirtualX.
   gVirtualX->SetTextColor(tcolor);
}

//______________________________________________________________________________
void TGLPadPainter::SetTextFont(Font_t tfont)
{
   //Delegate to gVirtualX.
   gVirtualX->SetTextFont(tfont);
}

//______________________________________________________________________________
void TGLPadPainter::SetTextSize(Float_t tsize)
{
   //Delegate to gVirtualX.
   gVirtualX->SetTextSize(tsize);
}

//______________________________________________________________________________
void TGLPadPainter::SetTextSizePixels(Int_t npixels)
{
   //Delegate to gVirtualX.
   gVirtualX->SetTextSizePixels(npixels);
}

/*
"Pixmap" part of TGLPadPainter.
*/

//______________________________________________________________________________
Int_t TGLPadPainter::CreateDrawable(UInt_t/*w*/, UInt_t/*h*/)
{
   //Not required at the moment.
   return 0;
}

//______________________________________________________________________________
void TGLPadPainter::ClearDrawable()
{
   //Not required at the moment.
}

//______________________________________________________________________________
void TGLPadPainter::CopyDrawable(Int_t /*id*/, Int_t /*px*/, Int_t /*py*/)
{
   //Not required at the moment.
}

//______________________________________________________________________________
void TGLPadPainter::DestroyDrawable()
{
   //Not required at the moment.
}

//______________________________________________________________________________
void TGLPadPainter::SelectDrawable(Int_t /*device*/)
{
   //For gVirtualX this means select pixmap (or window)
   //and all subsequent drawings will go into
   //this pixmap. For OpenGL this means the change of
   //coordinate system and viewport.

   if (fLocked)
      return;

   if (TPad *pad = dynamic_cast<TPad *>(gPad)) {
      Int_t px = 0, py = 0;

      pad->XYtoAbsPixel(pad->GetX1(), pad->GetY1(), px, py);

      py = gPad->GetWh() - py;
      //
      TGLUtil::InitializeIfNeeded();
      const Float_t scale = TGLUtil::GetScreenScalingFactor();

      glViewport(GLint(px * scale), GLint(py * scale),
                 GLsizei(gPad->GetWw() * pad->GetAbsWNDC() * scale),
                 GLsizei(gPad->GetWh() * pad->GetAbsHNDC() * scale));

      glMatrixMode(GL_PROJECTION);
      glLoadIdentity();
      glOrtho(pad->GetX1(), pad->GetX2(), pad->GetY1(), pad->GetY2(), -10., 10.);

      glMatrixMode(GL_MODELVIEW);
      glLoadIdentity();
      glTranslated(0., 0., -1.);
   } else {
      ::Error("TGLPadPainter::SelectDrawable",
               "function was called not from TPad or TCanvas code\n");
      throw std::runtime_error("");
   }
}

//______________________________________________________________________________
void TGLPadPainter::InitPainter()
{
   //Init gl-pad painter:
   //1. 2D painter does not use depth test, should not modify
   //   depth-buffer content (except initial cleanup).
   //2. Disable cull face.
   //3. Disable lighting.
   //4. Set viewport (to the whole canvas area).
   //5. Set camera.
   //6. Unlock painter.
   glDisable(GL_DEPTH_TEST);
   glDisable(GL_CULL_FACE);
   glDisable(GL_LIGHTING);

   //Clear the buffer
   glViewport(0, 0, GLsizei(gPad->GetWw()), GLsizei(gPad->GetWh()));

   glDepthMask(GL_TRUE);
   glClearColor(1.,1.,1.,1.);
   glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
   glDepthMask(GL_FALSE);

   glMatrixMode(GL_PROJECTION);
   glLoadIdentity();

   glOrtho(gPad->GetX1(), gPad->GetX2(), gPad->GetY1(), gPad->GetY2(), -10., 10.);

   glMatrixMode(GL_MODELVIEW);
   glLoadIdentity();
   glTranslated(0., 0., -1.);

   fLocked = kFALSE;
}

//______________________________________________________________________________
void TGLPadPainter::InvalidateCS()
{
   //When TPad::Range for gPad is called, projection
   //must be changed in OpenGL.

   if (fLocked) return;

   glMatrixMode(GL_PROJECTION);
   glLoadIdentity();

   glOrtho(gPad->GetX1(), gPad->GetX2(), gPad->GetY1(), gPad->GetY2(), -10., 10.);

   glMatrixMode(GL_MODELVIEW);
}

//______________________________________________________________________________
void TGLPadPainter::LockPainter()
{
   //Locked state of painter means, that
   //GL context can be invalid, so no GL calls
   //can be executed.

   if (fLocked) return;

   glFinish();
   fLocked = kTRUE;
}

/*
2D primitives.
*/

const Double_t lineWidthTS = 3.;

//______________________________________________________________________________
void TGLPadPainter::DrawLine(Double_t x1, Double_t y1, Double_t x2, Double_t y2)
{
   //Draw line segment.

   if (fLocked) {
      //GL pad painter can be called in non-standard situation:
      //not from TPad::Paint, but
      //from TView3D::ExecuteRotateView. This means in fact,
      //that TView3D wants to draw itself in a XOR mode, via
      //gVirtualX.
      if (gVirtualX->GetDrawMode() == TVirtualX::kInvert) {
         gVirtualX->DrawLine(gPad->XtoAbsPixel(x1), gPad->YtoAbsPixel(y1),
                             gPad->XtoAbsPixel(x2), gPad->YtoAbsPixel(y2));
      }

      return;
   }

   const Rgl::Pad::LineAttribSet lineAttribs(kTRUE, gVirtualX->GetLineStyle(), fLimits.GetMaxLineWidth(), kTRUE);

   glBegin(GL_LINES);
   glVertex2d(x1, y1);
   glVertex2d(x2, y2);
   glEnd();

   if (gVirtualX->GetLineWidth() > lineWidthTS) {
      Double_t pointSize = gVirtualX->GetLineWidth();
      if (pointSize > fLimits.GetMaxPointSize())
         pointSize = fLimits.GetMaxPointSize();
      glPointSize((GLfloat)pointSize);
      const TGLEnableGuard pointSmooth(GL_POINT_SMOOTH);
      glHint(GL_POINT_SMOOTH_HINT, GL_NICEST);
      glBegin(GL_POINTS);

      glVertex2d(x1, y1);
      glVertex2d(x2, y2);

      glEnd();
      glPointSize(1.f);
   }

}

//______________________________________________________________________________
void TGLPadPainter::DrawLineNDC(Double_t u1, Double_t v1, Double_t u2, Double_t v2)
{
   //Draw line segment in NDC coordinates.

   if (fLocked) return;

   const Rgl::Pad::LineAttribSet lineAttribs(kTRUE, gVirtualX->GetLineStyle(), fLimits.GetMaxLineWidth(), kTRUE);
   const Double_t xRange = gPad->GetX2() - gPad->GetX1();
   const Double_t yRange = gPad->GetY2() - gPad->GetY1();

   glBegin(GL_LINES);
   glVertex2d(gPad->GetX1() + u1 * xRange, gPad->GetY1() + v1 * yRange);
   glVertex2d(gPad->GetX1() + u2 * xRange, gPad->GetY1() + v2 * yRange);
   glEnd();
}

//______________________________________________________________________________
void TGLPadPainter::DrawBox(Double_t x1, Double_t y1, Double_t x2, Double_t y2, EBoxMode mode)
{
   //Draw filled or hollow box.

   if (fLocked) return;

   if (IsGradientFill(gVirtualX->GetFillColor())) {
      Double_t xs[] = {x1, x2, x2, x1};
      Double_t ys[] = {y1, y1, y2, y2};
      DrawPolygonWithGradient(4, xs, ys);
      return;
   }

   if (mode == kHollow) {
      const Rgl::Pad::LineAttribSet lineAttribs(kTRUE, 0, fLimits.GetMaxLineWidth(), kTRUE);
      //
      glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
      glRectd(x1, y1, x2, y2);
      glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
      glLineWidth(1.f);
   } else {
      const Rgl::Pad::FillAttribSet fillAttribs(fSSet, kFALSE);//Set filling parameters.
      glRectd(x1, y1, x2, y2);
   }
}

//______________________________________________________________________________
void TGLPadPainter::DrawFillArea(Int_t n, const Double_t *x, const Double_t *y)
{
   //Draw tesselated polygon (probably, outline only).
   assert(x != 0 && "DrawFillArea, parameter 'x' is null");
   assert(y != 0 && "DrawFillArea, parameter 'y' is null");

   if (fLocked)
      return;

   if (n < 3) {
      ::Error("TGLPadPainter::DrawFillArea",
              "invalid number of points in a polygon");
      return;
   }

   if (IsGradientFill(gVirtualX->GetFillColor()))
      return DrawPolygonWithGradient(n, x, y);

   if (!gVirtualX->GetFillStyle()) {
      fIsHollowArea = kTRUE;
      return DrawPolyLine(n, x, y);
   }

   const Rgl::Pad::FillAttribSet fillAttribs(fSSet, kFALSE);
   DrawTesselation(n, x, y);
}

//______________________________________________________________________________
void TGLPadPainter::DrawFillArea(Int_t n, const Float_t *x, const Float_t *y)
{
   //Draw tesselated polygon (never called, probably, since TPad::PaintFillArea for floats
   //is deprecated).

   if (fLocked) return;

   if (!gVirtualX->GetFillStyle()) {
      fIsHollowArea = kTRUE;
      return DrawPolyLine(n, x, y);
   }

   fVs.resize(n * 3);

   for (Int_t i = 0; i < n; ++i) {
      fVs[i * 3]     = x[i];
      fVs[i * 3 + 1] = y[i];
   }

   const Rgl::Pad::FillAttribSet fillAttribs(fSSet, kFALSE);

   GLUtesselator *t = (GLUtesselator *)fTess.GetTess();
   gluBeginPolygon(t);
   gluNextContour(t, (GLenum)GLU_UNKNOWN);

   for (Int_t i = 0; i < n; ++i)
      gluTessVertex(t, &fVs[i * 3], &fVs[i * 3]);


   gluEndPolygon(t);
}

//______________________________________________________________________________
void TGLPadPainter::DrawPolyLine(Int_t n, const Double_t *x, const Double_t *y)
{
   //Draw poly-line in user coordinates.

   if (fLocked) return;

   const Rgl::Pad::LineAttribSet lineAttribs(kTRUE, gVirtualX->GetLineStyle(), fLimits.GetMaxLineWidth(), kTRUE);

   glBegin(GL_LINE_STRIP);

   for (Int_t i = 0; i < n; ++i)
      glVertex2d(x[i], y[i]);

   if (fIsHollowArea) {
      glVertex2d(x[0], y[0]);
      fIsHollowArea = kFALSE;
   }
   glEnd();

   if (gVirtualX->GetLineWidth() > lineWidthTS) {
      Double_t pointSize = gVirtualX->GetLineWidth();
      if (pointSize > fLimits.GetMaxPointSize())
         pointSize = fLimits.GetMaxPointSize();
      glPointSize((GLfloat)pointSize);
      const TGLEnableGuard pointSmooth(GL_POINT_SMOOTH);
      glHint(GL_POINT_SMOOTH_HINT, GL_NICEST);
      glBegin(GL_POINTS);

      for (Int_t i = 0; i < n; ++i)
         glVertex2d(x[i], y[i]);

      glEnd();
      glPointSize(1.f);
   }
}

//______________________________________________________________________________
void TGLPadPainter::DrawPolyLine(Int_t n, const Float_t *x, const Float_t *y)
{
   //Never called?

   if (fLocked) return;

   const Rgl::Pad::LineAttribSet lineAttribs(kTRUE, gVirtualX->GetLineStyle(), fLimits.GetMaxLineWidth(), kTRUE);

   glBegin(GL_LINE_STRIP);

   for (Int_t i = 0; i < n; ++i)
      glVertex2f(x[i], y[i]);

   if (fIsHollowArea) {
      glVertex2f(x[0], y[0]);
      fIsHollowArea = kFALSE;
   }

   glEnd();
}

//______________________________________________________________________________
void TGLPadPainter::DrawPolyLineNDC(Int_t n, const Double_t *u, const Double_t *v)
{
   //Poly line in NDC.

   if (fLocked) return;

   const Rgl::Pad::LineAttribSet lineAttribs(kTRUE, gVirtualX->GetLineStyle(), fLimits.GetMaxLineWidth(), kTRUE);
   const Double_t xRange = gPad->GetX2() - gPad->GetX1();
   const Double_t yRange = gPad->GetY2() - gPad->GetY1();
   const Double_t x1 = gPad->GetX1(), y1 = gPad->GetY1();

   glBegin(GL_LINE_STRIP);

   for (Int_t i = 0; i < n; ++i)
      glVertex2d(x1 + u[i] * xRange, y1 + v[i] * yRange);

   glEnd();
}

namespace {

//Aux. function.
template<class ValueType>
void ConvertMarkerPoints(Int_t n, const ValueType *x, const ValueType *y, std::vector<TPoint> & dst);

}

//______________________________________________________________________________
void TGLPadPainter::DrawPolyMarker(Int_t n, const Double_t *x, const Double_t *y)
{
   //Poly-marker.

   if (fLocked) return;

   ConvertMarkerPoints(n, x, y, fPoly);
   DrawPolyMarker();
}

//______________________________________________________________________________
void TGLPadPainter::DrawPolyMarker(Int_t n, const Float_t *x, const Float_t *y)
{
   //Poly-marker.

   if (fLocked) return;

   ConvertMarkerPoints(n, x, y, fPoly);
   DrawPolyMarker();
}

//______________________________________________________________________________
void TGLPadPainter::DrawPolyMarker()
{
   //Poly-marker.

   if (fLocked) return;

   SaveProjectionMatrix();
   glLoadIdentity();
   //
   glOrtho(0, gPad->GetAbsWNDC() * gPad->GetWw(), 0, gPad->GetAbsHNDC() * gPad->GetWh(), -10., 10.);
   //
   glMatrixMode(GL_MODELVIEW);
   //
   const TGLEnableGuard blendGuard(GL_BLEND);

   Float_t rgba[4] = {};
   Rgl::Pad::ExtractRGBA(gVirtualX->GetMarkerColor(), rgba);
   glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
   glColor4fv(rgba);

   const TPoint *xy = &fPoly[0];
   const Style_t markerStyle = gVirtualX->GetMarkerStyle();
   const UInt_t n = UInt_t(fPoly.size());
   switch (markerStyle) {
   case kDot:
      fMarker.DrawDot(n, xy);
      break;
   case kPlus:
      fMarker.DrawPlus(n, xy);
      break;
   case kStar:
      fMarker.DrawStar(n, xy);
      break;
   case kCircle:
   case kOpenCircle:
      fMarker.DrawCircle(n, xy);
      break;
   case kMultiply:
      fMarker.DrawX(n, xy);
      break;
   case kFullDotSmall://"Full dot small"
      fMarker.DrawFullDotSmall(n, xy);
      break;
   case kFullDotMedium:
      fMarker.DrawFullDotMedium(n, xy);
      break;
   case kFullDotLarge:
   case kFullCircle:
      fMarker.DrawFullDotLarge(n, xy);
      break;
   case kFullSquare:
      fMarker.DrawFullSquare(n, xy);
      break;
   case kFullTriangleUp:
      fMarker.DrawFullTrianlgeUp(n, xy);
      break;
   case kFullTriangleDown:
      fMarker.DrawFullTrianlgeDown(n, xy);
      break;
   case kOpenSquare:
      glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
      fMarker.DrawFullSquare(n, xy);
      glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
      break;
   case kOpenTriangleUp:
      glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
      fMarker.DrawFullTrianlgeUp(n, xy);
      glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
      break;
   case kOpenDiamond:
      fMarker.DrawDiamond(n, xy);
      break;
   case kOpenCross:
      fMarker.DrawCross(n, xy);
      break;
   case kFullStar:
      fMarker.DrawFullStar(n, xy);
      break;
   case kOpenStar:
      fMarker.DrawOpenStar(n, xy);
   }

   RestoreProjectionMatrix();
   glMatrixMode(GL_MODELVIEW);
}

//______________________________________________________________________________
template<class Char>
void TGLPadPainter::DrawTextHelper(Double_t x, Double_t y, const Char *text, ETextMode /*mode*/)
{
   SaveProjectionMatrix();

   glLoadIdentity();
   //
   glOrtho(0, gPad->GetAbsWNDC() * gPad->GetWw(), 0, gPad->GetAbsHNDC() * gPad->GetWh(), -10., 10.);
   //
   glMatrixMode(GL_MODELVIEW);

   Float_t rgba[4] = {};
   Rgl::Pad::ExtractRGBA(gVirtualX->GetTextColor(), rgba);
   glColor4fv(rgba);

   //10 is the first valid font index.
   //20 is FreeSerifBold, as in TTF.cxx and in TGLFontManager.cxx.
   //shift - is the shift to access "extended" fonts.
   const Int_t shift = TGLFontManager::GetExtendedFontStartIndex();

   Int_t fontIndex = TMath::Max(Short_t(10), gVirtualX->GetTextFont());
   if (fontIndex / 10 + shift > TGLFontManager::GetFontFileArray()->GetEntries())
      fontIndex = 20 + shift * 10;
   else
      fontIndex += shift * 10;

   fFM.RegisterFont(TMath::Max(Int_t(gVirtualX->GetTextSize()) - 1, 10),//kTexture does not work if size < 10.
                               TGLFontManager::GetFontNameFromId(fontIndex),
                               TGLFont::kTexture, fF);
   fF.PreRender();

   const UInt_t padH = UInt_t(gPad->GetAbsHNDC() * gPad->GetWh());
   fF.Render(text, gPad->XtoPixel(x), padH - gPad->YtoPixel(y), GetTextAngle(), GetTextMagnitude());

   fF.PostRender();
   RestoreProjectionMatrix();

   glMatrixMode(GL_MODELVIEW);
}

//______________________________________________________________________________
void TGLPadPainter::DrawText(Double_t x, Double_t y, const char *text, ETextMode mode)
{
   //Draw text. This operation is especially
   //dangerous if in locked state -
   //ftgl will assert on zero texture size
   //(which is result of bad GL context).

   if (fLocked) return;

   if (!gVirtualX->GetTextSize())
      return;

   DrawTextHelper(x, y, text, mode);
}

//______________________________________________________________________________
void TGLPadPainter::DrawText(Double_t x, Double_t y, const wchar_t *text, ETextMode mode)
{
   //Draw text. This operation is especially
   //dangerous if in locked state -
   //ftgl will assert on zero texture size
   //(which is result of bad GL context).

   if (fLocked) return;

   if (!gVirtualX->GetTextSize())
      return;

   DrawTextHelper(x, y, text, mode);
}

//______________________________________________________________________________
void TGLPadPainter::DrawTextNDC(Double_t u, Double_t v, const char *text, ETextMode mode)
{
   //Draw text in NDC. This operation is especially
   //dangerous if in locked state -
   //ftgl will assert on zero texture size
   //(which is result of bad GL context).

   if (fLocked) return;

   const Double_t xRange = gPad->GetX2() - gPad->GetX1();
   const Double_t yRange = gPad->GetY2() - gPad->GetY1();
   DrawText(gPad->GetX1() + u * xRange, gPad->GetY1() + v * yRange, text, mode);
}

//______________________________________________________________________________
void TGLPadPainter::DrawTextNDC(Double_t u, Double_t v, const wchar_t *text, ETextMode mode)
{
   //Draw text in NDC. This operation is especially
   //dangerous if in locked state -
   //ftgl will assert on zero texture size
   //(which is result of bad GL context).

   if (fLocked) return;

   const Double_t xRange = gPad->GetX2() - gPad->GetX1();
   const Double_t yRange = gPad->GetY2() - gPad->GetY1();
   DrawText(gPad->GetX1() + u * xRange, gPad->GetY1() + v * yRange, text, mode);
}

//______________________________________________________________________________
void TGLPadPainter::SaveProjectionMatrix()const
{
   //Save the projection matrix.
   //Attention! GL_PROJECTION will become the current matrix
   //after this call!
   glMatrixMode(GL_PROJECTION);
   glPushMatrix();
}

//______________________________________________________________________________
void TGLPadPainter::RestoreProjectionMatrix()const
{
   //Restore the projection matrix.
   //Attention! GL_PROJECTION will become the current matrix
   //after this call!
   glMatrixMode(GL_PROJECTION);
   glPopMatrix();
}

//______________________________________________________________________________
void TGLPadPainter::SaveModelviewMatrix()const
{
   //Save the modelview matrix.
   //Attention! GL_MODELVIEW will become the current matrix
   //after this call!
   glMatrixMode(GL_MODELVIEW);
   glPushMatrix();
}

//______________________________________________________________________________
void TGLPadPainter::RestoreModelviewMatrix()const
{
   //Restore the modelview matrix.
   //Attention! GL_MODELVIEW will become the current matrix
   //after this call!
   glMatrixMode(GL_MODELVIEW);
   glPopMatrix();
}

//______________________________________________________________________________
void TGLPadPainter::SaveViewport()
{
   //Extract and save the current viewport.
   glGetIntegerv(GL_VIEWPORT, fVp);
}

//______________________________________________________________________________
void TGLPadPainter::RestoreViewport()
{
   //Restore the saved viewport.
   glViewport(fVp[0], fVp[1], fVp[2], fVp[3]);
}

//______________________________________________________________________________
void TGLPadPainter::SaveImage(TVirtualPad *pad, const char *fileName, Int_t type) const
{
   // Using TImage save frame-buffer contents as a picture.

   TVirtualPad *canvas = (TVirtualPad *)pad->GetCanvas();
   if (!canvas)
      return;

   gROOT->ProcessLine(Form("((TCanvas *)0x%lx)->Flush();", (ULong_t)canvas));

   std::vector<unsigned> buff(canvas->GetWw() * canvas->GetWh());
   glPixelStorei(GL_PACK_ALIGNMENT, 1);
   glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
   //In case GL_BGRA is not in gl.h (old windows' gl) - comment/uncomment lines.
   //glReadPixels(0, 0, canvas->GetWw(), canvas->GetWh(), GL_BGRA, GL_UNSIGNED_BYTE, (char *)&buff[0]);
   glReadPixels(0, 0, canvas->GetWw(), canvas->GetWh(), GL_RGBA, GL_UNSIGNED_BYTE, (char *)&buff[0]);

   std::auto_ptr<TImage> image(TImage::Create());
   if (!image.get()) {
      ::Error("TGLPadPainter::SaveImage", "TImage creation failed");
      return;
   }

   image->DrawRectangle(0, 0, canvas->GetWw(), canvas->GetWh());
   UInt_t *argb = image->GetArgbArray();

   if (!argb) {
      ::Error("TGLPadPainter::SaveImage", "null argb array in TImage object");
      return;
   }

   const Int_t nLines  = canvas->GetWh();
   const Int_t nPixels = canvas->GetWw();

   for (Int_t i = 0; i < nLines; ++i) {
     Int_t base = (nLines - 1 - i) * nPixels;
     for (Int_t j = 0; j < nPixels; ++j, ++base) {
        //Uncomment/comment if you don't have GL_BGRA.

        const UInt_t pix  = buff[base];
        const UInt_t bgra = ((pix & 0xff) << 16) | (pix & 0xff00) |
                            ((pix & 0xff0000) >> 16) | (pix & 0xff000000);

        //argb[i * nPixels + j] = buff[base];
        argb[i * nPixels + j] = bgra;
     }
   }

   image->WriteImage(fileName, (TImage::EImageFileTypes)type);
}

//______________________________________________________________________________
void TGLPadPainter::DrawPixels(const unsigned char *pixelData, UInt_t width, UInt_t height,
                               Int_t dstX, Int_t dstY, Bool_t enableBlending)
{
   if (fLocked)
      return;

   if (!pixelData) {
      //I'd prefer an assert.
      ::Error("TGLPadPainter::DrawPixels", "pixel data is null");
      return;
   }

   if (std::numeric_limits<UInt_t>::digits >= 32) {
      //TASImage uses bit 31 as ...
      //alpha channel flag! FUUUUUUUUUUUUU .....   !!!
      CLRBIT(width, 31);
      CLRBIT(height, 31);
   }

   if (!width) {
      //Assert is better.
      ::Error("TGLPadPainter::DrawPixels", "invalid width");
      return;
   }

   if (!height) {
      //Assert is better.
      ::Error("TGLPadPainter::DrawPixels", "invalid height");
      return;
   }

   if (TPad *pad = dynamic_cast<TPad *>(gPad)) {
      //TASImage passes pixel coordinates in pad's pixmap coordinate space.
      //While glRasterPosX said to work with 'window' coordinates,
      //that's a lie :) it does not :)

      const Double_t rasterX = Double_t(dstX) / (pad->GetAbsWNDC() * pad->GetWw()) *
                                (pad->GetX2() - pad->GetX1()) + pad->GetX1();

      const Double_t yRange = pad->GetY2() - pad->GetY1();
      const Double_t rasterY = yRange - Double_t(dstY + height) / (pad->GetAbsHNDC() * pad->GetWh()) * yRange +
                               pad->GetY1();

      GLdouble oldPos[4] = {};
      //Save the previous raster pos.
      glGetDoublev(GL_CURRENT_RASTER_POSITION, oldPos);

      glRasterPos2d(rasterX, rasterY);
      //Stupid asimage provides us upside-down image.
      std::vector<unsigned char> upsideDownImage(4 * width * height);
      const unsigned char *srcLine = pixelData + 4 * width * (height - 1);
      unsigned char *dstLine = &upsideDownImage[0];
      for (UInt_t i = 0; i < height; ++i, srcLine -= 4 * width, dstLine += 4 * width)
         std::copy(srcLine, srcLine + 4 * width, dstLine);

      if (enableBlending) {
         glEnable(GL_BLEND);
         glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
      }

      glDrawPixels(width, height, GL_BGRA, GL_UNSIGNED_BYTE, &upsideDownImage[0]);

      if (enableBlending)
         glDisable(GL_BLEND);

      //Restore raster pos.
      glRasterPos2d(oldPos[0], oldPos[1]);
   } else
      ::Error("TGLPadPainter::DrawPixels", "no pad found to draw");
}

//Aux. functions - gradient and solid fill of arbitrary area.

//______________________________________________________________________________
void TGLPadPainter::DrawPolygonWithGradient(Int_t n, const Double_t *x, const Double_t *y)
{
   //At the moment I assume both linear and radial gradients will work the same way  -
   //using a stencil buffer and some big rectangle(s) to fill with a gradient.
   //Thus I have a 'common' part - the part responsible for a stencil test.

   assert(n > 2 && "DrawPolygonWithGradient, invalid number of points");
   assert(x != 0 && "DrawPolygonWithGradient, parameter 'x' is null");
   assert(y != 0 && "DrawPolygonWithGradient, parameter 'y' is null");

   assert(dynamic_cast<TColorGradient *>(gROOT->GetColor(gVirtualX->GetFillColor())) != 0 &&
          "DrawPolygonWithGradient, the current fill color is not a gradient fill");
   const TColorGradient * const grad =
         dynamic_cast<TColorGradient *>(gROOT->GetColor(gVirtualX->GetFillColor()));

   if (fLocked)
      return;

   //Now, some magic!
   const TGLEnableGuard stencilGuard(GL_STENCIL_TEST);

   //TODO: check that the state is restored back correctly after
   //      we done with a gradient.
   //TODO: make sure that we have glDepthMask set to false in general!
   glColorMask(GL_FALSE, GL_FALSE, GL_FALSE, GL_FALSE);

   glStencilFunc(GL_NEVER, 1, 0xFF);
   glStencilOp(GL_REPLACE, GL_KEEP, GL_KEEP);// draw 1s on test fail (always)
   //Draw stencil pattern
   glStencilMask(0xFF);
   glClear(GL_STENCIL_BUFFER_BIT);

   //Draw our polygon into the stencil buffer:
   DrawTesselation(n, x, y);

   glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE);
   glStencilMask(0x00);
   //Draw where stencil's value is 0
   glStencilFunc(GL_EQUAL, 0, 0xFF);
   //Draw only where stencil's value is 1
   glStencilFunc(GL_EQUAL, 1, 0xFF);

   //At the moment radial gradient is derived from linear - it was convenient
   //at some point, but in fact it was a bad idea. And now I have to
   //first check radial gradient.
   //TODO: TRadialGradient must inherit TColorGradient directly.
   const TRadialGradient * const rGrad = dynamic_cast<const TRadialGradient *>(grad);
   if (rGrad)
      DrawGradient(rGrad, n, x, y);
   else {
      const TLinearGradient * const lGrad = dynamic_cast<const TLinearGradient *>(grad);
      assert(lGrad != 0 && "DrawPolygonWithGradient, unknown gradient type");
      DrawGradient(lGrad, n, x, y);
   }
}

//______________________________________________________________________________
void TGLPadPainter::DrawGradient(const TRadialGradient *grad, Int_t nPoints,
                                 const Double_t *xs, const Double_t *ys)
{
   assert(grad != 0 && "DrawGradient, parameter 'grad' is null");
   assert(nPoints > 2 && "DrawGradient, invalid number of points");
   assert(xs != 0 && "DrawGradient, parameter 'xs' is null");
   assert(ys != 0 && "DrawGradient, parameter 'ys' is null");

   if (grad->GetGradientType() != TRadialGradient::kSimple) {
      ::Warning("TGLPadPainter::DrawGradient",
                "extended radial gradient is not supported");//yet?
      return;
   }

   //TODO: check the polygon's bbox!
   const auto &bbox = Rgl::Pad::FindBoundingRect(nPoints, xs, ys);
   //
   auto center = grad->GetCenter();
   auto radius = grad->GetRadius();
   //Adjust the center and radius depending on coordinate mode.
   if (grad->GetCoordinateMode() == TColorGradient::kObjectBoundingMode) {
      radius *= TMath::Max(bbox.fWidth, bbox.fHeight);
      center.fX = bbox.fWidth * center.fX + bbox.fXMin;
      center.fY = bbox.fHeight * center.fY + bbox.fYMin;
   } else {
      const auto w = gPad->GetX2() - gPad->GetX1();
      const auto h = gPad->GetY2() - gPad->GetY1();

      radius *= TMath::Max(w, h);
      center.fX *= w;
      center.fY *= h;
   }
   //Now for the gradient fill we switch into pixel coordinates:
   const auto pixelW = gPad->GetAbsWNDC() * gPad->GetWw();
   const auto pixelH = gPad->GetAbsHNDC() * gPad->GetWh();
   //
   SaveProjectionMatrix();
   SaveModelviewMatrix();
   //A new ortho projection:
   glMatrixMode(GL_PROJECTION);
   glLoadIdentity();
   //
   glOrtho(0., pixelW, 0., pixelH, -10., 10.);
   //
   radius *= TMath::Max(pixelH, pixelW);
   center.fX = gPad->XtoPixel(center.fX);
   center.fY = pixelH - gPad->YtoPixel(center.fY);

   Double_t maxR = 0.;
   {
   const Double_t xMin = gPad->XtoPixel(bbox.fXMin);
   const Double_t xMax = gPad->XtoPixel(bbox.fXMax);
   const Double_t yMin = pixelH - gPad->YtoPixel(bbox.fYMin);
   const Double_t yMax = pixelH - gPad->YtoPixel(bbox.fYMax);
   //Get the longest distance from the center to the bounding box vertices
   //(this will be the maximum possible radius):
   const Double_t maxDistX = TMath::Max(TMath::Abs(center.fX - xMin),
                                        TMath::Abs(center.fX - xMax));
   const Double_t maxDistY = TMath::Max(TMath::Abs(center.fY - yMin),
                                        TMath::Abs(center.fY - yMax));
   maxR = TMath::Sqrt(maxDistX * maxDistX + maxDistY * maxDistY);
   }

   //If gradient 'stops inside the polygon', we use
   //the solid fill for the arae outside of radial gradient:
   const Bool_t solidFillAfter = maxR > radius;
   //We emulate a radial gradient using triangles and linear gradient:
   //TODO: Can be something smarter? (btw even 100 seems to be enough)
   const UInt_t nSlices = 500;

   const auto nColors = grad->GetNumberOfSteps();
   //+1 - the strip from the last color's position to radius,
   //and (probably) + 1 for solidFillAfter.
   const auto nCircles = nColors + 1 + solidFillAfter;

   //TODO: can locations be outside of [0., 1.] ???
   //at the moment I assume the answer is NO, NEVER.
   const auto locations = grad->GetColorPositions();
   // * 2 below == x,y
   std::vector<Double_t> circles(nSlices * nCircles * 2);
   const Double_t angle = TMath::TwoPi() / nSlices;

   //"Main" circles (for colors at locations[i]).
   for (UInt_t i = 0; i < nColors; ++i) {
      const auto circle = &circles[i * nSlices * 2];
      //TODO: either check locations here or somewhere else.
      const auto r = radius * locations[i];
      for (UInt_t j = 0, e = nSlices * 2 - 2; j < e; j += 2) {
         circle[j] = center.fX + r * TMath::Cos(angle * j);
         circle[j + 1] = center.fY + r * TMath::Sin(angle * j);
      }
      //The "closing" vertices:
      circle[(nSlices - 1) * 2] = circle[0];
      circle[(nSlices - 1) * 2 + 1] = circle[1];
   }

   {
   //The strip between lastPos and radius:
   const auto circle = &circles[nColors * nSlices * 2];
   for (UInt_t j = 0, e = nSlices * 2 - 2; j < e; j += 2) {
      circle[j] = center.fX + radius * TMath::Cos(angle * j);
      circle[j + 1] = center.fY + radius * TMath::Sin(angle * j);
   }

   circle[(nSlices - 1) * 2] = circle[0];
   circle[(nSlices - 1) * 2 + 1] = circle[1];
   }

   if (solidFillAfter) {
      //The strip after the radius:
      const auto circle = &circles[(nCircles - 1) * nSlices * 2];
      for (UInt_t j = 0, e = nSlices * 2 - 2; j < e; j += 2) {
         circle[j] = center.fX + maxR * TMath::Cos(angle * j);
         circle[j + 1] = center.fY + maxR * TMath::Sin(angle * j);
      }

      circle[(nSlices - 1) * 2] = circle[0];
      circle[(nSlices - 1) * 2 + 1] = circle[1];
   }

   //Now we draw:
   //1) triangle fan in the center (from center to the locations[1],
   //   with a solid fill).
   //2) quad strips for colors.
   //3) additional quad strip from the lastLocation to the radius
   //4) additiona quad strip (if any) from the radius to maxR.

   //RGBA values:
   const auto rgba = grad->GetColors();

   const TGLEnableGuard alphaGuard(GL_BLEND);
   //TODO?
   glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);

   //Probably a degenerated case. Maybe not.
   glBegin(GL_TRIANGLE_FAN);
   glColor4dv(rgba);
   glVertex2d(center.fX, center.fY);

   for (UInt_t i = 0, e = nSlices * 2; i < e; i += 2)
      glVertex2dv(&circles[i]);

   glEnd();

   //No auto for circles, explicit types to have const Double_t * const, not Duble_t * const.
   for (UInt_t i = 0; i < nColors - 1; ++i) {
      const Double_t * const inner = &circles[i * nSlices * 2];
      const auto innerRGBA = rgba + i * 4;
      const auto outerRGBA = rgba + (i + 1) * 4;
      const Double_t * const outer = &circles[(i + 1) * nSlices * 2];

      Rgl::DrawQuadStripWithRadialGradientFill(nSlices, inner, innerRGBA, outer, outerRGBA);
   }

   //Probably degenerated strip.
   {
   glBegin(GL_QUAD_STRIP);
   const Double_t * const inner = &circles[nSlices * (nColors - 1) * 2];
   const auto solidRGBA = rgba + (nColors - 1) * 4;
   const Double_t * const outer = &circles[nSlices * nColors * 2];

   Rgl::DrawQuadStripWithRadialGradientFill(nSlices, inner, solidRGBA, outer, solidRGBA);
   }

   if (solidFillAfter) {
      glBegin(GL_QUAD_STRIP);
      const Double_t * const inner = &circles[nSlices * nColors * 2];
      const auto solidRGBA = rgba + (nColors - 1) * 4;
      const Double_t * const outer = &circles[nSlices * (nColors + 1) * 2];

      Rgl::DrawQuadStripWithRadialGradientFill(nSlices, inner, solidRGBA, outer, solidRGBA);
   }

   RestoreProjectionMatrix();
   RestoreModelviewMatrix();
}

//______________________________________________________________________________
void TGLPadPainter::DrawGradient(const TLinearGradient *grad, Int_t n,
                                 const Double_t *x, const Double_t *y)
{
   assert(grad != 0 && "DrawGradient, parameter 'grad' is null");
   assert(n > 2 && "DrawGradient, invalid number of points");
   assert(x != 0 && "DrawGradient, parameter 'x' is null");
   assert(y != 0 && "DrawGradient, parameter 'y' is null");

   //Now we fill the whole scene with one big rectangle
   //(group of rectangles) with a gradient fill using
   //stencil test.

   //Find a bounding rect.
   const auto &bbox = Rgl::Pad::FindBoundingRect(n, x, y);
   //TODO: check the bbox??

   //For the gradient fill we switch into the
   //pixel coordinates.
   SaveProjectionMatrix();
   SaveModelviewMatrix();

   //A new ortho projection:
   glMatrixMode(GL_PROJECTION);
   glLoadIdentity();

   const Double_t pixelW = gPad->GetAbsWNDC() * gPad->GetWw();
   const Double_t pixelH = gPad->GetAbsHNDC() * gPad->GetWh();
   glOrtho(0., pixelW, 0., pixelH, -10., 10.);

   //A new modelview:
   glMatrixMode(GL_MODELVIEW);
   glLoadIdentity();
   //
   TColorGradient::Point start = grad->GetStart();
   TColorGradient::Point end   = grad->GetEnd();

   //Change gradient coordinates from 'NDC' to pad coords:
   if (grad->GetCoordinateMode() == TColorGradient::kPadMode)
   {
      const Double_t w = gPad->GetX2() - gPad->GetX1();
      const Double_t h = gPad->GetY2() - gPad->GetY1();

      start.fX = start.fX * w;
      start.fY = start.fY * h;
      end.fX   = end.fX * w;
      end.fY   = end.fY * h;
   } else {
      start.fX = start.fX * bbox.fWidth + bbox.fXMin;
      start.fY = start.fY * bbox.fHeight + bbox.fYMin;
      end.fX   = end.fX * bbox.fWidth + bbox.fXMin;
      end.fY   = end.fY * bbox.fHeight + bbox.fYMin;
   }

   //TODO: with a radial fill we'll have to extract the code
   //      below into the separate function/and have additional function
   //      for a radial gradient.
   //Now from pad to pixels:
   start.fX = gPad->XtoPixel(start.fX);
   start.fY = pixelH - gPad->YtoPixel(start.fY);
   end.fX = gPad->XtoPixel(end.fX);
   end.fY = pixelH - gPad->YtoPixel(end.fY);
   const Double_t xMin = gPad->XtoPixel(bbox.fXMin);
   const Double_t xMax = gPad->XtoPixel(bbox.fXMax);
   const Double_t yMin = pixelH - gPad->YtoPixel(bbox.fYMin);
   const Double_t yMax = pixelH - gPad->YtoPixel(bbox.fYMax);
   //

   //TODO: check all calculations!

   //Get the longest distance from the start point to the bounding box vertices:
   const Double_t maxDistX = TMath::Max(TMath::Abs(start.fX - xMin), TMath::Abs(start.fX - xMax));
   const Double_t maxDistY = TMath::Max(TMath::Abs(start.fY - yMin), TMath::Abs(start.fY - yMax));

   const Double_t startEndLength = TMath::Sqrt((end.fX - start.fX) * (end.fX - start.fX) +
                                               (end.fY - start.fY) * (end.fY - start.fY));
   const Double_t h = TMath::Max(TMath::Sqrt(maxDistX * maxDistX + maxDistY * maxDistY),
                                 startEndLength);

   //Boxes with a gradients to emulate gradient fill with many colors:
   const Double_t * const colorPositions = grad->GetColorPositions();
   std::vector<Double_t> gradBoxes(grad->GetNumberOfSteps() + 2);
   gradBoxes[0] = start.fY - h;
   for (unsigned i = 1; i <= grad->GetNumberOfSteps(); ++i)
      gradBoxes[i] = startEndLength * colorPositions[i - 1] + start.fY;

   gradBoxes[grad->GetNumberOfSteps() + 1] = start.fY + h;

   //Rotation angle - gradient's axis:
   Double_t angle = TMath::ACos((startEndLength * (end.fY - start.fY)) /
                                (startEndLength * startEndLength)) * TMath::RadToDeg();
   if (end.fX > start.fX)
      angle *= -1;

   glTranslated(start.fX, start.fY, 0.);
   glRotated(angle, 0., 0., 1.);
   glTranslated(-start.fX, -start.fY, 0.);
   //
   const Double_t * const rgba = grad->GetColors();

   const unsigned nEdges = gradBoxes.size();
   const unsigned nColors = grad->GetNumberOfSteps();
   const Double_t xLeft = start.fX - h, xRight = start.fX + h;

   const TGLEnableGuard alphaGuard(GL_BLEND);
   //TODO?
   glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);

   Rgl::DrawBoxWithGradientFill(gradBoxes[0], gradBoxes[1], xLeft, xRight, rgba, rgba);
   Rgl::DrawBoxWithGradientFill(gradBoxes[nEdges - 2], gradBoxes[nEdges - 1], xLeft, xRight,
                           rgba + (nColors - 1) * 4, rgba + (nColors - 1) * 4);

   for (unsigned i = 1; i < nEdges - 2; ++i)
      Rgl::DrawBoxWithGradientFill(gradBoxes[i], gradBoxes[i + 1], xLeft,
                                   xRight, rgba + (i - 1) * 4, rgba + i * 4);

   RestoreProjectionMatrix();
   RestoreModelviewMatrix();
}

//______________________________________________________________________________
void TGLPadPainter::DrawTesselation(Int_t n, const Double_t *x, const Double_t *y)
{
   assert(n > 2 && "DrawTesselation, invalid number of points");
   assert(x != 0 && "DrawTesselation, parameter 'x' is null");
   assert(y != 0 && "DrawTesselation, parameter 'y' is null");

   //Data for a tesselator:
   fVs.resize(n * 3);

   for (Int_t i = 0; i < n; ++i) {
      fVs[i * 3]     = x[i];
      fVs[i * 3 + 1] = y[i];
      fVs[i * 3 + 2] = 0.;
   }

   //TODO: A very primitive way to tesselate - check what
   //kind of polygons we can really have from TPad/TCanvas.
   GLUtesselator *t = (GLUtesselator *)fTess.GetTess();
   gluBeginPolygon(t);
   gluNextContour(t, (GLenum)GLU_UNKNOWN);

   for (Int_t i = 0; i < n; ++i)
      gluTessVertex(t, &fVs[i * 3], &fVs[i * 3]);

   gluEndPolygon(t);
}


//Aux. functions.
namespace {

template<class ValueType>
void ConvertMarkerPoints(Int_t n, const ValueType *x, const ValueType *y, std::vector<TPoint> & dst)
{
   const UInt_t padH = UInt_t(gPad->GetAbsHNDC() * gPad->GetWh());

   dst.resize(n);
   for (Int_t i = 0; i < n; ++i) {
      dst[i].fX = gPad->XtoPixel(x[i]);
      dst[i].fY = padH - gPad->YtoPixel(y[i]);
   }
}

}

 TGLPadPainter.cxx:1
 TGLPadPainter.cxx:2
 TGLPadPainter.cxx:3
 TGLPadPainter.cxx:4
 TGLPadPainter.cxx:5
 TGLPadPainter.cxx:6
 TGLPadPainter.cxx:7
 TGLPadPainter.cxx:8
 TGLPadPainter.cxx:9
 TGLPadPainter.cxx:10
 TGLPadPainter.cxx:11
 TGLPadPainter.cxx:12
 TGLPadPainter.cxx:13
 TGLPadPainter.cxx:14
 TGLPadPainter.cxx:15
 TGLPadPainter.cxx:16
 TGLPadPainter.cxx:17
 TGLPadPainter.cxx:18
 TGLPadPainter.cxx:19
 TGLPadPainter.cxx:20
 TGLPadPainter.cxx:21
 TGLPadPainter.cxx:22
 TGLPadPainter.cxx:23
 TGLPadPainter.cxx:24
 TGLPadPainter.cxx:25
 TGLPadPainter.cxx:26
 TGLPadPainter.cxx:27
 TGLPadPainter.cxx:28
 TGLPadPainter.cxx:29
 TGLPadPainter.cxx:30
 TGLPadPainter.cxx:31
 TGLPadPainter.cxx:32
 TGLPadPainter.cxx:33
 TGLPadPainter.cxx:34
 TGLPadPainter.cxx:35
 TGLPadPainter.cxx:36
 TGLPadPainter.cxx:37
 TGLPadPainter.cxx:38
 TGLPadPainter.cxx:39
 TGLPadPainter.cxx:40
 TGLPadPainter.cxx:41
 TGLPadPainter.cxx:42
 TGLPadPainter.cxx:43
 TGLPadPainter.cxx:44
 TGLPadPainter.cxx:45
 TGLPadPainter.cxx:46
 TGLPadPainter.cxx:47
 TGLPadPainter.cxx:48
 TGLPadPainter.cxx:49
 TGLPadPainter.cxx:50
 TGLPadPainter.cxx:51
 TGLPadPainter.cxx:52
 TGLPadPainter.cxx:53
 TGLPadPainter.cxx:54
 TGLPadPainter.cxx:55
 TGLPadPainter.cxx:56
 TGLPadPainter.cxx:57
 TGLPadPainter.cxx:58
 TGLPadPainter.cxx:59
 TGLPadPainter.cxx:60
 TGLPadPainter.cxx:61
 TGLPadPainter.cxx:62
 TGLPadPainter.cxx:63
 TGLPadPainter.cxx:64
 TGLPadPainter.cxx:65
 TGLPadPainter.cxx:66
 TGLPadPainter.cxx:67
 TGLPadPainter.cxx:68
 TGLPadPainter.cxx:69
 TGLPadPainter.cxx:70
 TGLPadPainter.cxx:71
 TGLPadPainter.cxx:72
 TGLPadPainter.cxx:73
 TGLPadPainter.cxx:74
 TGLPadPainter.cxx:75
 TGLPadPainter.cxx:76
 TGLPadPainter.cxx:77
 TGLPadPainter.cxx:78
 TGLPadPainter.cxx:79
 TGLPadPainter.cxx:80
 TGLPadPainter.cxx:81
 TGLPadPainter.cxx:82
 TGLPadPainter.cxx:83
 TGLPadPainter.cxx:84
 TGLPadPainter.cxx:85
 TGLPadPainter.cxx:86
 TGLPadPainter.cxx:87
 TGLPadPainter.cxx:88
 TGLPadPainter.cxx:89
 TGLPadPainter.cxx:90
 TGLPadPainter.cxx:91
 TGLPadPainter.cxx:92
 TGLPadPainter.cxx:93
 TGLPadPainter.cxx:94
 TGLPadPainter.cxx:95
 TGLPadPainter.cxx:96
 TGLPadPainter.cxx:97
 TGLPadPainter.cxx:98
 TGLPadPainter.cxx:99
 TGLPadPainter.cxx:100
 TGLPadPainter.cxx:101
 TGLPadPainter.cxx:102
 TGLPadPainter.cxx:103
 TGLPadPainter.cxx:104
 TGLPadPainter.cxx:105
 TGLPadPainter.cxx:106
 TGLPadPainter.cxx:107
 TGLPadPainter.cxx:108
 TGLPadPainter.cxx:109
 TGLPadPainter.cxx:110
 TGLPadPainter.cxx:111
 TGLPadPainter.cxx:112
 TGLPadPainter.cxx:113
 TGLPadPainter.cxx:114
 TGLPadPainter.cxx:115
 TGLPadPainter.cxx:116
 TGLPadPainter.cxx:117
 TGLPadPainter.cxx:118
 TGLPadPainter.cxx:119
 TGLPadPainter.cxx:120
 TGLPadPainter.cxx:121
 TGLPadPainter.cxx:122
 TGLPadPainter.cxx:123
 TGLPadPainter.cxx:124
 TGLPadPainter.cxx:125
 TGLPadPainter.cxx:126
 TGLPadPainter.cxx:127
 TGLPadPainter.cxx:128
 TGLPadPainter.cxx:129
 TGLPadPainter.cxx:130
 TGLPadPainter.cxx:131
 TGLPadPainter.cxx:132
 TGLPadPainter.cxx:133
 TGLPadPainter.cxx:134
 TGLPadPainter.cxx:135
 TGLPadPainter.cxx:136
 TGLPadPainter.cxx:137
 TGLPadPainter.cxx:138
 TGLPadPainter.cxx:139
 TGLPadPainter.cxx:140
 TGLPadPainter.cxx:141
 TGLPadPainter.cxx:142
 TGLPadPainter.cxx:143
 TGLPadPainter.cxx:144
 TGLPadPainter.cxx:145
 TGLPadPainter.cxx:146
 TGLPadPainter.cxx:147
 TGLPadPainter.cxx:148
 TGLPadPainter.cxx:149
 TGLPadPainter.cxx:150
 TGLPadPainter.cxx:151
 TGLPadPainter.cxx:152
 TGLPadPainter.cxx:153
 TGLPadPainter.cxx:154
 TGLPadPainter.cxx:155
 TGLPadPainter.cxx:156
 TGLPadPainter.cxx:157
 TGLPadPainter.cxx:158
 TGLPadPainter.cxx:159
 TGLPadPainter.cxx:160
 TGLPadPainter.cxx:161
 TGLPadPainter.cxx:162
 TGLPadPainter.cxx:163
 TGLPadPainter.cxx:164
 TGLPadPainter.cxx:165
 TGLPadPainter.cxx:166
 TGLPadPainter.cxx:167
 TGLPadPainter.cxx:168
 TGLPadPainter.cxx:169
 TGLPadPainter.cxx:170
 TGLPadPainter.cxx:171
 TGLPadPainter.cxx:172
 TGLPadPainter.cxx:173
 TGLPadPainter.cxx:174
 TGLPadPainter.cxx:175
 TGLPadPainter.cxx:176
 TGLPadPainter.cxx:177
 TGLPadPainter.cxx:178
 TGLPadPainter.cxx:179
 TGLPadPainter.cxx:180
 TGLPadPainter.cxx:181
 TGLPadPainter.cxx:182
 TGLPadPainter.cxx:183
 TGLPadPainter.cxx:184
 TGLPadPainter.cxx:185
 TGLPadPainter.cxx:186
 TGLPadPainter.cxx:187
 TGLPadPainter.cxx:188
 TGLPadPainter.cxx:189
 TGLPadPainter.cxx:190
 TGLPadPainter.cxx:191
 TGLPadPainter.cxx:192
 TGLPadPainter.cxx:193
 TGLPadPainter.cxx:194
 TGLPadPainter.cxx:195
 TGLPadPainter.cxx:196
 TGLPadPainter.cxx:197
 TGLPadPainter.cxx:198
 TGLPadPainter.cxx:199
 TGLPadPainter.cxx:200
 TGLPadPainter.cxx:201
 TGLPadPainter.cxx:202
 TGLPadPainter.cxx:203
 TGLPadPainter.cxx:204
 TGLPadPainter.cxx:205
 TGLPadPainter.cxx:206
 TGLPadPainter.cxx:207
 TGLPadPainter.cxx:208
 TGLPadPainter.cxx:209
 TGLPadPainter.cxx:210
 TGLPadPainter.cxx:211
 TGLPadPainter.cxx:212
 TGLPadPainter.cxx:213
 TGLPadPainter.cxx:214
 TGLPadPainter.cxx:215
 TGLPadPainter.cxx:216
 TGLPadPainter.cxx:217
 TGLPadPainter.cxx:218
 TGLPadPainter.cxx:219
 TGLPadPainter.cxx:220
 TGLPadPainter.cxx:221
 TGLPadPainter.cxx:222
 TGLPadPainter.cxx:223
 TGLPadPainter.cxx:224
 TGLPadPainter.cxx:225
 TGLPadPainter.cxx:226
 TGLPadPainter.cxx:227
 TGLPadPainter.cxx:228
 TGLPadPainter.cxx:229
 TGLPadPainter.cxx:230
 TGLPadPainter.cxx:231
 TGLPadPainter.cxx:232
 TGLPadPainter.cxx:233
 TGLPadPainter.cxx:234
 TGLPadPainter.cxx:235
 TGLPadPainter.cxx:236
 TGLPadPainter.cxx:237
 TGLPadPainter.cxx:238
 TGLPadPainter.cxx:239
 TGLPadPainter.cxx:240
 TGLPadPainter.cxx:241
 TGLPadPainter.cxx:242
 TGLPadPainter.cxx:243
 TGLPadPainter.cxx:244
 TGLPadPainter.cxx:245
 TGLPadPainter.cxx:246
 TGLPadPainter.cxx:247
 TGLPadPainter.cxx:248
 TGLPadPainter.cxx:249
 TGLPadPainter.cxx:250
 TGLPadPainter.cxx:251
 TGLPadPainter.cxx:252
 TGLPadPainter.cxx:253
 TGLPadPainter.cxx:254
 TGLPadPainter.cxx:255
 TGLPadPainter.cxx:256
 TGLPadPainter.cxx:257
 TGLPadPainter.cxx:258
 TGLPadPainter.cxx:259
 TGLPadPainter.cxx:260
 TGLPadPainter.cxx:261
 TGLPadPainter.cxx:262
 TGLPadPainter.cxx:263
 TGLPadPainter.cxx:264
 TGLPadPainter.cxx:265
 TGLPadPainter.cxx:266
 TGLPadPainter.cxx:267
 TGLPadPainter.cxx:268
 TGLPadPainter.cxx:269
 TGLPadPainter.cxx:270
 TGLPadPainter.cxx:271
 TGLPadPainter.cxx:272
 TGLPadPainter.cxx:273
 TGLPadPainter.cxx:274
 TGLPadPainter.cxx:275
 TGLPadPainter.cxx:276
 TGLPadPainter.cxx:277
 TGLPadPainter.cxx:278
 TGLPadPainter.cxx:279
 TGLPadPainter.cxx:280
 TGLPadPainter.cxx:281
 TGLPadPainter.cxx:282
 TGLPadPainter.cxx:283
 TGLPadPainter.cxx:284
 TGLPadPainter.cxx:285
 TGLPadPainter.cxx:286
 TGLPadPainter.cxx:287
 TGLPadPainter.cxx:288
 TGLPadPainter.cxx:289
 TGLPadPainter.cxx:290
 TGLPadPainter.cxx:291
 TGLPadPainter.cxx:292
 TGLPadPainter.cxx:293
 TGLPadPainter.cxx:294
 TGLPadPainter.cxx:295
 TGLPadPainter.cxx:296
 TGLPadPainter.cxx:297
 TGLPadPainter.cxx:298
 TGLPadPainter.cxx:299
 TGLPadPainter.cxx:300
 TGLPadPainter.cxx:301
 TGLPadPainter.cxx:302
 TGLPadPainter.cxx:303
 TGLPadPainter.cxx:304
 TGLPadPainter.cxx:305
 TGLPadPainter.cxx:306
 TGLPadPainter.cxx:307
 TGLPadPainter.cxx:308
 TGLPadPainter.cxx:309
 TGLPadPainter.cxx:310
 TGLPadPainter.cxx:311
 TGLPadPainter.cxx:312
 TGLPadPainter.cxx:313
 TGLPadPainter.cxx:314
 TGLPadPainter.cxx:315
 TGLPadPainter.cxx:316
 TGLPadPainter.cxx:317
 TGLPadPainter.cxx:318
 TGLPadPainter.cxx:319
 TGLPadPainter.cxx:320
 TGLPadPainter.cxx:321
 TGLPadPainter.cxx:322
 TGLPadPainter.cxx:323
 TGLPadPainter.cxx:324
 TGLPadPainter.cxx:325
 TGLPadPainter.cxx:326
 TGLPadPainter.cxx:327
 TGLPadPainter.cxx:328
 TGLPadPainter.cxx:329
 TGLPadPainter.cxx:330
 TGLPadPainter.cxx:331
 TGLPadPainter.cxx:332
 TGLPadPainter.cxx:333
 TGLPadPainter.cxx:334
 TGLPadPainter.cxx:335
 TGLPadPainter.cxx:336
 TGLPadPainter.cxx:337
 TGLPadPainter.cxx:338
 TGLPadPainter.cxx:339
 TGLPadPainter.cxx:340
 TGLPadPainter.cxx:341
 TGLPadPainter.cxx:342
 TGLPadPainter.cxx:343
 TGLPadPainter.cxx:344
 TGLPadPainter.cxx:345
 TGLPadPainter.cxx:346
 TGLPadPainter.cxx:347
 TGLPadPainter.cxx:348
 TGLPadPainter.cxx:349
 TGLPadPainter.cxx:350
 TGLPadPainter.cxx:351
 TGLPadPainter.cxx:352
 TGLPadPainter.cxx:353
 TGLPadPainter.cxx:354
 TGLPadPainter.cxx:355
 TGLPadPainter.cxx:356
 TGLPadPainter.cxx:357
 TGLPadPainter.cxx:358
 TGLPadPainter.cxx:359
 TGLPadPainter.cxx:360
 TGLPadPainter.cxx:361
 TGLPadPainter.cxx:362
 TGLPadPainter.cxx:363
 TGLPadPainter.cxx:364
 TGLPadPainter.cxx:365
 TGLPadPainter.cxx:366
 TGLPadPainter.cxx:367
 TGLPadPainter.cxx:368
 TGLPadPainter.cxx:369
 TGLPadPainter.cxx:370
 TGLPadPainter.cxx:371
 TGLPadPainter.cxx:372
 TGLPadPainter.cxx:373
 TGLPadPainter.cxx:374
 TGLPadPainter.cxx:375
 TGLPadPainter.cxx:376
 TGLPadPainter.cxx:377
 TGLPadPainter.cxx:378
 TGLPadPainter.cxx:379
 TGLPadPainter.cxx:380
 TGLPadPainter.cxx:381
 TGLPadPainter.cxx:382
 TGLPadPainter.cxx:383
 TGLPadPainter.cxx:384
 TGLPadPainter.cxx:385
 TGLPadPainter.cxx:386
 TGLPadPainter.cxx:387
 TGLPadPainter.cxx:388
 TGLPadPainter.cxx:389
 TGLPadPainter.cxx:390
 TGLPadPainter.cxx:391
 TGLPadPainter.cxx:392
 TGLPadPainter.cxx:393
 TGLPadPainter.cxx:394
 TGLPadPainter.cxx:395
 TGLPadPainter.cxx:396
 TGLPadPainter.cxx:397
 TGLPadPainter.cxx:398
 TGLPadPainter.cxx:399
 TGLPadPainter.cxx:400
 TGLPadPainter.cxx:401
 TGLPadPainter.cxx:402
 TGLPadPainter.cxx:403
 TGLPadPainter.cxx:404
 TGLPadPainter.cxx:405
 TGLPadPainter.cxx:406
 TGLPadPainter.cxx:407
 TGLPadPainter.cxx:408
 TGLPadPainter.cxx:409
 TGLPadPainter.cxx:410
 TGLPadPainter.cxx:411
 TGLPadPainter.cxx:412
 TGLPadPainter.cxx:413
 TGLPadPainter.cxx:414
 TGLPadPainter.cxx:415
 TGLPadPainter.cxx:416
 TGLPadPainter.cxx:417
 TGLPadPainter.cxx:418
 TGLPadPainter.cxx:419
 TGLPadPainter.cxx:420
 TGLPadPainter.cxx:421
 TGLPadPainter.cxx:422
 TGLPadPainter.cxx:423
 TGLPadPainter.cxx:424
 TGLPadPainter.cxx:425
 TGLPadPainter.cxx:426
 TGLPadPainter.cxx:427
 TGLPadPainter.cxx:428
 TGLPadPainter.cxx:429
 TGLPadPainter.cxx:430
 TGLPadPainter.cxx:431
 TGLPadPainter.cxx:432
 TGLPadPainter.cxx:433
 TGLPadPainter.cxx:434
 TGLPadPainter.cxx:435
 TGLPadPainter.cxx:436
 TGLPadPainter.cxx:437
 TGLPadPainter.cxx:438
 TGLPadPainter.cxx:439
 TGLPadPainter.cxx:440
 TGLPadPainter.cxx:441
 TGLPadPainter.cxx:442
 TGLPadPainter.cxx:443
 TGLPadPainter.cxx:444
 TGLPadPainter.cxx:445
 TGLPadPainter.cxx:446
 TGLPadPainter.cxx:447
 TGLPadPainter.cxx:448
 TGLPadPainter.cxx:449
 TGLPadPainter.cxx:450
 TGLPadPainter.cxx:451
 TGLPadPainter.cxx:452
 TGLPadPainter.cxx:453
 TGLPadPainter.cxx:454
 TGLPadPainter.cxx:455
 TGLPadPainter.cxx:456
 TGLPadPainter.cxx:457
 TGLPadPainter.cxx:458
 TGLPadPainter.cxx:459
 TGLPadPainter.cxx:460
 TGLPadPainter.cxx:461
 TGLPadPainter.cxx:462
 TGLPadPainter.cxx:463
 TGLPadPainter.cxx:464
 TGLPadPainter.cxx:465
 TGLPadPainter.cxx:466
 TGLPadPainter.cxx:467
 TGLPadPainter.cxx:468
 TGLPadPainter.cxx:469
 TGLPadPainter.cxx:470
 TGLPadPainter.cxx:471
 TGLPadPainter.cxx:472
 TGLPadPainter.cxx:473
 TGLPadPainter.cxx:474
 TGLPadPainter.cxx:475
 TGLPadPainter.cxx:476
 TGLPadPainter.cxx:477
 TGLPadPainter.cxx:478
 TGLPadPainter.cxx:479
 TGLPadPainter.cxx:480
 TGLPadPainter.cxx:481
 TGLPadPainter.cxx:482
 TGLPadPainter.cxx:483
 TGLPadPainter.cxx:484
 TGLPadPainter.cxx:485
 TGLPadPainter.cxx:486
 TGLPadPainter.cxx:487
 TGLPadPainter.cxx:488
 TGLPadPainter.cxx:489
 TGLPadPainter.cxx:490
 TGLPadPainter.cxx:491
 TGLPadPainter.cxx:492
 TGLPadPainter.cxx:493
 TGLPadPainter.cxx:494
 TGLPadPainter.cxx:495
 TGLPadPainter.cxx:496
 TGLPadPainter.cxx:497
 TGLPadPainter.cxx:498
 TGLPadPainter.cxx:499
 TGLPadPainter.cxx:500
 TGLPadPainter.cxx:501
 TGLPadPainter.cxx:502
 TGLPadPainter.cxx:503
 TGLPadPainter.cxx:504
 TGLPadPainter.cxx:505
 TGLPadPainter.cxx:506
 TGLPadPainter.cxx:507
 TGLPadPainter.cxx:508
 TGLPadPainter.cxx:509
 TGLPadPainter.cxx:510
 TGLPadPainter.cxx:511
 TGLPadPainter.cxx:512
 TGLPadPainter.cxx:513
 TGLPadPainter.cxx:514
 TGLPadPainter.cxx:515
 TGLPadPainter.cxx:516
 TGLPadPainter.cxx:517
 TGLPadPainter.cxx:518
 TGLPadPainter.cxx:519
 TGLPadPainter.cxx:520
 TGLPadPainter.cxx:521
 TGLPadPainter.cxx:522
 TGLPadPainter.cxx:523
 TGLPadPainter.cxx:524
 TGLPadPainter.cxx:525
 TGLPadPainter.cxx:526
 TGLPadPainter.cxx:527
 TGLPadPainter.cxx:528
 TGLPadPainter.cxx:529
 TGLPadPainter.cxx:530
 TGLPadPainter.cxx:531
 TGLPadPainter.cxx:532
 TGLPadPainter.cxx:533
 TGLPadPainter.cxx:534
 TGLPadPainter.cxx:535
 TGLPadPainter.cxx:536
 TGLPadPainter.cxx:537
 TGLPadPainter.cxx:538
 TGLPadPainter.cxx:539
 TGLPadPainter.cxx:540
 TGLPadPainter.cxx:541
 TGLPadPainter.cxx:542
 TGLPadPainter.cxx:543
 TGLPadPainter.cxx:544
 TGLPadPainter.cxx:545
 TGLPadPainter.cxx:546
 TGLPadPainter.cxx:547
 TGLPadPainter.cxx:548
 TGLPadPainter.cxx:549
 TGLPadPainter.cxx:550
 TGLPadPainter.cxx:551
 TGLPadPainter.cxx:552
 TGLPadPainter.cxx:553
 TGLPadPainter.cxx:554
 TGLPadPainter.cxx:555
 TGLPadPainter.cxx:556
 TGLPadPainter.cxx:557
 TGLPadPainter.cxx:558
 TGLPadPainter.cxx:559
 TGLPadPainter.cxx:560
 TGLPadPainter.cxx:561
 TGLPadPainter.cxx:562
 TGLPadPainter.cxx:563
 TGLPadPainter.cxx:564
 TGLPadPainter.cxx:565
 TGLPadPainter.cxx:566
 TGLPadPainter.cxx:567
 TGLPadPainter.cxx:568
 TGLPadPainter.cxx:569
 TGLPadPainter.cxx:570
 TGLPadPainter.cxx:571
 TGLPadPainter.cxx:572
 TGLPadPainter.cxx:573
 TGLPadPainter.cxx:574
 TGLPadPainter.cxx:575
 TGLPadPainter.cxx:576
 TGLPadPainter.cxx:577
 TGLPadPainter.cxx:578
 TGLPadPainter.cxx:579
 TGLPadPainter.cxx:580
 TGLPadPainter.cxx:581
 TGLPadPainter.cxx:582
 TGLPadPainter.cxx:583
 TGLPadPainter.cxx:584
 TGLPadPainter.cxx:585
 TGLPadPainter.cxx:586
 TGLPadPainter.cxx:587
 TGLPadPainter.cxx:588
 TGLPadPainter.cxx:589
 TGLPadPainter.cxx:590
 TGLPadPainter.cxx:591
 TGLPadPainter.cxx:592
 TGLPadPainter.cxx:593
 TGLPadPainter.cxx:594
 TGLPadPainter.cxx:595
 TGLPadPainter.cxx:596
 TGLPadPainter.cxx:597
 TGLPadPainter.cxx:598
 TGLPadPainter.cxx:599
 TGLPadPainter.cxx:600
 TGLPadPainter.cxx:601
 TGLPadPainter.cxx:602
 TGLPadPainter.cxx:603
 TGLPadPainter.cxx:604
 TGLPadPainter.cxx:605
 TGLPadPainter.cxx:606
 TGLPadPainter.cxx:607
 TGLPadPainter.cxx:608
 TGLPadPainter.cxx:609
 TGLPadPainter.cxx:610
 TGLPadPainter.cxx:611
 TGLPadPainter.cxx:612
 TGLPadPainter.cxx:613
 TGLPadPainter.cxx:614
 TGLPadPainter.cxx:615
 TGLPadPainter.cxx:616
 TGLPadPainter.cxx:617
 TGLPadPainter.cxx:618
 TGLPadPainter.cxx:619
 TGLPadPainter.cxx:620
 TGLPadPainter.cxx:621
 TGLPadPainter.cxx:622
 TGLPadPainter.cxx:623
 TGLPadPainter.cxx:624
 TGLPadPainter.cxx:625
 TGLPadPainter.cxx:626
 TGLPadPainter.cxx:627
 TGLPadPainter.cxx:628
 TGLPadPainter.cxx:629
 TGLPadPainter.cxx:630
 TGLPadPainter.cxx:631
 TGLPadPainter.cxx:632
 TGLPadPainter.cxx:633
 TGLPadPainter.cxx:634
 TGLPadPainter.cxx:635
 TGLPadPainter.cxx:636
 TGLPadPainter.cxx:637
 TGLPadPainter.cxx:638
 TGLPadPainter.cxx:639
 TGLPadPainter.cxx:640
 TGLPadPainter.cxx:641
 TGLPadPainter.cxx:642
 TGLPadPainter.cxx:643
 TGLPadPainter.cxx:644
 TGLPadPainter.cxx:645
 TGLPadPainter.cxx:646
 TGLPadPainter.cxx:647
 TGLPadPainter.cxx:648
 TGLPadPainter.cxx:649
 TGLPadPainter.cxx:650
 TGLPadPainter.cxx:651
 TGLPadPainter.cxx:652
 TGLPadPainter.cxx:653
 TGLPadPainter.cxx:654
 TGLPadPainter.cxx:655
 TGLPadPainter.cxx:656
 TGLPadPainter.cxx:657
 TGLPadPainter.cxx:658
 TGLPadPainter.cxx:659
 TGLPadPainter.cxx:660
 TGLPadPainter.cxx:661
 TGLPadPainter.cxx:662
 TGLPadPainter.cxx:663
 TGLPadPainter.cxx:664
 TGLPadPainter.cxx:665
 TGLPadPainter.cxx:666
 TGLPadPainter.cxx:667
 TGLPadPainter.cxx:668
 TGLPadPainter.cxx:669
 TGLPadPainter.cxx:670
 TGLPadPainter.cxx:671
 TGLPadPainter.cxx:672
 TGLPadPainter.cxx:673
 TGLPadPainter.cxx:674
 TGLPadPainter.cxx:675
 TGLPadPainter.cxx:676
 TGLPadPainter.cxx:677
 TGLPadPainter.cxx:678
 TGLPadPainter.cxx:679
 TGLPadPainter.cxx:680
 TGLPadPainter.cxx:681
 TGLPadPainter.cxx:682
 TGLPadPainter.cxx:683
 TGLPadPainter.cxx:684
 TGLPadPainter.cxx:685
 TGLPadPainter.cxx:686
 TGLPadPainter.cxx:687
 TGLPadPainter.cxx:688
 TGLPadPainter.cxx:689
 TGLPadPainter.cxx:690
 TGLPadPainter.cxx:691
 TGLPadPainter.cxx:692
 TGLPadPainter.cxx:693
 TGLPadPainter.cxx:694
 TGLPadPainter.cxx:695
 TGLPadPainter.cxx:696
 TGLPadPainter.cxx:697
 TGLPadPainter.cxx:698
 TGLPadPainter.cxx:699
 TGLPadPainter.cxx:700
 TGLPadPainter.cxx:701
 TGLPadPainter.cxx:702
 TGLPadPainter.cxx:703
 TGLPadPainter.cxx:704
 TGLPadPainter.cxx:705
 TGLPadPainter.cxx:706
 TGLPadPainter.cxx:707
 TGLPadPainter.cxx:708
 TGLPadPainter.cxx:709
 TGLPadPainter.cxx:710
 TGLPadPainter.cxx:711
 TGLPadPainter.cxx:712
 TGLPadPainter.cxx:713
 TGLPadPainter.cxx:714
 TGLPadPainter.cxx:715
 TGLPadPainter.cxx:716
 TGLPadPainter.cxx:717
 TGLPadPainter.cxx:718
 TGLPadPainter.cxx:719
 TGLPadPainter.cxx:720
 TGLPadPainter.cxx:721
 TGLPadPainter.cxx:722
 TGLPadPainter.cxx:723
 TGLPadPainter.cxx:724
 TGLPadPainter.cxx:725
 TGLPadPainter.cxx:726
 TGLPadPainter.cxx:727
 TGLPadPainter.cxx:728
 TGLPadPainter.cxx:729
 TGLPadPainter.cxx:730
 TGLPadPainter.cxx:731
 TGLPadPainter.cxx:732
 TGLPadPainter.cxx:733
 TGLPadPainter.cxx:734
 TGLPadPainter.cxx:735
 TGLPadPainter.cxx:736
 TGLPadPainter.cxx:737
 TGLPadPainter.cxx:738
 TGLPadPainter.cxx:739
 TGLPadPainter.cxx:740
 TGLPadPainter.cxx:741
 TGLPadPainter.cxx:742
 TGLPadPainter.cxx:743
 TGLPadPainter.cxx:744
 TGLPadPainter.cxx:745
 TGLPadPainter.cxx:746
 TGLPadPainter.cxx:747
 TGLPadPainter.cxx:748
 TGLPadPainter.cxx:749
 TGLPadPainter.cxx:750
 TGLPadPainter.cxx:751
 TGLPadPainter.cxx:752
 TGLPadPainter.cxx:753
 TGLPadPainter.cxx:754
 TGLPadPainter.cxx:755
 TGLPadPainter.cxx:756
 TGLPadPainter.cxx:757
 TGLPadPainter.cxx:758
 TGLPadPainter.cxx:759
 TGLPadPainter.cxx:760
 TGLPadPainter.cxx:761
 TGLPadPainter.cxx:762
 TGLPadPainter.cxx:763
 TGLPadPainter.cxx:764
 TGLPadPainter.cxx:765
 TGLPadPainter.cxx:766
 TGLPadPainter.cxx:767
 TGLPadPainter.cxx:768
 TGLPadPainter.cxx:769
 TGLPadPainter.cxx:770
 TGLPadPainter.cxx:771
 TGLPadPainter.cxx:772
 TGLPadPainter.cxx:773
 TGLPadPainter.cxx:774
 TGLPadPainter.cxx:775
 TGLPadPainter.cxx:776
 TGLPadPainter.cxx:777
 TGLPadPainter.cxx:778
 TGLPadPainter.cxx:779
 TGLPadPainter.cxx:780
 TGLPadPainter.cxx:781
 TGLPadPainter.cxx:782
 TGLPadPainter.cxx:783
 TGLPadPainter.cxx:784
 TGLPadPainter.cxx:785
 TGLPadPainter.cxx:786
 TGLPadPainter.cxx:787
 TGLPadPainter.cxx:788
 TGLPadPainter.cxx:789
 TGLPadPainter.cxx:790
 TGLPadPainter.cxx:791
 TGLPadPainter.cxx:792
 TGLPadPainter.cxx:793
 TGLPadPainter.cxx:794
 TGLPadPainter.cxx:795
 TGLPadPainter.cxx:796
 TGLPadPainter.cxx:797
 TGLPadPainter.cxx:798
 TGLPadPainter.cxx:799
 TGLPadPainter.cxx:800
 TGLPadPainter.cxx:801
 TGLPadPainter.cxx:802
 TGLPadPainter.cxx:803
 TGLPadPainter.cxx:804
 TGLPadPainter.cxx:805
 TGLPadPainter.cxx:806
 TGLPadPainter.cxx:807
 TGLPadPainter.cxx:808
 TGLPadPainter.cxx:809
 TGLPadPainter.cxx:810
 TGLPadPainter.cxx:811
 TGLPadPainter.cxx:812
 TGLPadPainter.cxx:813
 TGLPadPainter.cxx:814
 TGLPadPainter.cxx:815
 TGLPadPainter.cxx:816
 TGLPadPainter.cxx:817
 TGLPadPainter.cxx:818
 TGLPadPainter.cxx:819
 TGLPadPainter.cxx:820
 TGLPadPainter.cxx:821
 TGLPadPainter.cxx:822
 TGLPadPainter.cxx:823
 TGLPadPainter.cxx:824
 TGLPadPainter.cxx:825
 TGLPadPainter.cxx:826
 TGLPadPainter.cxx:827
 TGLPadPainter.cxx:828
 TGLPadPainter.cxx:829
 TGLPadPainter.cxx:830
 TGLPadPainter.cxx:831
 TGLPadPainter.cxx:832
 TGLPadPainter.cxx:833
 TGLPadPainter.cxx:834
 TGLPadPainter.cxx:835
 TGLPadPainter.cxx:836
 TGLPadPainter.cxx:837
 TGLPadPainter.cxx:838
 TGLPadPainter.cxx:839
 TGLPadPainter.cxx:840
 TGLPadPainter.cxx:841
 TGLPadPainter.cxx:842
 TGLPadPainter.cxx:843
 TGLPadPainter.cxx:844
 TGLPadPainter.cxx:845
 TGLPadPainter.cxx:846
 TGLPadPainter.cxx:847
 TGLPadPainter.cxx:848
 TGLPadPainter.cxx:849
 TGLPadPainter.cxx:850
 TGLPadPainter.cxx:851
 TGLPadPainter.cxx:852
 TGLPadPainter.cxx:853
 TGLPadPainter.cxx:854
 TGLPadPainter.cxx:855
 TGLPadPainter.cxx:856
 TGLPadPainter.cxx:857
 TGLPadPainter.cxx:858
 TGLPadPainter.cxx:859
 TGLPadPainter.cxx:860
 TGLPadPainter.cxx:861
 TGLPadPainter.cxx:862
 TGLPadPainter.cxx:863
 TGLPadPainter.cxx:864
 TGLPadPainter.cxx:865
 TGLPadPainter.cxx:866
 TGLPadPainter.cxx:867
 TGLPadPainter.cxx:868
 TGLPadPainter.cxx:869
 TGLPadPainter.cxx:870
 TGLPadPainter.cxx:871
 TGLPadPainter.cxx:872
 TGLPadPainter.cxx:873
 TGLPadPainter.cxx:874
 TGLPadPainter.cxx:875
 TGLPadPainter.cxx:876
 TGLPadPainter.cxx:877
 TGLPadPainter.cxx:878
 TGLPadPainter.cxx:879
 TGLPadPainter.cxx:880
 TGLPadPainter.cxx:881
 TGLPadPainter.cxx:882
 TGLPadPainter.cxx:883
 TGLPadPainter.cxx:884
 TGLPadPainter.cxx:885
 TGLPadPainter.cxx:886
 TGLPadPainter.cxx:887
 TGLPadPainter.cxx:888
 TGLPadPainter.cxx:889
 TGLPadPainter.cxx:890
 TGLPadPainter.cxx:891
 TGLPadPainter.cxx:892
 TGLPadPainter.cxx:893
 TGLPadPainter.cxx:894
 TGLPadPainter.cxx:895
 TGLPadPainter.cxx:896
 TGLPadPainter.cxx:897
 TGLPadPainter.cxx:898
 TGLPadPainter.cxx:899
 TGLPadPainter.cxx:900
 TGLPadPainter.cxx:901
 TGLPadPainter.cxx:902
 TGLPadPainter.cxx:903
 TGLPadPainter.cxx:904
 TGLPadPainter.cxx:905
 TGLPadPainter.cxx:906
 TGLPadPainter.cxx:907
 TGLPadPainter.cxx:908
 TGLPadPainter.cxx:909
 TGLPadPainter.cxx:910
 TGLPadPainter.cxx:911
 TGLPadPainter.cxx:912
 TGLPadPainter.cxx:913
 TGLPadPainter.cxx:914
 TGLPadPainter.cxx:915
 TGLPadPainter.cxx:916
 TGLPadPainter.cxx:917
 TGLPadPainter.cxx:918
 TGLPadPainter.cxx:919
 TGLPadPainter.cxx:920
 TGLPadPainter.cxx:921
 TGLPadPainter.cxx:922
 TGLPadPainter.cxx:923
 TGLPadPainter.cxx:924
 TGLPadPainter.cxx:925
 TGLPadPainter.cxx:926
 TGLPadPainter.cxx:927
 TGLPadPainter.cxx:928
 TGLPadPainter.cxx:929
 TGLPadPainter.cxx:930
 TGLPadPainter.cxx:931
 TGLPadPainter.cxx:932
 TGLPadPainter.cxx:933
 TGLPadPainter.cxx:934
 TGLPadPainter.cxx:935
 TGLPadPainter.cxx:936
 TGLPadPainter.cxx:937
 TGLPadPainter.cxx:938
 TGLPadPainter.cxx:939
 TGLPadPainter.cxx:940
 TGLPadPainter.cxx:941
 TGLPadPainter.cxx:942
 TGLPadPainter.cxx:943
 TGLPadPainter.cxx:944
 TGLPadPainter.cxx:945
 TGLPadPainter.cxx:946
 TGLPadPainter.cxx:947
 TGLPadPainter.cxx:948
 TGLPadPainter.cxx:949
 TGLPadPainter.cxx:950
 TGLPadPainter.cxx:951
 TGLPadPainter.cxx:952
 TGLPadPainter.cxx:953
 TGLPadPainter.cxx:954
 TGLPadPainter.cxx:955
 TGLPadPainter.cxx:956
 TGLPadPainter.cxx:957
 TGLPadPainter.cxx:958
 TGLPadPainter.cxx:959
 TGLPadPainter.cxx:960
 TGLPadPainter.cxx:961
 TGLPadPainter.cxx:962
 TGLPadPainter.cxx:963
 TGLPadPainter.cxx:964
 TGLPadPainter.cxx:965
 TGLPadPainter.cxx:966
 TGLPadPainter.cxx:967
 TGLPadPainter.cxx:968
 TGLPadPainter.cxx:969
 TGLPadPainter.cxx:970
 TGLPadPainter.cxx:971
 TGLPadPainter.cxx:972
 TGLPadPainter.cxx:973
 TGLPadPainter.cxx:974
 TGLPadPainter.cxx:975
 TGLPadPainter.cxx:976
 TGLPadPainter.cxx:977
 TGLPadPainter.cxx:978
 TGLPadPainter.cxx:979
 TGLPadPainter.cxx:980
 TGLPadPainter.cxx:981
 TGLPadPainter.cxx:982
 TGLPadPainter.cxx:983
 TGLPadPainter.cxx:984
 TGLPadPainter.cxx:985
 TGLPadPainter.cxx:986
 TGLPadPainter.cxx:987
 TGLPadPainter.cxx:988
 TGLPadPainter.cxx:989
 TGLPadPainter.cxx:990
 TGLPadPainter.cxx:991
 TGLPadPainter.cxx:992
 TGLPadPainter.cxx:993
 TGLPadPainter.cxx:994
 TGLPadPainter.cxx:995
 TGLPadPainter.cxx:996
 TGLPadPainter.cxx:997
 TGLPadPainter.cxx:998
 TGLPadPainter.cxx:999
 TGLPadPainter.cxx:1000
 TGLPadPainter.cxx:1001
 TGLPadPainter.cxx:1002
 TGLPadPainter.cxx:1003
 TGLPadPainter.cxx:1004
 TGLPadPainter.cxx:1005
 TGLPadPainter.cxx:1006
 TGLPadPainter.cxx:1007
 TGLPadPainter.cxx:1008
 TGLPadPainter.cxx:1009
 TGLPadPainter.cxx:1010
 TGLPadPainter.cxx:1011
 TGLPadPainter.cxx:1012
 TGLPadPainter.cxx:1013
 TGLPadPainter.cxx:1014
 TGLPadPainter.cxx:1015
 TGLPadPainter.cxx:1016
 TGLPadPainter.cxx:1017
 TGLPadPainter.cxx:1018
 TGLPadPainter.cxx:1019
 TGLPadPainter.cxx:1020
 TGLPadPainter.cxx:1021
 TGLPadPainter.cxx:1022
 TGLPadPainter.cxx:1023
 TGLPadPainter.cxx:1024
 TGLPadPainter.cxx:1025
 TGLPadPainter.cxx:1026
 TGLPadPainter.cxx:1027
 TGLPadPainter.cxx:1028
 TGLPadPainter.cxx:1029
 TGLPadPainter.cxx:1030
 TGLPadPainter.cxx:1031
 TGLPadPainter.cxx:1032
 TGLPadPainter.cxx:1033
 TGLPadPainter.cxx:1034
 TGLPadPainter.cxx:1035
 TGLPadPainter.cxx:1036
 TGLPadPainter.cxx:1037
 TGLPadPainter.cxx:1038
 TGLPadPainter.cxx:1039
 TGLPadPainter.cxx:1040
 TGLPadPainter.cxx:1041
 TGLPadPainter.cxx:1042
 TGLPadPainter.cxx:1043
 TGLPadPainter.cxx:1044
 TGLPadPainter.cxx:1045
 TGLPadPainter.cxx:1046
 TGLPadPainter.cxx:1047
 TGLPadPainter.cxx:1048
 TGLPadPainter.cxx:1049
 TGLPadPainter.cxx:1050
 TGLPadPainter.cxx:1051
 TGLPadPainter.cxx:1052
 TGLPadPainter.cxx:1053
 TGLPadPainter.cxx:1054
 TGLPadPainter.cxx:1055
 TGLPadPainter.cxx:1056
 TGLPadPainter.cxx:1057
 TGLPadPainter.cxx:1058
 TGLPadPainter.cxx:1059
 TGLPadPainter.cxx:1060
 TGLPadPainter.cxx:1061
 TGLPadPainter.cxx:1062
 TGLPadPainter.cxx:1063
 TGLPadPainter.cxx:1064
 TGLPadPainter.cxx:1065
 TGLPadPainter.cxx:1066
 TGLPadPainter.cxx:1067
 TGLPadPainter.cxx:1068
 TGLPadPainter.cxx:1069
 TGLPadPainter.cxx:1070
 TGLPadPainter.cxx:1071
 TGLPadPainter.cxx:1072
 TGLPadPainter.cxx:1073
 TGLPadPainter.cxx:1074
 TGLPadPainter.cxx:1075
 TGLPadPainter.cxx:1076
 TGLPadPainter.cxx:1077
 TGLPadPainter.cxx:1078
 TGLPadPainter.cxx:1079
 TGLPadPainter.cxx:1080
 TGLPadPainter.cxx:1081
 TGLPadPainter.cxx:1082
 TGLPadPainter.cxx:1083
 TGLPadPainter.cxx:1084
 TGLPadPainter.cxx:1085
 TGLPadPainter.cxx:1086
 TGLPadPainter.cxx:1087
 TGLPadPainter.cxx:1088
 TGLPadPainter.cxx:1089
 TGLPadPainter.cxx:1090
 TGLPadPainter.cxx:1091
 TGLPadPainter.cxx:1092
 TGLPadPainter.cxx:1093
 TGLPadPainter.cxx:1094
 TGLPadPainter.cxx:1095
 TGLPadPainter.cxx:1096
 TGLPadPainter.cxx:1097
 TGLPadPainter.cxx:1098
 TGLPadPainter.cxx:1099
 TGLPadPainter.cxx:1100
 TGLPadPainter.cxx:1101
 TGLPadPainter.cxx:1102
 TGLPadPainter.cxx:1103
 TGLPadPainter.cxx:1104
 TGLPadPainter.cxx:1105
 TGLPadPainter.cxx:1106
 TGLPadPainter.cxx:1107
 TGLPadPainter.cxx:1108
 TGLPadPainter.cxx:1109
 TGLPadPainter.cxx:1110
 TGLPadPainter.cxx:1111
 TGLPadPainter.cxx:1112
 TGLPadPainter.cxx:1113
 TGLPadPainter.cxx:1114
 TGLPadPainter.cxx:1115
 TGLPadPainter.cxx:1116
 TGLPadPainter.cxx:1117
 TGLPadPainter.cxx:1118
 TGLPadPainter.cxx:1119
 TGLPadPainter.cxx:1120
 TGLPadPainter.cxx:1121
 TGLPadPainter.cxx:1122
 TGLPadPainter.cxx:1123
 TGLPadPainter.cxx:1124
 TGLPadPainter.cxx:1125
 TGLPadPainter.cxx:1126
 TGLPadPainter.cxx:1127
 TGLPadPainter.cxx:1128
 TGLPadPainter.cxx:1129
 TGLPadPainter.cxx:1130
 TGLPadPainter.cxx:1131
 TGLPadPainter.cxx:1132
 TGLPadPainter.cxx:1133
 TGLPadPainter.cxx:1134
 TGLPadPainter.cxx:1135
 TGLPadPainter.cxx:1136
 TGLPadPainter.cxx:1137
 TGLPadPainter.cxx:1138
 TGLPadPainter.cxx:1139
 TGLPadPainter.cxx:1140
 TGLPadPainter.cxx:1141
 TGLPadPainter.cxx:1142
 TGLPadPainter.cxx:1143
 TGLPadPainter.cxx:1144
 TGLPadPainter.cxx:1145
 TGLPadPainter.cxx:1146
 TGLPadPainter.cxx:1147
 TGLPadPainter.cxx:1148
 TGLPadPainter.cxx:1149
 TGLPadPainter.cxx:1150
 TGLPadPainter.cxx:1151
 TGLPadPainter.cxx:1152
 TGLPadPainter.cxx:1153
 TGLPadPainter.cxx:1154
 TGLPadPainter.cxx:1155
 TGLPadPainter.cxx:1156
 TGLPadPainter.cxx:1157
 TGLPadPainter.cxx:1158
 TGLPadPainter.cxx:1159
 TGLPadPainter.cxx:1160
 TGLPadPainter.cxx:1161
 TGLPadPainter.cxx:1162
 TGLPadPainter.cxx:1163
 TGLPadPainter.cxx:1164
 TGLPadPainter.cxx:1165
 TGLPadPainter.cxx:1166
 TGLPadPainter.cxx:1167
 TGLPadPainter.cxx:1168
 TGLPadPainter.cxx:1169
 TGLPadPainter.cxx:1170
 TGLPadPainter.cxx:1171
 TGLPadPainter.cxx:1172
 TGLPadPainter.cxx:1173
 TGLPadPainter.cxx:1174
 TGLPadPainter.cxx:1175
 TGLPadPainter.cxx:1176
 TGLPadPainter.cxx:1177
 TGLPadPainter.cxx:1178
 TGLPadPainter.cxx:1179
 TGLPadPainter.cxx:1180
 TGLPadPainter.cxx:1181
 TGLPadPainter.cxx:1182
 TGLPadPainter.cxx:1183
 TGLPadPainter.cxx:1184
 TGLPadPainter.cxx:1185
 TGLPadPainter.cxx:1186
 TGLPadPainter.cxx:1187
 TGLPadPainter.cxx:1188
 TGLPadPainter.cxx:1189
 TGLPadPainter.cxx:1190
 TGLPadPainter.cxx:1191
 TGLPadPainter.cxx:1192
 TGLPadPainter.cxx:1193
 TGLPadPainter.cxx:1194
 TGLPadPainter.cxx:1195
 TGLPadPainter.cxx:1196
 TGLPadPainter.cxx:1197
 TGLPadPainter.cxx:1198
 TGLPadPainter.cxx:1199
 TGLPadPainter.cxx:1200
 TGLPadPainter.cxx:1201
 TGLPadPainter.cxx:1202
 TGLPadPainter.cxx:1203
 TGLPadPainter.cxx:1204
 TGLPadPainter.cxx:1205
 TGLPadPainter.cxx:1206
 TGLPadPainter.cxx:1207
 TGLPadPainter.cxx:1208
 TGLPadPainter.cxx:1209
 TGLPadPainter.cxx:1210
 TGLPadPainter.cxx:1211
 TGLPadPainter.cxx:1212
 TGLPadPainter.cxx:1213
 TGLPadPainter.cxx:1214
 TGLPadPainter.cxx:1215
 TGLPadPainter.cxx:1216
 TGLPadPainter.cxx:1217
 TGLPadPainter.cxx:1218
 TGLPadPainter.cxx:1219
 TGLPadPainter.cxx:1220
 TGLPadPainter.cxx:1221
 TGLPadPainter.cxx:1222
 TGLPadPainter.cxx:1223
 TGLPadPainter.cxx:1224
 TGLPadPainter.cxx:1225
 TGLPadPainter.cxx:1226
 TGLPadPainter.cxx:1227
 TGLPadPainter.cxx:1228
 TGLPadPainter.cxx:1229
 TGLPadPainter.cxx:1230
 TGLPadPainter.cxx:1231
 TGLPadPainter.cxx:1232
 TGLPadPainter.cxx:1233
 TGLPadPainter.cxx:1234
 TGLPadPainter.cxx:1235
 TGLPadPainter.cxx:1236
 TGLPadPainter.cxx:1237
 TGLPadPainter.cxx:1238
 TGLPadPainter.cxx:1239
 TGLPadPainter.cxx:1240
 TGLPadPainter.cxx:1241
 TGLPadPainter.cxx:1242
 TGLPadPainter.cxx:1243
 TGLPadPainter.cxx:1244
 TGLPadPainter.cxx:1245
 TGLPadPainter.cxx:1246
 TGLPadPainter.cxx:1247
 TGLPadPainter.cxx:1248
 TGLPadPainter.cxx:1249
 TGLPadPainter.cxx:1250
 TGLPadPainter.cxx:1251
 TGLPadPainter.cxx:1252
 TGLPadPainter.cxx:1253
 TGLPadPainter.cxx:1254
 TGLPadPainter.cxx:1255
 TGLPadPainter.cxx:1256
 TGLPadPainter.cxx:1257
 TGLPadPainter.cxx:1258
 TGLPadPainter.cxx:1259
 TGLPadPainter.cxx:1260
 TGLPadPainter.cxx:1261
 TGLPadPainter.cxx:1262
 TGLPadPainter.cxx:1263
 TGLPadPainter.cxx:1264
 TGLPadPainter.cxx:1265
 TGLPadPainter.cxx:1266
 TGLPadPainter.cxx:1267
 TGLPadPainter.cxx:1268
 TGLPadPainter.cxx:1269
 TGLPadPainter.cxx:1270
 TGLPadPainter.cxx:1271
 TGLPadPainter.cxx:1272
 TGLPadPainter.cxx:1273
 TGLPadPainter.cxx:1274
 TGLPadPainter.cxx:1275
 TGLPadPainter.cxx:1276
 TGLPadPainter.cxx:1277
 TGLPadPainter.cxx:1278
 TGLPadPainter.cxx:1279
 TGLPadPainter.cxx:1280
 TGLPadPainter.cxx:1281
 TGLPadPainter.cxx:1282
 TGLPadPainter.cxx:1283
 TGLPadPainter.cxx:1284
 TGLPadPainter.cxx:1285
 TGLPadPainter.cxx:1286
 TGLPadPainter.cxx:1287
 TGLPadPainter.cxx:1288
 TGLPadPainter.cxx:1289
 TGLPadPainter.cxx:1290
 TGLPadPainter.cxx:1291
 TGLPadPainter.cxx:1292
 TGLPadPainter.cxx:1293
 TGLPadPainter.cxx:1294
 TGLPadPainter.cxx:1295
 TGLPadPainter.cxx:1296
 TGLPadPainter.cxx:1297
 TGLPadPainter.cxx:1298
 TGLPadPainter.cxx:1299
 TGLPadPainter.cxx:1300
 TGLPadPainter.cxx:1301
 TGLPadPainter.cxx:1302
 TGLPadPainter.cxx:1303
 TGLPadPainter.cxx:1304
 TGLPadPainter.cxx:1305
 TGLPadPainter.cxx:1306
 TGLPadPainter.cxx:1307
 TGLPadPainter.cxx:1308
 TGLPadPainter.cxx:1309
 TGLPadPainter.cxx:1310
 TGLPadPainter.cxx:1311
 TGLPadPainter.cxx:1312
 TGLPadPainter.cxx:1313
 TGLPadPainter.cxx:1314
 TGLPadPainter.cxx:1315
 TGLPadPainter.cxx:1316
 TGLPadPainter.cxx:1317
 TGLPadPainter.cxx:1318
 TGLPadPainter.cxx:1319
 TGLPadPainter.cxx:1320
 TGLPadPainter.cxx:1321
 TGLPadPainter.cxx:1322
 TGLPadPainter.cxx:1323
 TGLPadPainter.cxx:1324
 TGLPadPainter.cxx:1325
 TGLPadPainter.cxx:1326
 TGLPadPainter.cxx:1327
 TGLPadPainter.cxx:1328
 TGLPadPainter.cxx:1329
 TGLPadPainter.cxx:1330
 TGLPadPainter.cxx:1331
 TGLPadPainter.cxx:1332
 TGLPadPainter.cxx:1333
 TGLPadPainter.cxx:1334
 TGLPadPainter.cxx:1335
 TGLPadPainter.cxx:1336
 TGLPadPainter.cxx:1337
 TGLPadPainter.cxx:1338
 TGLPadPainter.cxx:1339
 TGLPadPainter.cxx:1340
 TGLPadPainter.cxx:1341
 TGLPadPainter.cxx:1342
 TGLPadPainter.cxx:1343
 TGLPadPainter.cxx:1344
 TGLPadPainter.cxx:1345
 TGLPadPainter.cxx:1346
 TGLPadPainter.cxx:1347
 TGLPadPainter.cxx:1348
 TGLPadPainter.cxx:1349
 TGLPadPainter.cxx:1350
 TGLPadPainter.cxx:1351
 TGLPadPainter.cxx:1352
 TGLPadPainter.cxx:1353
 TGLPadPainter.cxx:1354
 TGLPadPainter.cxx:1355
 TGLPadPainter.cxx:1356
 TGLPadPainter.cxx:1357
 TGLPadPainter.cxx:1358
 TGLPadPainter.cxx:1359
 TGLPadPainter.cxx:1360
 TGLPadPainter.cxx:1361
 TGLPadPainter.cxx:1362
 TGLPadPainter.cxx:1363
 TGLPadPainter.cxx:1364
 TGLPadPainter.cxx:1365
 TGLPadPainter.cxx:1366
 TGLPadPainter.cxx:1367
 TGLPadPainter.cxx:1368
 TGLPadPainter.cxx:1369
 TGLPadPainter.cxx:1370
 TGLPadPainter.cxx:1371
 TGLPadPainter.cxx:1372
 TGLPadPainter.cxx:1373
 TGLPadPainter.cxx:1374
 TGLPadPainter.cxx:1375
 TGLPadPainter.cxx:1376
 TGLPadPainter.cxx:1377
 TGLPadPainter.cxx:1378
 TGLPadPainter.cxx:1379
 TGLPadPainter.cxx:1380
 TGLPadPainter.cxx:1381
 TGLPadPainter.cxx:1382
 TGLPadPainter.cxx:1383
 TGLPadPainter.cxx:1384
 TGLPadPainter.cxx:1385
 TGLPadPainter.cxx:1386
 TGLPadPainter.cxx:1387
 TGLPadPainter.cxx:1388
 TGLPadPainter.cxx:1389
 TGLPadPainter.cxx:1390
 TGLPadPainter.cxx:1391
 TGLPadPainter.cxx:1392
 TGLPadPainter.cxx:1393
 TGLPadPainter.cxx:1394
 TGLPadPainter.cxx:1395
 TGLPadPainter.cxx:1396
 TGLPadPainter.cxx:1397
 TGLPadPainter.cxx:1398
 TGLPadPainter.cxx:1399