// @(#)root/histpainter:$Id$
// Author: Rene Brun, Evgueni Tcherniaev, Olivier Couet   12/12/94

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


//______________________________________________________________________________
/* Begin_Html
<center><h2>Legos and Surfaces package</h2></center>
This package was originally written by Evgueni Tcherniaev from IHEP/Protvino.
<p>
The original Fortran implementation was adapted to HIGZ/PAW by Olivier Couet
and  Evgueni Tcherniaev.
<p>
This class is a subset of the original system. It has been converted to a C++
class by Rene Brun.
End_Html */

#include <stdlib.h>

#include "TROOT.h"
#include "TPainter3dAlgorithms.h"
#include "TVirtualPad.h"
#include "THistPainter.h"
#include "TH1.h"
#include "TF3.h"
#include "TView.h"
#include "TVirtualX.h"
#include "Hoption.h"
#include "Hparam.h"
#include "TMath.h"
#include "TStyle.h"
#include "TObjArray.h"
#include "THLimitsFinder.h"
#include "TColor.h"

const Double_t kRad  = TMath::ATan(1)*Double_t(4)/Double_t(180);
const Double_t kFdel = 0.;
const Double_t kDel  = 0.0001;
const Int_t kNiso  = 4;
const Int_t kNmaxp = kNiso*13;
const Int_t kNmaxt = kNiso*12;
const Int_t kLmax  = 12;
const Int_t kF3FillColor1 = 201;
const Int_t kF3FillColor2 = 202;
const Int_t kF3LineColor  = 203;

Int_t    TPainter3dAlgorithms::fgF3Clipping = 0;
Double_t TPainter3dAlgorithms::fgF3XClip = 0.;
Double_t TPainter3dAlgorithms::fgF3YClip = 0.;
Double_t TPainter3dAlgorithms::fgF3ZClip = 0.;
TF3     *TPainter3dAlgorithms::fgCurrentF3 = 0;

// Static arrays used to paint stacked lego plots.
const Int_t kVSizeMax = 20;
static Double_t gV[kVSizeMax];
static Double_t gTT[4*kVSizeMax];
static Int_t gColorMain[kVSizeMax+1];
static Int_t gColorDark[kVSizeMax+1];
static Int_t gEdgeColor[kVSizeMax+1];
static Int_t gEdgeStyle[kVSizeMax+1];
static Int_t gEdgeWidth[kVSizeMax+1];

extern TH1  *gCurrentHist; //these 3 globals should be replaced by class members
extern Hoption_t Hoption;
extern Hparam_t  Hparam;

ClassImp(TPainter3dAlgorithms)


//______________________________________________________________________________
TPainter3dAlgorithms::TPainter3dAlgorithms(): TObject(), TAttLine(1,1,1), TAttFill(1,0)
{
   // Lego default constructor

   Int_t i;
   fIfrast          = 0;
   fMesh            = 1;
   fRaster          = 0;
   fColorTop        = 1;
   fColorBottom     = 1;
   fEdgeIdx         = -1;
   fNlevel          = 0;
   fSystem          = kCARTESIAN;
   fDrawFace        = 0;
   fLegoFunction    = 0;
   fSurfaceFunction = 0;

   TList *stack = 0;
   if (gCurrentHist) stack = gCurrentHist->GetPainter()->GetStack();
   fNStack = 0;
   if (stack) fNStack = stack->GetSize();
   if (fNStack > kVSizeMax) {
      fColorMain  = new Int_t[fNStack+1];
      fColorDark  = new Int_t[fNStack+1];
      fEdgeColor  = new Int_t[fNStack+1];
      fEdgeStyle  = new Int_t[fNStack+1];
      fEdgeWidth  = new Int_t[fNStack+1];
   } else {
      fColorMain = &gColorMain[0];
      fColorDark = &gColorDark[0];
      fEdgeColor = &gEdgeColor[0];
      fEdgeStyle = &gEdgeStyle[0];
      fEdgeWidth = &gEdgeWidth[0];
   }

   for (i=0;i<fNStack;i++) { fColorMain[i] = 1; fColorDark[i] = 1; fEdgeColor[i] = 1; fEdgeStyle[i] = 1; fEdgeWidth[i] = 1; }
   for (i=0;i<3;i++)       { fRmin[i] = 0; fRmax[i] = 1; }
   for (i=0;i<4;i++)       { fYls[i] = 0; }

   for (i=0;i<30;i++)      { fJmask[i] = 0; }
   for (i=0;i<200;i++)     { fLevelLine[i] = 0; }
   for (i=0;i<465;i++)     { fMask[i] = 0; }
   for (i=0;i<258;i++)     { fColorLevel[i] = 0; }
   for (i=0;i<1200;i++)    { fPlines[i] = 0.; }
   for (i=0;i<200;i++)     { fT[i] = 0.; }
   for (i=0;i<2000;i++)    { fU[i] = 0.; fD[i] = 0.; }
   for (i=0;i<12;i++)      { fVls[i] = 0.; }
   for (i=0;i<257;i++)     { fFunLevel[i] = 0.; }
   for (i=0;i<183;i++)     { fAphi[i] = 0.; }
   for (i=0;i<8;i++)       { fF8[i] = 0.; }

   fLoff   = 0;
   fNT     = 0;
   fNcolor = 0;
   fNlines = 0;
   fNqs    = 0;
   fNxrast = 0;
   fNyrast = 0;
   fIc1    = 0;
   fIc2    = 0;
   fIc3    = 0;
   fQA     = 0.;
   fQD     = 0.;
   fQS     = 0.;
   fX0     = 0.;
   fYdl    = 0.;
   fXrast  = 0.;
   fYrast  = 0.;
   fFmin   = 0.;
   fFmax   = 0.;
   fDXrast = 0.;
   fDYrast = 0.;
   fDX     = 0.;
}


//______________________________________________________________________________
TPainter3dAlgorithms::TPainter3dAlgorithms(Double_t *rmin, Double_t *rmax, Int_t system)
      : TObject(), TAttLine(1,1,1), TAttFill(1,0)
{
   // Normal default constructor
   //
   //  rmin[3], rmax[3] are the limits of the lego object depending on
   //  the selected coordinate system

   Int_t i;
   Double_t psi;

   fIfrast       = 0;
   fMesh         = 1;
   fRaster       = 0;
   fColorTop     = 1;
   fColorBottom  = 1;
   fEdgeIdx      = -1;
   fNlevel       = 0;
   fSystem       = system;
   if (system == kCARTESIAN || system == kPOLAR) psi =  0;
   else                                          psi = 90;
   fDrawFace        = 0;
   fLegoFunction    = 0;
   fSurfaceFunction = 0;

   TList *stack = gCurrentHist->GetPainter()->GetStack();
   fNStack = 0;
   if (stack) fNStack = stack->GetSize();
   if (fNStack > kVSizeMax) {
      fColorMain  = new Int_t[fNStack+1];
      fColorDark  = new Int_t[fNStack+1];
      fEdgeColor  = new Int_t[fNStack+1];
      fEdgeStyle  = new Int_t[fNStack+1];
      fEdgeWidth  = new Int_t[fNStack+1];
   } else {
      fColorMain = &gColorMain[0];
      fColorDark = &gColorDark[0];
      fEdgeColor = &gEdgeColor[0];
      fEdgeStyle = &gEdgeStyle[0];
      fEdgeWidth = &gEdgeWidth[0];
   }

   for (i=0;i<fNStack;i++) { fColorMain[i] = 1; fColorDark[i] = 1; fEdgeColor[i] = 1; fEdgeStyle[i] = 1; fEdgeWidth[i] = 1; }
   for (i=0;i<3;i++)       { fRmin[i] = rmin[i]; fRmax[i] = rmax[i]; }
   for (i=0;i<4;i++)       { fYls[i] = 0; }

   for (i=0;i<30;i++)      { fJmask[i] = 0; }
   for (i=0;i<200;i++)     { fLevelLine[i] = 0; }
   for (i=0;i<465;i++)     { fMask[i] = 0; }
   for (i=0;i<258;i++)     { fColorLevel[i] = 0; }
   for (i=0;i<1200;i++)    { fPlines[i] = 0.; }
   for (i=0;i<200;i++)     { fT[i] = 0.; }
   for (i=0;i<2000;i++)    { fU[i] = 0.; fD[i] = 0.; }
   for (i=0;i<12;i++)      { fVls[i] = 0.; }
   for (i=0;i<257;i++)     { fFunLevel[i] = 0.; }
   for (i=0;i<183;i++)     { fAphi[i] = 0.; }
   for (i=0;i<8;i++)       { fF8[i] = 0.; }

   fLoff   = 0;
   fNT     = 0;
   fNcolor = 0;
   fNlines = 0;
   fNqs    = 0;
   fNxrast = 0;
   fNyrast = 0;
   fIc1    = 0;
   fIc2    = 0;
   fIc3    = 0;
   fQA     = 0.;
   fQD     = 0.;
   fQS     = 0.;
   fX0     = 0.;
   fYdl    = 0.;
   fXrast  = 0.;
   fYrast  = 0.;
   fFmin   = 0.;
   fFmax   = 0.;
   fDXrast = 0.;
   fDYrast = 0.;
   fDX     = 0.;

   TView *view = 0;
   if (gPad) view = gPad->GetView();
   if (!view) view = TView::CreateView(fSystem, rmin, rmax);
   if (view) {
      view->SetView(gPad->GetPhi(), gPad->GetTheta(), psi, i);
      view->SetRange(rmin,rmax);
   }
}


//______________________________________________________________________________
TPainter3dAlgorithms::~TPainter3dAlgorithms()
{
   // Lego default destructor

   if (fRaster) {delete [] fRaster; fRaster = 0;}
   if (fNStack > kVSizeMax) {
      delete [] fColorMain;
      delete [] fColorDark;
      delete [] fEdgeColor;
      delete [] fEdgeStyle;
      delete [] fEdgeWidth;
   }
}


//______________________________________________________________________________
void TPainter3dAlgorithms::BackBox(Double_t ang)
{
   // Draw back surfaces of surrounding box
   //
   //    Input  ANG     - angle between X and Y axis
   //
   //           DRFACE(ICODES,XYZ,NP,IFACE,T) - routine for face drawing
   //             ICODES(*) - set of codes for this face
   //             NP        - number of nodes in face
   //             IFACE(NP) - face
   //             T(NP)     - additional function

   /* Initialized data */
   static Int_t iface1[4] = { 1,4,8,5 };
   static Int_t iface2[4] = { 4,3,7,8 };
   TView *view = 0;

   if (gPad) view = gPad->GetView();
   if (!view) {
      Error("BackBox", "no TView in current pad");
      return;
   }

   /* Local variables */
   Double_t cosa, sina;
   Int_t i;
   Double_t r[24]        /* was [3][8] */, av[24]        /* was [3][8] */;
   Int_t icodes[3];
   Double_t tt[4];
   Int_t ix1, ix2, iy1, iy2, iz1, iz2;

   cosa = TMath::Cos(kRad*ang);
   sina = TMath::Sin(kRad*ang);
   view->AxisVertex(ang, av, ix1, ix2, iy1, iy2, iz1, iz2);
   for (i = 1; i <= 8; ++i) {
      r[i*3 - 3] = av[i*3 - 3] + av[i*3 - 2]*cosa;
      r[i*3 - 2] = av[i*3 - 2]*sina;
      r[i*3 - 1] = av[i*3 - 1];
   }

   //          D R A W   F O R W A R D   F A C E S */
   icodes[0] = 0;
   icodes[1] = 0;
   icodes[2] = 0;
   tt[0] = r[iface1[0]*3 - 1];
   tt[1] = r[iface1[1]*3 - 1];
   tt[2] = r[iface1[2]*3 - 1];
   tt[3] = r[iface1[3]*3 - 1];
   (this->*fDrawFace)(icodes, r, 4, iface1, tt);
   tt[0] = r[iface2[0]*3 - 1];
   tt[1] = r[iface2[1]*3 - 1];
   tt[2] = r[iface2[2]*3 - 1];
   tt[3] = r[iface2[3]*3 - 1];
   (this->*fDrawFace)(icodes, r, 4, iface2, tt);
}


//______________________________________________________________________________
void TPainter3dAlgorithms::ClearRaster()
{
   // Clear screen

   Int_t nw = (fNxrast*fNyrast + 29) / 30;
   for (Int_t i = 0; i < nw; ++i) fRaster[i] = 0;
   fIfrast = 0;
}


//______________________________________________________________________________
void TPainter3dAlgorithms::ColorFunction(Int_t nl, Double_t *fl, Int_t *icl, Int_t &irep)
{
   // Set correspondance between function and color levels
   //
   //    Input: NL        - number of levels
   //           FL(NL)    - function levels
   //           ICL(NL+1) - colors for levels
   //
   //    Output: IREP     - reply: 0 O.K.
   //                             -1 error in parameters:
   //                         illegal number of levels
   //                         function levels must be in increasing order
   //                         negative color index

   static const char *where = "ColorFunction";

   /* Local variables */
   Int_t i;

   irep = 0;
   if (nl == 0) {fNlevel = 0;        return; }

   //          C H E C K   P A R A M E T E R S
   if (nl < 0 || nl > 256) {
      Error(where, "illegal number of levels (%d)", nl);
      irep = -1;
      return;
   }
   for (i = 1; i < nl; ++i) {
      if (fl[i] <= fl[i - 1]) {
   //         Error(where, "function levels must be in increasing order");
         irep = -1;
         return;
      }
   }
   for (i = 0; i < nl; ++i) {
      if (icl[i] < 0) {
   //         Error(where, "negative color index (%d)", icl[i]);
         irep = -1;
         return;
      }
   }

   //          S E T   L E V E L S
   fNlevel = nl;
   for (i = 0; i < fNlevel; ++i) fFunLevel[i]   = Hparam.factor*fl[i];
   for (i = 0; i < fNlevel+1; ++i) fColorLevel[i] = icl[i];
}


//______________________________________________________________________________
void TPainter3dAlgorithms::DefineGridLevels(Int_t ndivz)
{
   // Define the grid levels drawn in the background of surface and lego plots.
   // The grid levels are aligned on the  Z axis' main tick marks.

   Int_t i, nbins=0;
   Double_t binLow = 0, binHigh = 0, binWidth = 0;
   TView *view = 0;

   if (gPad) view = gPad->GetView();
   if (!view) {
      Error("GridLevels", "no TView in current pad");
      return;
   }

   // Find the main tick marks positions.
   Double_t *rmin = view->GetRmin();
   Double_t *rmax = view->GetRmax();
   if (!rmin || !rmax) return;
   if (ndivz > 0) {
      THLimitsFinder::Optimize(rmin[2], rmax[2], ndivz,
                               binLow, binHigh, nbins, binWidth, " ");
   } else {
      nbins = TMath::Abs(ndivz);
      binLow = rmin[2];
      binHigh = rmax[2];
      binWidth = (binHigh-binLow)/nbins;
   }

   // Define the grid levels
   fNlevel = nbins+1;
   for (i = 0; i < fNlevel; ++i) fFunLevel[i] = binLow+i*binWidth;
}


//______________________________________________________________________________
void TPainter3dAlgorithms::DrawFaceMode1(Int_t *icodes, Double_t *xyz, Int_t np, Int_t *iface, Double_t *t)
{
   // Draw face - 1st variant
   //
   //    Function: Draw face - 1st variant
   //              (2 colors: 1st for external surface, 2nd for internal)
   //
   //    References: WCtoNDC
   //
   //    Input: ICODES(*) - set of codes for the line (not used)
   //             ICODES(1) - IX
   //             ICODES(2) - IY
   //           XYZ(3,*)  - coordinates of nodes
   //           NP        - number of nodes
   //           IFACE(NP) - face
   //           T(NP)     - additional function defined on this face
   //                       (not used in this routine)

   /* Local variables */
   Int_t i, k,ifneg,i1, i2;
   Double_t x[13], y[13];
   Double_t z;
   Double_t p3[24]        /* was [2][12] */;
   TView *view = 0;

   if (gPad) view = gPad->GetView();
   if (!view) return;

   //          T R A N S F E R   T O   N O R M A L I S E D   COORDINATES
   /* Parameter adjustments */
   --t;
   --iface;
   xyz -= 4;
   --icodes;

   ifneg = 0;
   for (i = 1; i <= np; ++i) {
      k = iface[i];
      if (k < 0) ifneg = 1;
      if (k < 0) k = -k;
      view->WCtoNDC(&xyz[k*3 + 1], &p3[2*i - 2]);
      x[i - 1] = p3[2*i - 2];
      y[i - 1] = p3[2*i - 1];
   }

   //          F I N D   N O R M A L
   z = 0;
   for (i = 1; i <= np; ++i) {
      i1 = i;
      i2 = i1 + 1;
      if (i2 > np) i2 = 1;
      z = z + p3[2*i1 - 1]*p3[2*i2 - 2] - p3[2*i1 - 2] *
              p3[2*i2 - 1];
   }

   //          D R A W   F A C E
   if (z > 0)         SetFillColor(kF3FillColor1);
   if (z <= 0) SetFillColor(kF3FillColor2);
   SetFillStyle(1001);
   TAttFill::Modify();
   gPad->PaintFillArea(np, x, y);

   //          D R A W   B O R D E R
   if (ifneg == 0) {
      SetFillStyle(0);
      SetFillColor(kF3LineColor);
      TAttFill::Modify();
      gPad->PaintFillArea(np, x, y);
   } else {
      x[np] = x[0];
      y[np] = y[0];
      SetLineColor(kF3LineColor);
      TAttLine::Modify();
      for (i = 1; i <= np; ++i) {
         if (iface[i] > 0) gPad->PaintPolyLine(2, &x[i-1], &y[i-1]);
      }
   }
}


//______________________________________________________________________________
void TPainter3dAlgorithms::DrawFaceMode2(Int_t *icodes, Double_t *xyz, Int_t np, Int_t *iface, Double_t *t)
{
   // Draw face - 2nd option
   //
   //    Function: Draw face - 2nd option
   //              (fill in correspondance with function levels)
   //
   //    References: WCtoNDC, FillPolygon
   //
   //    Input: ICODES(*) - set of codes for the line (not used)
   //             ICODES(1) - IX
   //             ICODES(2) - IY
   //           XYZ(3,*)  - coordinates of nodes
   //           NP        - number of nodes
   //           IFACE(NP) - face
   //           T(NP)     - additional function defined on this face

   /* Local variables */
   Int_t i, k;
   Double_t x[12], y[12];
   Double_t p3[36]        /* was [3][12] */;
   TView *view = 0;

   if (gPad) view = gPad->GetView();
   if (!view) return;

   //          T R A N S F E R   T O   N O R M A L I S E D   COORDINATES
   /* Parameter adjustments */
   --t;
   --iface;
   xyz -= 4;
   --icodes;

   for (i = 1; i <= np; ++i) {
      k = iface[i];
      view->WCtoNDC(&xyz[k*3 + 1], &p3[i*3 - 3]);
      x[i - 1] = p3[i*3 - 3];
      y[i - 1] = p3[i*3 - 2];
   }

   //          D R A W   F A C E   &   B O R D E R
   FillPolygon(np, p3, &t[1]);
   if (fMesh == 1) {
      if (Hoption.Lego!=0 && Hoption.Surf==0) {  // i.e. PaintFillArea for lego, not for surf
         SetFillColor(fEdgeColor[fEdgeIdx]);
         SetFillStyle(0);
         TAttFill::Modify();
         gPad->PaintFillArea(np, x, y);
      }
      SetLineColor(fEdgeColor[fEdgeIdx]);
      SetLineStyle(fEdgeStyle[fEdgeIdx]);
      SetLineWidth(fEdgeWidth[fEdgeIdx]);
      TAttLine::Modify();
      gPad->PaintPolyLine(np, x, y);
   }
}


//______________________________________________________________________________
void TPainter3dAlgorithms::DrawFaceMode3(Int_t *icodes, Double_t *xyz, Int_t np, Int_t *iface, Double_t *t)
{
   // Draw face - 3rd option
   //
   //    Function: Draw face - 3rd option
   //              (draw face for stacked lego plot)
   //
   //    References: WCtoNDC
   //
   //    Input: ICODES(*) - set of codes for the line
   //             ICODES(1) - IX coordinate of the line cell
   //             ICODES(2) - IY coordinate of the line cell
   //             ICODES(3) - lego number
   //             ICODES(4) - side: 1-face,2-right,3-back,4-left,
   //                               5-bottom, 6-top
   //             XYZ(3,*)  - coordinates of nodes
   //             NP        - number of nodes
   //             IFACE(NP) - face
   //             T(*)      - additional function (not used here)

   Int_t i, k;
   Int_t icol = 0;
   Double_t x[4], y[4], p3[12]        /* was [3][4] */;
   TView *view = 0;

   if (gPad) view = gPad->GetView();
   if (!view) return;

   /* Parameter adjustments */
   --t;
   --iface;
   xyz -= 4;
   --icodes;

   if (icodes[4] == 6) icol = fColorTop;
   if (icodes[4] == 5) icol = fColorBottom;
   if (icodes[4] == 1) icol = fColorMain[icodes[3] - 1];
   if (icodes[4] == 2) icol = fColorDark[icodes[3] - 1];
   if (icodes[4] == 3) icol = fColorMain[icodes[3] - 1];
   if (icodes[4] == 4) icol = fColorDark[icodes[3] - 1];

   for (i = 1; i <= np; ++i) {
      k = iface[i];
      view->WCtoNDC(&xyz[k*3 + 1], &p3[i*3 - 3]);
      x[i - 1] = p3[i*3 - 3];
      y[i - 1] = p3[i*3 - 2];
   }

   SetFillStyle(1001);
   SetFillColor(icol);
   TAttFill::Modify();
   gPad->PaintFillArea(np, x, y);
   if (fMesh) {
      SetFillStyle(0);
      SetFillColor(fEdgeColor[fEdgeIdx]);
      TAttFill::Modify();
      gPad->PaintFillArea(np, x, y);
      SetLineColor(fEdgeColor[fEdgeIdx]);
      SetLineStyle(fEdgeStyle[fEdgeIdx]);
      SetLineWidth(fEdgeWidth[fEdgeIdx]);
      TAttLine::Modify();
      gPad->PaintPolyLine(np, x, y);
   }
}


//______________________________________________________________________________
void TPainter3dAlgorithms::DrawFaceMove1(Int_t *icodes, Double_t *xyz, Int_t np,
                                         Int_t *iface, Double_t *tt)
{
   // Draw face - 1st variant for "MOVING SCREEN" algorithm
   //
   //    Function: Draw face - 1st variant for "MOVING SCREEN" algorithm
   //              (draw face with level lines)
   //
   //    References: FindLevelLines, WCtoNDC,
   //                FindVisibleDraw, ModifyScreen
   //
   //    Input: ICODES(*) - set of codes for the line (not used)
   //             ICODES(1) - IX
   //             ICODES(2) - IY
   //           XYZ(3,*)  - coordinates of nodes
   //           NP        - number of nodes
   //           IFACE(NP) - face
   //           TT(NP)    - additional function defined on this face
   //                       (not used in this routine)

   Double_t xdel, ydel;
   Int_t i, k, i1, i2, il, it;
   Double_t x[2], y[2];
   Double_t p1[3], p2[3], p3[36]        /* was [3][12] */;
   TView *view = 0;

   if (gPad) view = gPad->GetView();
   if (!view) return;

   //          C O P Y   P O I N T S   T O   A R R A Y
   /* Parameter adjustments */
   --tt;
   --iface;
   xyz -= 4;
   --icodes;

   for (i = 1; i <= np; ++i) {
      k = iface[i];
      p3[i*3 - 3] = xyz[k*3 + 1];
      p3[i*3 - 2] = xyz[k*3 + 2];
      p3[i*3 - 1] = xyz[k*3 + 3];
   }

   //          F I N D   L E V E L   L I N E S
   FindLevelLines(np, p3, &tt[1]);

   //          D R A W   L E V E L   L I N E S
   SetLineStyle(3);
   if (icodes[3]==0) {  // front & back boxes
      SetLineColor(1);
      SetLineWidth(1);
   } else {
      SetLineColor(fEdgeColor[fEdgeIdx]);
      SetLineWidth(fEdgeWidth[fEdgeIdx]);
   }
   TAttLine::Modify();
   for (il = 1; il <= fNlines; ++il) {
      FindVisibleDraw(&fPlines[(2*il + 1)*3 - 9], &fPlines[(2*il + 2)*3 - 9]);
      view->WCtoNDC(&fPlines[(2*il + 1)*3 - 9], p1);
      view->WCtoNDC(&fPlines[(2*il + 2)*3 - 9], p2);
      xdel = p2[0] - p1[0];
      ydel = p2[1] - p1[1];
      for (it = 1; it <= fNT; ++it) {
         x[0] = p1[0] + xdel*fT[2*it - 2];
         y[0] = p1[1] + ydel*fT[2*it - 2];
         x[1] = p1[0] + xdel*fT[2*it - 1];
         y[1] = p1[1] + ydel*fT[2*it - 1];
         gPad->PaintPolyLine(2, x, y);
      }
   }

   //          D R A W   F A C E
   if (icodes[3]==0) {  // front & back boxes
      SetLineColor(1);
      SetLineStyle(1);
      SetLineWidth(1);
   } else {
      SetLineColor(fEdgeColor[fEdgeIdx]);
      SetLineStyle(fEdgeStyle[fEdgeIdx]);
      SetLineWidth(fEdgeWidth[fEdgeIdx]);
   }
   TAttLine::Modify();
   for (i = 1; i <= np; ++i) {
      i1 = i;
      i2 = i + 1;
      if (i == np) i2 = 1;
      FindVisibleDraw(&p3[i1*3 - 3], &p3[i2*3 - 3]);
      view->WCtoNDC(&p3[i1*3 - 3], p1);
      view->WCtoNDC(&p3[i2*3 - 3], p2);
      xdel = p2[0] - p1[0];
      ydel = p2[1] - p1[1];
      for (it = 1; it <= fNT; ++it) {
         x[0] = p1[0] + xdel*fT[2*it - 2];
         y[0] = p1[1] + ydel*fT[2*it - 2];
         x[1] = p1[0] + xdel*fT[2*it - 1];
         y[1] = p1[1] + ydel*fT[2*it - 1];
         gPad->PaintPolyLine(2, x, y);
      }
   }

   //          M O D I F Y    S C R E E N
   for (i = 1; i <= np; ++i) {
      i1 = i;
      i2 = i + 1;
      if (i == np) i2 = 1;
      ModifyScreen(&p3[i1*3 - 3], &p3[i2*3 - 3]);
   }
}


//______________________________________________________________________________
void TPainter3dAlgorithms::DrawFaceMove3(Int_t *icodes, Double_t *xyz, Int_t np,
                                         Int_t *iface, Double_t *tt)
{
   // Draw face - 3rd variant for "MOVING SCREEN" algorithm
   //
   //    Function: Draw face - 1st variant for "MOVING SCREEN" algorithm
   //              (draw level lines only)
   //
   //    References: FindLevelLines, WCtoNDC,
   //                FindVisibleDraw, ModifyScreen
   //
   //    Input: ICODES(*) - set of codes for the line (not used)
   //             ICODES(1) - IX
   //             ICODES(2) - IY
   //           XYZ(3,*)  - coordinates of nodes
   //           NP        - number of nodes
   //           IFACE(NP) - face
   //           TT(NP)    - additional function defined on this face
   //                       (not used in this routine)

   Double_t xdel, ydel;
   Int_t i, k, i1, i2, il, it;
   Double_t x[2], y[2];
   Double_t p1[3], p2[3], p3[36]        /* was [3][12] */;
   TView *view = 0;

   if (gPad) view = gPad->GetView();
   if (!view) return;

   // Parameter adjustments (ftoc)
   --tt;
   --iface;
   xyz -= 4;
   --icodes;

   // Copy points to array
   for (i = 1; i <= np; ++i) {
      k = iface[i];
      p3[i*3 - 3] = xyz[k*3 + 1];
      p3[i*3 - 2] = xyz[k*3 + 2];
      p3[i*3 - 1] = xyz[k*3 + 3];
   }

   // Find level lines
   FindLevelLines(np, p3, &tt[1]);

   // Draw level lines
   if (icodes[3]==0) {  // front and back boxes
      SetLineColor(1);
      SetLineStyle(1);
      SetLineWidth(1);
   } else {
      SetLineColor(fEdgeColor[fEdgeIdx]);
      SetLineStyle(fEdgeStyle[fEdgeIdx]);
      SetLineWidth(fEdgeWidth[fEdgeIdx]);
   }
   TAttLine::Modify();
   for (il = 1; il <= fNlines; ++il) {
      FindVisibleDraw(&fPlines[(2*il + 1)*3 - 9], &fPlines[(2*il + 2)*3 - 9]);
      view->WCtoNDC(&fPlines[(2*il + 1)*3 - 9], p1);
      view->WCtoNDC(&fPlines[(2*il + 2)*3 - 9], p2);
      xdel = p2[0] - p1[0];
      ydel = p2[1] - p1[1];
      for (it = 1; it <= fNT; ++it) {
         x[0] = p1[0] + xdel*fT[2*it - 2];
         y[0] = p1[1] + ydel*fT[2*it - 2];
         x[1] = p1[0] + xdel*fT[2*it - 1];
         y[1] = p1[1] + ydel*fT[2*it - 1];
         gPad->PaintPolyLine(2, x, y);
      }
   }

   // Modify screen
   for (i = 1; i <= np; ++i) {
      i1 = i;
      i2 = i + 1;
      if (i == np) i2 = 1;
      ModifyScreen(&p3[i1*3 - 3], &p3[i2*3 - 3]);
   }
}


//______________________________________________________________________________
void TPainter3dAlgorithms::DrawFaceMove2(Int_t *icodes, Double_t *xyz, Int_t np, Int_t *iface, Double_t *tt)
{
   // Draw face - 2nd variant for "MOVING SCREEN" algorithm
   //
   //    Function: Draw face - 2nd variant for "MOVING SCREEN" algorithm
   //              (draw face for stacked lego plot)
   //
   //    References: FindLevelLines, WCtoNDC,
   //                FindVisibleDraw, ModifyScreen
   //
   //    Input: ICODES(*) - set of codes for the line (not used)
   //             ICODES(1) - IX
   //             ICODES(2) - IY
   //             ICODES(3) - line code (N of lego)
   //           XYZ(3,*)  - coordinates of nodes
   //           NP        - number of nodes
   //           IFACE(NP) - face
   //           TT(NP)    - additional function defined on this face
   //                       (not used in this routine)

   Double_t xdel, ydel;
   Int_t i, k, i1, i2, it;
   Double_t x[2], y[2];
   Double_t p1[3], p2[3], p3[36]        /* was [3][12] */;
   TView *view = 0;

   if (gPad) view = gPad->GetView();
   if (!view) return;

   //          C O P Y   P O I N T S   T O   A R R A Y
   /* Parameter adjustments */
   --tt;
   --iface;
   xyz -= 4;
   --icodes;

   for (i = 1; i <= np; ++i) {
      k = iface[i];
      p3[i*3 - 3] = xyz[k*3 + 1];
      p3[i*3 - 2] = xyz[k*3 + 2];
      p3[i*3 - 1] = xyz[k*3 + 3];
   }

   //          D R A W   F A C E
   if (icodes[3]==0) {  // front & back boxes
      SetLineColor(1);
      SetLineStyle(1);
      SetLineWidth(1);
   } else {
      SetLineColor(fEdgeColor[fEdgeIdx]);
      SetLineStyle(fEdgeStyle[fEdgeIdx]);
      SetLineWidth(fEdgeWidth[fEdgeIdx]);
   }
   TAttLine::Modify();
   for (i = 1; i <= np; ++i) {
      i1 = i;
      i2 = i + 1;
      if (i == np) i2 = 1;
      FindVisibleDraw(&p3[i1*3 - 3], &p3[i2*3 - 3]);
      view->WCtoNDC(&p3[i1*3 - 3], p1);
      view->WCtoNDC(&p3[i2*3 - 3], p2);
      xdel = p2[0] - p1[0];
      ydel = p2[1] - p1[1];
      for (it = 1; it <= fNT; ++it) {
         x[0] = p1[0] + xdel*fT[2*it - 2];
         y[0] = p1[1] + ydel*fT[2*it - 2];
         x[1] = p1[0] + xdel*fT[2*it - 1];
         y[1] = p1[1] + ydel*fT[2*it - 1];
         gPad->PaintPolyLine(2, x, y);
      }
   }

   //          M O D I F Y    S C R E E N
   for (i = 1; i <= np; ++i) {
      i1 = i;
      i2 = i + 1;
      if (i == np) i2 = 1;
      ModifyScreen(&p3[i1*3 - 3], &p3[i2*3 - 3]);
   }
}


//______________________________________________________________________________
void TPainter3dAlgorithms::DrawFaceRaster1(Int_t *icodes, Double_t *xyz, Int_t np, Int_t *iface, Double_t *tt)
{
   // Draw face - 1st variant for "RASTER SCREEN" algorithm
   //
   //    Function: Draw face - 1st variant for "RASTER SCREEN" algorithm
   //              (draw face with level lines)
   //
   //    References: FindLevelLines, WCtoNDC,
   //                FindVisibleLine, FillPolygonBorder
   //
   //    Input: ICODES(*) - set of codes for the line (not used)
   //             ICODES(1) - IX
   //             ICODES(2) - IY
   //           XYZ(3,*)  - coordinates of nodes
   //           NP        - number of nodes
   //           IFACE(NP) - face
   //           TT(NP)    - additional function defined on this face
   //                       (not used in this routine)

   Double_t xdel, ydel;
   Int_t i, k, i1, i2, il, it;
   Double_t x[2], y[2];
   Double_t p1[3], p2[3], p3[36]        /* was [3][12] */;
   Double_t pp[24]        /* was [2][12] */;
   TView *view = 0;

   if (gPad) view = gPad->GetView();
   if (!view) return;

   //          C O P Y   P O I N T S   T O   A R R A Y
   /* Parameter adjustments */
   --tt;
   --iface;
   xyz -= 4;
   --icodes;

   for (i = 1; i <= np; ++i) {
      k = iface[i];
      if (k < 0) k = -k;
      p3[i*3 - 3] = xyz[k*3 + 1];
      p3[i*3 - 2] = xyz[k*3 + 2];
      p3[i*3 - 1] = xyz[k*3 + 3];
      view->WCtoNDC(&p3[i*3 - 3], &pp[2*i - 2]);
   }

   //          F I N D   L E V E L   L I N E S
   FindLevelLines(np, p3, &tt[1]);

   //          D R A W   L E V E L   L I N E S
   SetLineStyle(3);
   if (icodes[3]==0) {  // front & back boxes
      SetLineColor(1);
      SetLineWidth(1);
   } else {
      SetLineColor(fEdgeColor[fEdgeIdx]);
      SetLineWidth(fEdgeWidth[fEdgeIdx]);
   }
   TAttLine::Modify();
   for (il = 1; il <= fNlines; ++il) {
      view->WCtoNDC(&fPlines[(2*il + 1)*3 - 9], p1);
      view->WCtoNDC(&fPlines[(2*il + 2)*3 - 9], p2);
      FindVisibleLine(p1, p2, 100, fNT, fT);
      xdel = p2[0] - p1[0];
      ydel = p2[1] - p1[1];
      for (it = 1; it <= fNT; ++it) {
         x[0] = p1[0] + xdel*fT[2*it - 2];
         y[0] = p1[1] + ydel*fT[2*it - 2];
         x[1] = p1[0] + xdel*fT[2*it - 1];
         y[1] = p1[1] + ydel*fT[2*it - 1];
         gPad->PaintPolyLine(2, x, y);
      }
   }

   //          D R A W   F A C E
   if (icodes[3]==0) {  // front & back boxes
      SetLineColor(1);
      SetLineStyle(1);
      SetLineWidth(1);
   } else {
      SetLineColor(fEdgeColor[fEdgeIdx]);
      SetLineStyle(fEdgeStyle[fEdgeIdx]);
      SetLineWidth(fEdgeWidth[fEdgeIdx]);
   }
   TAttLine::Modify();
   for (i = 1; i <= np; ++i) {
      if (iface[i] < 0) continue;
      i1 = i;
      i2 = i + 1;
      if (i == np) i2 = 1;
      FindVisibleLine(&pp[2*i1 - 2], &pp[2*i2 - 2], 100, fNT, fT);
      xdel = pp[2*i2 - 2] - pp[2*i1 - 2];
      ydel = pp[2*i2 - 1] - pp[2*i1 - 1];
      for (it = 1; it <= fNT; ++it) {
         x[0] = pp[2*i1 - 2] + xdel*fT[2*it - 2];
         y[0] = pp[2*i1 - 1] + ydel*fT[2*it - 2];
         x[1] = pp[2*i1 - 2] + xdel*fT[2*it - 1];
         y[1] = pp[2*i1 - 1] + ydel*fT[2*it - 1];
         gPad->PaintPolyLine(2, x, y);
      }
   }

   //          M O D I F Y    S C R E E N
   FillPolygonBorder(np, pp);
}


//______________________________________________________________________________
void TPainter3dAlgorithms::DrawFaceRaster2(Int_t *icodes, Double_t *xyz, Int_t np, Int_t *iface, Double_t *tt)
{
   // Draw face - 2nd variant for "RASTER SCREEN" algorithm
   //
   //    Function: Draw face - 2nd variant for "RASTER SCREEN" algorithm
   //              (draw face for stacked lego plot)
   //
   //    References: WCtoNDC, FindVisibleLine, FillPolygonBorder
   //
   //    Input: ICODES(*) - set of codes for the line (not used)
   //             ICODES(1) - IX
   //             ICODES(2) - IY
   //             ICODES(3) - line code (N of lego)
   //           XYZ(3,*)  - coordinates of nodes
   //           NP        - number of nodes
   //           IFACE(NP) - face
   //           TT(NP)    - additional function defined on this face
   //                       (not used in this routine)

   Double_t xdel, ydel;
   Int_t i, k, i1, i2, it;
   Double_t p[3], x[2], y[2];
   Double_t pp[24]        /* was [2][12] */;
   TView *view = 0;

   if (gPad) view = gPad->GetView();
   if (!view) return;

   //          C O P Y   P O I N T S   T O   A R R A Y
   /* Parameter adjustments */
   --tt;
   --iface;
   xyz -= 4;
   --icodes;

   for (i = 1; i <= np; ++i) {
      k = iface[i];
      if (k < 0) k = -k;
      view->WCtoNDC(&xyz[k*3 + 1], p);
      pp[2*i - 2] = p[0];
      pp[2*i - 1] = p[1];
   }

   //          D R A W   F A C E
   SetLineColor(fEdgeColor[fEdgeIdx]);
   SetLineStyle(fEdgeStyle[fEdgeIdx]);
   SetLineWidth(fEdgeWidth[fEdgeIdx]);
   TAttLine::Modify();
   for (i = 1; i <= np; ++i) {
      if (iface[i] < 0) continue;
      i1 = i;
      i2 = i + 1;
      if (i == np) i2 = 1;
      FindVisibleLine(&pp[2*i1 - 2], &pp[2*i2 - 2], 100, fNT, fT);
      xdel = pp[2*i2 - 2] - pp[2*i1 - 2];
      ydel = pp[2*i2 - 1] - pp[2*i1 - 1];
      for (it = 1; it <= fNT; ++it) {
         x[0] = pp[2*i1 - 2] + xdel*fT[2*it - 2];
         y[0] = pp[2*i1 - 1] + ydel*fT[2*it - 2];
         x[1] = pp[2*i1 - 2] + xdel*fT[2*it - 1];
         y[1] = pp[2*i1 - 1] + ydel*fT[2*it - 1];
         gPad->PaintPolyLine(2, x, y);
      }
   }

   //          M O D I F Y    R A S T E R   S C R E E N
   FillPolygonBorder(np, pp);
}


//______________________________________________________________________________
void TPainter3dAlgorithms::FillPolygon(Int_t n, Double_t *p, Double_t *f)
{
   // Fill polygon with function values at vertexes
   //
   //    Input: N      - number of vertexes
   //           P(3,*) - polygon
   //           F(*)   - function values at nodes
   //
   //    Errors: - illegal number of vertexes in polygon
   //            - illegal call of FillPolygon: no levels

   Int_t ilev, i, k, icol, i1, i2, nl, np;
   Double_t fmin, fmax;
   Double_t x[12], y[12], f1, f2;
   Double_t p3[36]        /* was [3][12] */;
   Double_t funmin, funmax;

   /* Parameter adjustments */
   --f;
   p -= 4;

   if (n < 3) {
      Error("FillPolygon", "illegal number of vertices in polygon (%d)", n);
      return;
   }

   if (fNlevel == 0) {
      // Illegal call of FillPolygon: no levels
      return;
   }
   np = n;
   nl = fNlevel;
   if (nl < 0) nl = -nl;
   fmin = f[1];
   fmax = f[1];
   for (i = 2; i <= np; ++i) {
      if (fmin > f[i]) fmin = f[i];
      if (fmax < f[i]) fmax = f[i];
   }
   funmin = fFunLevel[0] - 1;
   if (fmin < funmin) funmin = fmin - 1;
   funmax = fFunLevel[nl - 1] + 1;
   if (fmax > funmax) funmax = fmax + 1;

   //          F I N D   A N D   D R A W   S U B P O L Y G O N S
   f2 = funmin;
   for (ilev = 1; ilev <= nl+1; ++ilev) {
   //         S E T   L E V E L   L I M I T S
      f1 = f2;
      if (ilev == nl + 1) f2 = funmax;
      else                f2 = fFunLevel[ilev - 1];
      if (fmax < f1)  return;
      if (fmin > f2)  continue;
   //         F I N D   S U B P O L Y G O N
      k = 0;
      for (i = 1; i <= np; ++i) {
         i1 = i;
         i2 = i + 1;
         if (i == np) i2 = 1;
         FindPartEdge(&p[i1*3 + 1], &p[i2*3 + 1], f[i1], f[i2], f1, f2, k, p3);
      }
   //         D R A W   S U B P O L Y G O N
      if (k < 3) continue;
      for (i = 1; i <= k; ++i) {
         x[i-1] = p3[i*3-3];
         y[i-1] = p3[i*3-2];
         if (TMath::IsNaN(x[i-1]) || TMath::IsNaN(y[i-1])) return;
      }
      if (ilev==1) {
         icol=gPad->GetFillColor();
      } else {
         icol = fColorLevel[ilev - 2];
      }
      SetFillColor(icol);
      SetFillStyle(1001);
      TAttFill::Modify();
      gPad->PaintFillArea(k, x, y);
   }
}


//______________________________________________________________________________
void TPainter3dAlgorithms::FillPolygonBorder(Int_t nn, Double_t *xy)
{
   // Fill a polygon including border ("RASTER SCREEN")
   //
   //    Input: NN      - number of polygon nodes
   //           XY(2,*) - polygon nodes

   Int_t kbit, nbit, step, ymin, ymax, test[kLmax], xcur[kLmax], xnex[kLmax],
      i, j, k, n, ibase, t, x, y, xscan[24]        /* was [2][kLmax] */,
      yscan, x1[kLmax+2], y1[kLmax+2], x2[kLmax+2], y2[kLmax+2],
      ib, nb, dx, dy, iw, nx, xx, yy, signdx, nstart, xx1, xx2, nxa, nxb;

   //          T R A N S F E R   T O   S C R E E N   C O O R D I N A T E S
   /* Parameter adjustments */
   xy -= 3;

   if (fIfrast) return;

   n = nn;
   x1[0] = 0;
   y1[0] = 0;
   for (i = 1; i <= n; ++i) {
      x1[i - 1] = Int_t(fNxrast*((xy[2*i + 1] - fXrast) /fDXrast) - 0.01);
      y1[i - 1] = Int_t(fNyrast*((xy[2*i + 2] - fYrast) /fDYrast) - 0.01);
   }
   x1[n] = x1[0];
   y1[n] = y1[0];

   //          F I N D   Y - M I N   A N D   Y - M A X
   //          S E T   R I G H T   E D G E   O R I E N T A T I O N
   ymin = y1[0];
   ymax = y1[0];
   for (i = 1; i <= n; ++i) {
      if (ymin > y1[i - 1])   ymin = y1[i - 1];
      if (ymax < y1[i - 1])   ymax = y1[i - 1];
      if (y1[i - 1] <= y1[i]) {x2[i - 1] = x1[i]; y2[i - 1] = y1[i];}
      else {
         x2[i - 1] = x1[i - 1];
         y2[i - 1] = y1[i - 1];
         x1[i - 1] = x1[i];
         y1[i - 1] = y1[i];
      }
   }
   if (ymin >= fNyrast) return;
   if (ymax < 0)        return;
   if (ymax >= fNyrast) ymax = fNyrast - 1;

   //          S O R T   L I N E S
   for (i = 1; i < n; ++i) {
      if (y1[i] >= y1[i - 1]) continue;
      y = y1[i];
      k = 1;
      for (j = i - 1; j >= 1; --j) {
         if (y < y1[j - 1]) continue;
         k = j + 1;
         break;
      }
      x = x1[i];
      xx = x2[i];
      yy = y2[i];
      for (j = i; j >= k; --j) {
         x1[j] = x1[j - 1];
         y1[j] = y1[j - 1];
         x2[j] = x2[j - 1];
         y2[j] = y2[j - 1];
      }
      x1[k - 1] = x;
      y1[k - 1] = y;
      x2[k - 1] = xx;
      y2[k - 1] = yy;
   }

   //          S E T   I N I T I A L   V A L U E S
   for (i = 1; i <= n; ++i) {
      xcur[i - 1] = x1[i - 1];
      dy = y2[i - 1] - y1[i - 1];
      dx = x2[i - 1] - x1[i - 1];
      signdx = 1;
      if (dx < 0)   signdx = -1;
      if (dx < 0)   dx = -dx;
      if (dx <= dy) {
         t = -(dy + 1) / 2 + dx;
         if (t < 0) {
            test[i - 1] = t;
            xnex[i - 1] = xcur[i - 1];
         } else {
            test[i - 1] = t - dy;
            xnex[i - 1] = xcur[i - 1] + signdx;
         }
      } else if (dy != 0) {
         step = (dx - 1) / (dy + dy) + 1;
         test[i - 1] = step*dy - (dx + 1) / 2 - dx;
         xnex[i - 1] = xcur[i - 1] + signdx*step;
      }
   }

   //          L O O P   O N   S C A N   L I N E S
   nstart = 1;
   for (yscan = ymin; yscan <= ymax; ++yscan) {
      nx  = 0;
      nxa = 0;
      nxb = kLmax + 1;
      for (i = nstart; i <= n; ++i) {
         if (y1[i - 1] > yscan) goto L500;
         if (y2[i - 1] <= yscan) {
            if (i == nstart)       ++nstart;
            if (y2[i - 1] != yscan)continue;
            --nxb;
            if (x2[i - 1] >= xcur[i - 1]) {
               xscan[2*nxb - 2] = xcur[i - 1];
               xscan[2*nxb - 1] = x2[i - 1];
            } else {
               xscan[2*nxb - 2] = x2[i - 1];
               xscan[2*nxb - 1] = xcur[i - 1];
            }
            continue;
         }

   //          S T O R E   C U R R E N T  X
   //          P R E P A R E   X   F O R   N E X T   S C A N - L I N E
         ++nxa;
         dy = y2[i - 1] - y1[i - 1];
         dx = x2[i - 1] - x1[i - 1];
         if (dx >= 0) {
            signdx = 1;
            xscan[2*nxa - 2] = xcur[i - 1];
            xscan[2*nxa - 1] = xnex[i - 1];
            if (xscan[2*nxa - 2] != xscan[2*nxa - 1]) {
               --xscan[2*nxa - 1];
            }
         } else {
            dx = -dx;
            signdx = -1;
            xscan[2*nxa - 2] = xnex[i - 1];
            xscan[2*nxa - 1] = xcur[i - 1];
            if (xscan[2*nxa - 2] != xscan[2*nxa - 1]) {
               ++xscan[2*nxa - 2];
            }
         }
         xcur[i - 1] = xnex[i - 1];
         if (dx <= dy) {
            test[i - 1] += dx;
            if (test[i - 1] < 0) continue;
            test[i - 1] -= dy;
            xnex[i - 1] += signdx;
            continue;
         }
         step = dx / dy;
         t = test[i - 1] + step*dy;
         if (t >= 0) {
            test[i - 1] = t - dx;
            xnex[i - 1] += signdx*step;
         } else {
            test[i - 1] = t + dy - dx;
            xnex[i - 1] += signdx*(step + 1);
         }
      }

   //          S O R T   P O I N T S   A L O N G   X
L500:
      if (yscan < 0) continue;
      ibase = yscan*fNxrast;
      if (nxa >= 2) {
         for (i = 1; i < nxa; ++i) {
            for (j = i; j >= 1; --j) {
               if (xscan[2*j] >= xscan[2*j - 2]) continue;
               x = xscan[2*j];
               xscan[2*j] = xscan[2*j - 2];
               xscan[2*j - 2] = x;
               x = xscan[2*j - 1];
               xscan[2*j + 1] = xscan[2*j - 1];
               xscan[2*j - 1] = x;
            }
         }
         for (i = 1; i <= nxa; i += 2) {
            ++nx;
            xscan[2*nx - 2] = xscan[2*i - 2];
            x = xscan[2*i + 1];
            if (xscan[2*i - 1] > x) x = xscan[2*i - 1];
            xscan[2*nx - 1] = x;
         }
      }
      if (nxb <= kLmax) {
         for (i = nxb; i <= kLmax; ++i) {
            ++nx;
            xscan[2*nx - 2] = xscan[2*i - 2];
            xscan[2*nx - 1] = xscan[2*i - 1];
         }
      }
   //          C O N C A T E N A T E   A N D   F I L L
      while (nx) {
         xx1 = xscan[2*nx - 2];
         xx2 = xscan[2*nx - 1];
         --nx;
         k = 1;
         while (k <= nx) {
            if ((xscan[2*k - 2] <= xx2 + 1) && (xscan[2*k - 1] >= xx1 - 1)) {
               if (xscan[2*k - 2] < xx1)     xx1 = xscan[2*k - 2];
               if (xscan[2*k - 1] > xx2)     xx2 = xscan[2*k - 1];
               xscan[2*k - 2] = xscan[2*nx - 2];
               xscan[2*k - 1] = xscan[2*nx - 1];
               --nx;
            } else  ++k;
         }
         if (xx1 < 0)        xx1 = 0;
         if (xx2 >= fNxrast) xx2 = fNxrast - 1;
         nbit = xx2 - xx1 + 1;
         kbit = ibase + xx1;
         iw = kbit / 30;
         ib = kbit - iw*30 + 1;
         iw = iw + 1;
         nb = 30 - ib + 1;
         if (nb > nbit) nb = nbit;
         fRaster[iw - 1] = fRaster[iw - 1] | fMask[fJmask[nb - 1] + ib - 1];
         nbit -= nb;
         if (nbit) {
            while(nbit > 30) {
               fRaster[iw] = fMask[464];
               ++iw;
               nbit += -30;
            }
            fRaster[iw] = fRaster[iw] | fMask[fJmask[nbit - 1]];
            ++iw;
         }
      }
   }
}


//______________________________________________________________________________
void TPainter3dAlgorithms::FindLevelLines(Int_t np, Double_t *f, Double_t *t)
{
   // Find level lines for face
   //
   //    Input: NP      - number of nodes
   //           F(3,NP) - face
   //           T(NP)   - additional function
   //
   //    Error: number of points for line not equal 2

   Int_t i, k, i1, i2, il, nl;
   Double_t tmin, tmax, d1, d2;

   /* Parameter adjustments */
   --t;
   f -= 4;

   /* Function Body */
   fNlines = 0;
   if (fNlevel == 0) return;
   nl = fNlevel;
   if (nl < 0) nl = -nl;

   //         F I N D   Tmin   A N D   Tmax
   tmin = t[1];
   tmax = t[1];
   for (i = 2; i <= np; ++i) {
      if (t[i] < tmin) tmin = t[i];
      if (t[i] > tmax) tmax = t[i];
   }
   if (tmin >= fFunLevel[nl - 1]) return;
   if (tmax <= fFunLevel[0])      return;

   //          F I N D   L E V E L S   L I N E S
   for (il = 1; il <= nl; ++il) {
      if (tmin >= fFunLevel[il - 1]) continue;
      if (tmax <= fFunLevel[il - 1]) return;
      if (fNlines >= 200)            return;
      ++fNlines;
      fLevelLine[fNlines - 1] = il;
      k = 0;
      for (i = 1; i <= np; ++i) {
         i1 = i;
         i2 = i + 1;
         if (i == np) i2 = 1;
         d1 = t[i1] - fFunLevel[il - 1];
         d2 = t[i2] - fFunLevel[il - 1];
         if (d1) {
            if (d1*d2 < 0) goto L320;
            continue;
         }
         ++k;
         fPlines[(k + 2*fNlines)*3 - 9] = f[i1*3 + 1];
         fPlines[(k + 2*fNlines)*3 - 8] = f[i1*3 + 2];
         fPlines[(k + 2*fNlines)*3 - 7] = f[i1*3 + 3];
         if (k == 1) continue;
         goto L340;
L320:
         ++k;
         d1 /= t[i2] - t[i1];
         d2 /= t[i2] - t[i1];
         fPlines[(k + 2*fNlines)*3 - 9] = d2*f[i1*3 + 1] - d1*f[i2*3 + 1];
         fPlines[(k + 2*fNlines)*3 - 8] = d2*f[i1*3 + 2] - d1*f[i2*3 + 2];
         fPlines[(k + 2*fNlines)*3 - 7] = d2*f[i1*3 + 3] - d1*f[i2*3 + 3];
         if (k != 1) goto L340;
      }
      if (k != 2) {
         Error("FindLevelLines", "number of points for line not equal 2");
         --fNlines;
      }
L340:
      if (il < 0) return;
   }
}


//______________________________________________________________________________
void TPainter3dAlgorithms::FindPartEdge(Double_t *p1, Double_t *p2, Double_t f1,
                                        Double_t f2, Double_t fmin,
                                        Double_t fmax, Int_t &kpp, Double_t *pp)
{
   // Find part of edge
   //
   //    Function: Find part of edge where function defined on this edge
   //              has value from FMIN to FMAX
   //
   //    Input: P1(3) - 1st point
   //           P2(3) - 2nd point
   //           F1    - function value at 1st point
   //           F2    - function value at 2nd point
   //           FMIN  - min value of layer
   //           FMAX  - max value of layer
   //
   //    Output: KPP - current number of point
   //            PP(3,*) - coordinates of new face

   Double_t d1, d2;
   Int_t k1, k2, kk;

   /* Parameter adjustments */
   pp -= 4;
   --p2;
   --p1;

   k1 = 0;
   if (f1 < fmin)  k1 = -2;
   if (f1 == fmin) k1 = -1;
   if (f1 == fmax) k1 = 1;
   if (f1 > fmax)  k1 = 2;
   k2 = 0;
   if (f2 < fmin)  k2 = -2;
   if (f2 == fmin) k2 = -1;
   if (f2 == fmax) k2 = 1;
   if (f2 > fmax)  k2 = 2;
   kk = (k1 + 2)*5 + (k2 + 2) + 1;

   //    K2:    -2  -1   0  +1  +2
   //    K1:    -2 -1 0 +1 +2
   switch ((int)kk) {
      case 1:  return;
      case 2:  return;
      case 3:  goto L200;
      case 4:  goto L200;
      case 5:  goto L600;
      case 6:  goto L100;
      case 7:  goto L100;
      case 8:  goto L100;
      case 9:  goto L100;
      case 10:  goto L500;
      case 11:  goto L400;
      case 12:  goto L100;
      case 13:  goto L100;
      case 14:  goto L100;
      case 15:  goto L500;
      case 16:  goto L400;
      case 17:  goto L100;
      case 18:  goto L100;
      case 19:  goto L100;
      case 20:  goto L100;
      case 21:  goto L700;
      case 22:  goto L300;
      case 23:  goto L300;
      case 24:  return;
      case 25:  return;
   }

   //          1 - S T   P O I N T
L100:
   ++kpp;
   pp[kpp*3 + 1] = p1[1];
   pp[kpp*3 + 2] = p1[2];
   pp[kpp*3 + 3] = p1[3];
   return;

   //           I N T E R S E C T I O N   W I T H   Fmin
L200:
   ++kpp;
   d1 = (fmin - f1) / (f1 - f2);
   d2 = (fmin - f2) / (f1 - f2);
   pp[kpp*3 + 1] = d2*p1[1] - d1*p2[1];
   pp[kpp*3 + 2] = d2*p1[2] - d1*p2[2];
   pp[kpp*3 + 3] = d2*p1[3] - d1*p2[3];
   return;

   //           I N T E R S E C T I O N   W I T H   Fmax
L300:
   ++kpp;
   d1 = (fmax - f1) / (f1 - f2);
   d2 = (fmax - f2) / (f1 - f2);
   pp[kpp*3 + 1] = d2*p1[1] - d1*p2[1];
   pp[kpp*3 + 2] = d2*p1[2] - d1*p2[2];
   pp[kpp*3 + 3] = d2*p1[3] - d1*p2[3];
   return;

   //          1 - S T   P O I N T,   I N T E R S E C T I O N  WITH  Fmin
L400:
   ++kpp;
   pp[kpp*3 + 1] = p1[1];
   pp[kpp*3 + 2] = p1[2];
   pp[kpp*3 + 3] = p1[3];
   ++kpp;
   d1 = (fmin - f1) / (f1 - f2);
   d2 = (fmin - f2) / (f1 - f2);
   pp[kpp*3 + 1] = d2*p1[1] - d1*p2[1];
   pp[kpp*3 + 2] = d2*p1[2] - d1*p2[2];
   pp[kpp*3 + 3] = d2*p1[3] - d1*p2[3];
   return;

   //          1 - S T   P O I N T,   I N T E R S E C T I O N  WITH  Fmax
L500:
   ++kpp;
   pp[kpp*3 + 1] = p1[1];
   pp[kpp*3 + 2] = p1[2];
   pp[kpp*3 + 3] = p1[3];
   ++kpp;
   d1 = (fmax - f1) / (f1 - f2);
   d2 = (fmax - f2) / (f1 - f2);
   pp[kpp*3 + 1] = d2*p1[1] - d1*p2[1];
   pp[kpp*3 + 2] = d2*p1[2] - d1*p2[2];
   pp[kpp*3 + 3] = d2*p1[3] - d1*p2[3];
   return;

   //           I N T E R S E C T I O N   W I T H   Fmin, Fmax
L600:
   ++kpp;
   d1 = (fmin - f1) / (f1 - f2);
   d2 = (fmin - f2) / (f1 - f2);
   pp[kpp*3 + 1] = d2*p1[1] - d1*p2[1];
   pp[kpp*3 + 2] = d2*p1[2] - d1*p2[2];
   pp[kpp*3 + 3] = d2*p1[3] - d1*p2[3];
   ++kpp;
   d1 = (fmax - f1) / (f1 - f2);
   d2 = (fmax - f2) / (f1 - f2);
   pp[kpp*3 + 1] = d2*p1[1] - d1*p2[1];
   pp[kpp*3 + 2] = d2*p1[2] - d1*p2[2];
   pp[kpp*3 + 3] = d2*p1[3] - d1*p2[3];
   return;

   //          I N T E R S E C T I O N   W I T H   Fmax, Fmin
L700:
   ++kpp;
   d1 = (fmax - f1) / (f1 - f2);
   d2 = (fmax - f2) / (f1 - f2);
   pp[kpp*3 + 1] = d2*p1[1] - d1*p2[1];
   pp[kpp*3 + 2] = d2*p1[2] - d1*p2[2];
   pp[kpp*3 + 3] = d2*p1[3] - d1*p2[3];
   ++kpp;
   d1 = (fmin - f1) / (f1 - f2);
   d2 = (fmin - f2) / (f1 - f2);
   pp[kpp*3 + 1] = d2*p1[1] - d1*p2[1];
   pp[kpp*3 + 2] = d2*p1[2] - d1*p2[2];
   pp[kpp*3 + 3] = d2*p1[3] - d1*p2[3];
}


//______________________________________________________________________________
void TPainter3dAlgorithms::FindVisibleDraw(Double_t *r1, Double_t *r2)
{
   // Find visible parts of line (draw line)
   //
   //    Input: R1(3)  - 1-st point of the line
   //           R2(3)  - 2-nd point of the line

   Double_t yy1u, yy2u;
   Int_t i, icase, i1, i2, icase1, icase2, iv, ifback;
   Double_t x1, x2, y1, y2, z1, z2, dd, di;
   Double_t dt, dy;
   Double_t tt, uu, ww, yy, yy1, yy2, yy1d, yy2d;
   Double_t *tn = 0;
   const Double_t kEpsil = 1.e-6;
   /* Parameter adjustments */
   --r2;
   --r1;
   TView *view = 0;

   if (gPad) view = gPad->GetView();
   if (view) {
      tn = view->GetTN();
      if (tn) {
         x1 = tn[0]*r1[1] + tn[1]*r1[2] + tn[2]*r1[3]  + tn[3];
         x2 = tn[0]*r2[1] + tn[1]*r2[2] + tn[2]*r2[3]  + tn[3];
         y1 = tn[4]*r1[1] + tn[5]*r1[2] + tn[6]*r1[3]  + tn[7];
         y2 = tn[4]*r2[1] + tn[5]*r2[2] + tn[6]*r2[3]  + tn[7];
         z1 = tn[8]*r1[1] + tn[9]*r1[2] + tn[10]*r1[3] + tn[11];
         z2 = tn[8]*r2[1] + tn[9]*r2[2] + tn[10]*r2[3] + tn[11];
      } else {
         Error("FindVisibleDraw", "invalid TView in current pad");
         return;
      }
   } else {
      Error("FindVisibleDraw", "no TView in current pad");
      return;
   }

   ifback = 0;
   if (x1 >= x2) {
      ifback = 1;
      ww = x1;
      x1 = x2;
      x2 = ww;
      ww = y1;
      y1 = y2;
      y2 = ww;
      ww = z1;
      z1 = z2;
      z2 = ww;
   }
   fNT = 0;
   i1 = Int_t((x1 - fX0) / fDX) + 15;
   i2 = Int_t((x2 - fX0) / fDX) + 15;
   x1 = fX0 + (i1 - 1)*fDX;
   x2 = fX0 + (i2 - 1)*fDX;
   if (i1 != i2) {

   //          F I N D   V I S I B L E   P A R T S   O F   T H E   L I N E
      di = (Double_t) (i2 - i1);
      dy = (y2 - y1) / di;
      dt = 1 / di;
      iv = -1;
      for (i = i1; i <= i2 - 1; ++i) {
         yy1 = y1 + dy*(i - i1);
         yy2 = yy1 + dy;
         yy1u = yy1 - fU[2*i - 2];
         yy1d = yy1 - fD[2*i - 2];
         yy2u = yy2 - fU[2*i - 1];
         yy2d = yy2 - fD[2*i - 1];
         tt = dt*(i - i1);
   //         A N A L I Z E   L E F T   S I D E
         icase1 = 1;
         if (yy1u >  kEpsil) icase1 = 0;
         if (yy1d < -kEpsil) icase1 = 2;
         if ((icase1 == 0 || icase1 == 2) && iv <= 0) {
            iv = 1;
            ++fNT;
            fT[2*fNT - 2] = tt;
         }
         if (icase1 == 1 && iv >= 0) {
            iv = -1;
            fT[2*fNT - 1] = tt;
         }
   //         A N A L I Z E   R I G H T   S I D E
         icase2 = 1;
         if (yy2u >  kEpsil) icase2 = 0;
         if (yy2d < -kEpsil) icase2 = 2;
         icase = icase1*3 + icase2;
         if (icase == 1) {
            iv = -1;
            fT[2*fNT - 1] = tt + dt*(yy1u / (yy1u - yy2u));
         }
         if (icase == 2) {
            fT[2*fNT - 1] = tt + dt*(yy1u / (yy1u - yy2u));
            ++fNT;
            fT[2*fNT - 2] = tt + dt*(yy1d / (yy1d - yy2d));
         }
         if (icase == 3) {
            iv = 1;
            ++fNT;
            fT[2*fNT - 2] = tt + dt*(yy1u / (yy1u - yy2u));
         }
         if (icase == 5) {
            iv = 1;
            ++fNT;
            fT[2*fNT - 2] = tt + dt*(yy1d / (yy1d - yy2d));
         }
         if (icase == 6) {
            fT[2*fNT - 1] = tt + dt*(yy1d / (yy1d - yy2d));
            ++fNT;
            fT[2*fNT - 2] = tt + dt*(yy1u / (yy1u - yy2u));
         }
         if (icase == 7) {
            iv = -1;
            fT[2*fNT - 1] = tt + dt*(yy1d / (yy1d - yy2d));
         }
         if (fNT + 1 >= 100) break;
      }
      if (iv > 0) fT[2*fNT - 1] = 1;
   } else {

   //          V E R T I C A L   L I N E
      fNT = 1;
      fT[0] = 0;
      fT[1] = 1;
      if (y2 <= y1) {
         if (y2 == y1) { fNT = 0; return;}
         ifback = 1 - ifback;
         yy = y1;
         y1 = y2;
         y2 = yy;
      }
      uu = fU[2*i1 - 2];
      dd = fD[2*i1 - 2];
      if (i1 != 1) {
         if (uu < fU[2*i1 - 3]) uu = fU[2*i1 - 3];
         if (dd > fD[2*i1 - 3]) dd = fD[2*i1 - 3];
      }
   //         F I N D   V I S I B L E   P A R T   O F   L I N E
      if (y1 <  uu && y2 >  dd) {
         if (y1 >= dd && y2 <= uu) {fNT = 0; return;}
         fNT = 0;
         if (dd > y1) {
            ++fNT;
            fT[2*fNT - 2] = 0;
            fT[2*fNT - 1] = (dd - y1) / (y2 - y1);
         }
         if (uu < y2) {
            ++fNT;
            fT[2*fNT - 2] = (uu - y1) / (y2 - y1);
            fT[2*fNT - 1] = 1;
         }
      }
   }

   if (ifback == 0) return;
   if (fNT == 0)    return;
   for (i = 1; i <= fNT; ++i) {
      fT[2*i - 2] = 1 - fT[2*i - 2];
      fT[2*i - 1] = 1 - fT[2*i - 1];
   }
}


//______________________________________________________________________________
void TPainter3dAlgorithms::FindVisibleLine(Double_t *p1, Double_t *p2, Int_t ntmax, Int_t &nt, Double_t *t)
{
   // Find visible part of a line ("RASTER SCREEN")
   //
   //    Input: P1(2) - 1st point of the line
   //           P2(2) - 2nd point of the line
   //           NTMAX - max allowed number of visible segments
   //
   //    Output: NT     - number of visible segments of the line
   //            T(2,*) - visible segments

   Double_t ddtt;
   Double_t tcur;
   Int_t i, incrx, ivis, x1, y1, x2, y2, ib, kb, dx, dy, iw, ix, iy, ifinve, dx2, dy2;
   Double_t t1, t2;
   Double_t dt;
   Double_t tt;
   /* Parameter adjustments */
   t -= 3;
   --p2;
   --p1;

   if (fIfrast) {
      nt = 1;
      t[3] = 0;
      t[4] = 1;
      return;
   }
   x1 = Int_t(fNxrast*((p1[1] - fXrast) / fDXrast) - 0.01);
   y1 = Int_t(fNyrast*((p1[2] - fYrast) / fDYrast) - 0.01);
   x2 = Int_t(fNxrast*((p2[1] - fXrast) / fDXrast) - 0.01);
   y2 = Int_t(fNyrast*((p2[2] - fYrast) / fDYrast) - 0.01);
   ifinve = 0;
   if (y1 > y2) {
      ifinve = 1;
      iw = x1;
      x1 = x2;
      x2 = iw;
      iw = y1;
      y1 = y2;
      y2 = iw;
   }
   nt   = 0;
   ivis = 0;
   if (y1 >= fNyrast) return;
   if (y2 < 0)        return;
   if (x1 >= fNxrast && x2 >= fNxrast) return;
   if (x1 < 0 && x2 < 0)               return;

   //          S E T   I N I T I A L   V A L U E S
   incrx = 1;
   dx = x2 - x1;
   if (dx < 0) {
      dx = -dx;
      incrx = -1;
   }
   dy  = y2 - y1;
   dx2 = dx + dx;
   dy2 = dy + dy;
   if (dy > dx) goto L200;

   //          D X   . G T .   D Y
   dt = 1./ (Double_t)(dx + 1.);
   ddtt = dt*(float).5;
   tcur = -(Double_t)dt;
   tt = (Double_t) (-(dx + dy2));
   iy = y1;
   kb = iy*fNxrast + x1 - incrx;
   for (ix = x1; incrx < 0 ? ix >= x2 : ix <= x2; ix += incrx) {
      kb += incrx;
      tcur += dt;
      tt += dy2;
      if (tt >= 0) {
         ++iy;
         tt -= dx2;
         kb += fNxrast;
      }
      if (iy < 0)        goto L110;
      if (iy >= fNyrast) goto L110;
      if (ix < 0)        goto L110;
      if (ix >= fNxrast) goto L110;
      iw = kb / 30;
      ib = kb - iw*30 + 1;
      if (fRaster[iw] & fMask[ib - 1]) goto L110;
      if (ivis > 0)      continue;
      ivis = 1;
      ++nt;
      t[2*nt + 1] = tcur;
      continue;
L110:
      if (ivis == 0) continue;
      ivis = 0;
      t[2*nt + 2] = tcur;
      if (nt == ntmax)  goto L300;
   }
   if (ivis > 0) t[2*nt + 2] = tcur + dt + ddtt;
   goto L300;

   //          D Y   . G T .   D X
L200:
   dt = 1. / (Double_t)(dy + 1.);
   ddtt = dt*(float).5;
   tcur = -(Double_t)dt;
   tt = (Double_t) (-(dy + dx2));
   ix = x1;
   if (y2 >= fNyrast) y2 = fNyrast - 1;
   kb = (y1 - 1)*fNxrast + ix;
   for (iy = y1; iy <= y2; ++iy) {
      kb += fNxrast;
      tcur += dt;
      tt += dx2;
      if (tt >= 0) {
         ix += incrx;
         tt -= dy2;
         kb += incrx;
      }
      if (iy < 0)        goto L210;
      if (ix < 0)        goto L210;
      if (ix >= fNxrast) goto L210;
      iw = kb / 30;
      ib = kb - iw*30 + 1;
      if (fRaster[iw] & fMask[ib - 1]) goto L210;
      if (ivis > 0) continue;
      ivis = 1;
      ++nt;
      t[2*nt + 1] = tcur;
      continue;
L210:
      if (ivis == 0) continue;
      ivis = 0;
      t[2*nt + 2] = tcur;
      if (nt == ntmax) goto L300;
   }
   if (ivis > 0) t[2*nt + 2] = tcur + dt;

   //          C H E C K   D I R E C T I O N   O F   P A R A M E T E R
L300:
   if (nt == 0) return;
   dt *= 1.1;
   if (t[3] <= dt) t[3] = 0;
   if (t[2*nt + 2] >= 1 - dt) t[2*nt + 2] = 1;
   if (ifinve == 0) return;
   for (i = 1; i <= nt; ++i) {
      t1 = t[2*i + 1];
      t2 = t[2*i + 2];
      t[2*i + 1] = 1 - t2;
      t[2*i + 2] = 1 - t1;
   }
}


//______________________________________________________________________________
void TPainter3dAlgorithms::FrontBox(Double_t ang)
{
   // Draw forward faces of surrounding box & axes
   //
   //    Function: Draw forward faces of surrounding box & axes
   //
   //    References: AxisVertex, Gaxis
   //
   //    Input  ANG     - angle between X and Y axis
   //
   //           DRFACE(ICODES,XYZ,NP,IFACE,T) - routine for face drawing
   //             ICODES(*) - set of codes for this face
   //             NP        - number of nodes in face
   //             IFACE(NP) - face
   //             T(NP)     - additional function

   /* Initialized data */
   static Int_t iface1[4] = { 1,2,6,5 };
   static Int_t iface2[4] = { 2,3,7,6 };

   Double_t cosa, sina;
   Double_t r[24]        /* was [3][8] */, av[24]        /* was [3][8] */;
   Int_t icodes[3];
   Double_t fdummy[1];
   Int_t i, ix1, ix2, iy1, iy2, iz1, iz2;
   TView *view = 0;

   if (gPad) view = gPad->GetView();
   if (!view) {
      Error("FrontBox", "no TView in current pad");
      return;
   }

   cosa = TMath::Cos(kRad*ang);
   sina = TMath::Sin(kRad*ang);
   view->AxisVertex(ang, av, ix1, ix2, iy1, iy2, iz1, iz2);
   for (i = 1; i <= 8; ++i) {
      r[i*3 - 3] = av[i*3 - 3] + av[i*3 - 2] * cosa;
      r[i*3 - 2] = av[i*3 - 2] * sina;
      r[i*3 - 1] = av[i*3 - 1];
   }

   //          D R A W   F O R W A R D   F A C E S
   icodes[0] = 0;
   icodes[1] = 0;
   icodes[2] = 0;
   (this->*fDrawFace)(icodes, r, 4, iface1, fdummy);
   (this->*fDrawFace)(icodes, r, 4, iface2, fdummy);
}


//______________________________________________________________________________
void TPainter3dAlgorithms::GouraudFunction(Int_t ia, Int_t ib, Double_t *face, Double_t *t)
{
   // Find part of surface with luminosity in the corners
   //
   //              This routine is used for Gouraud shading

   Int_t iphi;
   static Double_t f[108];        /* was [3][4][3][3] */
   Int_t i, j, k;
   Double_t r, s, x[36];        /* was [4][3][3] */
   Double_t y[36];        /* was [4][3][3] */
   Double_t z[36];        /* was [4][3][3] */
   Int_t incrx[3], incry[3];

   Double_t x1, x2, y1, y2, z1, z2, th, an[27];        /* was [3][3][3] */
   Double_t bn[12];    /* was [3][2][2] */

   Double_t rad;
   Double_t phi;
   Int_t ixt, iyt;

    /* Parameter adjustments */
   --t;
   face -= 4;

   iphi = 1;
   rad = TMath::ATan(1) * (float)4 / (float)180;

   //        Find real cell indexes
   ixt = ia + Hparam.xfirst - 1;
   iyt = ib + Hparam.yfirst - 1;

   //        Find increments of neighboring cells
   incrx[0] = -1;
   incrx[1] = 0;
   incrx[2] = 1;
   if (ixt == 1) incrx[0] = 0;
   if (ixt == Hparam.xlast - 1) incrx[2] = 0;
   incry[0] = -1;
   incry[1] = 0;
   incry[2] = 1;
   if (iyt == 1) incry[0] = 0;
   if (iyt == Hparam.ylast - 1) incry[2] = 0;

   //        Find neighboring faces
   Int_t i1, i2;
   for (j = 1; j <= 3; ++j) {
      for (i = 1; i <= 3; ++i) {
         i1 = ia + incrx[i - 1];
         i2 = ib + incry[j - 1];
         SurfaceFunction(i1, i2, &f[(((i + j*3) << 2) + 1)*3 - 51], &t[1]);
      }
   }

   //       Set face
   for (k = 1; k <= 4; ++k) {
      for (i = 1; i <= 3; ++i) {
         face[i + k*3] = f[i + (k + 32)*3 - 52];
      }
   }

   //       Find coordinates and normales
   for (j = 1; j <= 3; ++j) {
      for (i = 1; i <= 3; ++i) {
         for (k = 1; k <= 4; ++k) {
            if (Hoption.System == kPOLAR) {
               phi = f[iphi + (k + ((i + j*3) << 2))*3 - 52]*rad;
               r = f[3 - iphi + (k + ((i + j*3) << 2))*3 - 52];
               x[k + ((i + j*3) << 2) - 17] = r * TMath::Cos(phi);
               y[k + ((i + j*3) << 2) - 17] = r * TMath::Sin(phi);
               z[k + ((i + j*3) << 2) - 17] = f[(k + ((i + j*3) << 2))*3 - 49];
            } else if (Hoption.System == kCYLINDRICAL) {
               phi = f[iphi + (k + ((i + j*3) << 2))*3 - 52]*rad;
               r = f[(k + ((i + j*3) << 2))*3 - 49];
               x[k + ((i + j*3) << 2) - 17] = r*TMath::Cos(phi);
               y[k + ((i + j*3) << 2) - 17] = r*TMath::Sin(phi);
               z[k + ((i + j*3) << 2) - 17] = f[3 - iphi + (k + ((i + j*3) << 2))*3 - 52];
            } else if (Hoption.System == kSPHERICAL) {
               phi = f[iphi + (k + ((i + j*3) << 2))*3 - 52]*rad;
               th = f[3 - iphi + (k + ((i + j*3) << 2))*3 - 52]*rad;
               r = f[(k + ((i + j*3) << 2))*3 - 49];
               x[k + ((i + j*3) << 2) - 17] = r*TMath::Sin(th)*TMath::Cos(phi);
               y[k + ((i + j*3) << 2) - 17] = r*TMath::Sin(th)*TMath::Sin(phi);
               z[k + ((i + j*3) << 2) - 17] = r*TMath::Cos(th);
            } else if (Hoption.System == kRAPIDITY) {
               phi = f[iphi + (k + ((i + j*3) << 2))*3 - 52]*rad;
               th = f[3 - iphi + (k + ((i + j*3) << 2))*3 - 52]*rad;
               r = f[(k + ((i + j*3) << 2))*3 - 49];
               x[k + ((i + j*3) << 2) - 17] = r*TMath::Cos(phi);
               y[k + ((i + j*3) << 2) - 17] = r*TMath::Sin(phi);
               z[k + ((i + j*3) << 2) - 17] = r*TMath::Cos(th) / TMath::Sin(th);
            } else {
               x[k + ((i + j*3) << 2) - 17] = f[(k + ((i + j*3) << 2))*3 - 51];
               y[k + ((i + j*3) << 2) - 17] = f[(k + ((i + j*3) << 2))*3 - 50];
               z[k + ((i + j*3) << 2) - 17] = f[(k + ((i + j*3) << 2))*3 - 49];
            }
         }
         x1 = x[((i + j*3) << 2) - 14] - x[((i + j*3) << 2) - 16];
         x2 = x[((i + j*3) << 2) - 13] - x[((i + j*3) << 2) - 15];
         y1 = y[((i + j*3) << 2) - 14] - y[((i + j*3) << 2) - 16];
         y2 = y[((i + j*3) << 2) - 13] - y[((i + j*3) << 2) - 15];
         z1 = z[((i + j*3) << 2) - 14] - z[((i + j*3) << 2) - 16];
         z2 = z[((i + j*3) << 2) - 13] - z[((i + j*3) << 2) - 15];
         an[(i + j*3)*3 - 12] = y1*z2 - y2*z1;
         an[(i + j*3)*3 - 11] = z1*x2 - z2*x1;
         an[(i + j*3)*3 - 10] = x1*y2 - x2*y1;
         s = TMath::Sqrt(an[(i + j*3)*3 - 12]*an[(i + j*3)*3 - 12] + an[
                        (i + j*3)*3 - 11]*an[(i + j*3)*3 - 11] + an[(i
                        + j*3)*3 - 10]*an[(i + j*3)*3 - 10]);

         an[(i + j*3)*3 - 12] /= s;
         an[(i + j*3)*3 - 11] /= s;
         an[(i + j*3)*3 - 10] /= s;
      }
   }

   //         Find average normals
   for (j = 1; j <= 2; ++j) {
      for (i = 1; i <= 2; ++i) {
         for (k = 1; k <= 3; ++k) {
            bn[k + (i + 2*j)*3 - 10] = an[k + (i + j*3)*3 - 13]
              + an[k + (i + 1 + j*3)*3 - 13] + an[k + (i + 1 +
                          (j + 1)*3)*3 - 13] + an[k + (i + (j + 1)*3)*3 - 13];
         }
      }
   }

   //        Set luminosity
   Luminosity(bn,     t[1]);
   Luminosity(&bn[3], t[2]);
   Luminosity(&bn[9], t[3]);
   Luminosity(&bn[6], t[4]);
}


//______________________________________________________________________________
void TPainter3dAlgorithms::InitMoveScreen(Double_t xmin, Double_t xmax)
{
   // Initialize "MOVING SCREEN" method
   //
   //    Input: XMIN - left boundary
   //           XMAX - right boundary

   fX0 = xmin;
   fDX = (xmax - xmin) / 1000;
   for (Int_t i = 1; i <= 1000; ++i) {
      fU[2*i - 2] = (float)-999;
      fU[2*i - 1] = (float)-999;
      fD[2*i - 2] = (float)999;
      fD[2*i - 1] = (float)999;
   }
}


//______________________________________________________________________________
void TPainter3dAlgorithms::InitRaster(Double_t xmin, Double_t ymin, Double_t xmax, Double_t ymax, Int_t nx, Int_t ny  )
{
   // Initialize hidden lines removal algorithm (RASTER SCREEN)
   //
   //    Input: XMIN - Xmin in the normalized coordinate system
   //           YMIN - Ymin in the normalized coordinate system
   //           XMAX - Xmax in the normalized coordinate system
   //           YMAX - Ymax in the normalized coordinate system
   //           NX   - number of pixels along X
   //           NY   - number of pixels along Y

   Int_t i, j, k, ib, nb;

   fNxrast = nx;
   fNyrast = ny;
   fXrast  = xmin;
   fDXrast = xmax - xmin;
   fYrast  = ymin;
   fDYrast = ymax - ymin;

   //  Create buffer for raster
   Int_t buffersize = nx*ny/30 + 1;
   fRaster = new Int_t[buffersize];

   //          S E T   M A S K S
   k = 0;
   Int_t pow2 = 1;
   for (i = 1; i <= 30; ++i) {
      fJmask[i - 1] = k;
      k = k + 30 - i + 1;
      fMask[i - 1] = pow2;
      pow2 *= 2;
   }
   j = 30;
   for (nb = 2; nb <= 30; ++nb) {
      for (ib = 1; ib <= 30 - nb + 1; ++ib) {
         k = 0;
         for (i = ib; i <= ib + nb - 1; ++i) k = k | fMask[i - 1];
         ++j;
         fMask[j - 1] = k;
      }
   }

   //          C L E A R   R A S T E R   S C R E E N
   ClearRaster();
}


//______________________________________________________________________________
void TPainter3dAlgorithms::LegoFunction(Int_t ia, Int_t ib, Int_t &nv, Double_t *ab, Double_t *vv, Double_t *t)
{
   // Service function for Legos

   Int_t i, j, ixt, iyt;
   Double_t yval1l,  yval2l;
   Double_t xlab1l, xlab2l, ylab1l, ylab2l;
   Double_t rinrad = gStyle->GetLegoInnerR();
   Double_t dangle = 10; //Delta angle for Rapidity option

   /* Parameter adjustments */
   t -= 5;
   --vv;
   ab -= 3;

   ixt = ia + Hparam.xfirst - 1;
   iyt = ib + Hparam.yfirst - 1;

   //             Compute the cell position in cartesian coordinates
   //             and compute the LOG if necessary
   Double_t xwid = gCurrentHist->GetXaxis()->GetBinWidth(ixt);
   Double_t ywid = gCurrentHist->GetYaxis()->GetBinWidth(iyt);
   ab[3] = gCurrentHist->GetXaxis()->GetBinLowEdge(ixt) + xwid*Hparam.baroffset;
   ab[4] = gCurrentHist->GetYaxis()->GetBinLowEdge(iyt) + ywid*Hparam.baroffset;
   ab[5] = ab[3] + xwid*Hparam.barwidth;
   ab[8] = ab[4] + ywid*Hparam.barwidth;

   if (Hoption.Logx) {
      if (ab[3] > 0) ab[3]  = TMath::Log10(ab[3]);
      else           ab[3]  = Hparam.xmin;
      if (ab[5] > 0) ab[5]  = TMath::Log10(ab[5]);
      else           ab[5]  = Hparam.xmin;
   }
   // xval1l = Hparam.xmin;
   // xval2l = Hparam.xmax;
   if (Hoption.Logy) {
      if (ab[4] > 0) ab[4]  = TMath::Log10(ab[4]);
      else           ab[4]  = Hparam.ymin;
      if (ab[8] > 0) ab[8]  = TMath::Log10(ab[8]);
      else           ab[8]  = Hparam.ymin;
   }
   yval1l = Hparam.ymin;
   yval2l = Hparam.ymax;

   if (ab[3] < Hparam.xmin) ab[3] = Hparam.xmin;
   if (ab[4] < Hparam.ymin) ab[4] = Hparam.ymin;
   if (ab[5] > Hparam.xmax) ab[5] = Hparam.xmax;
   if (ab[8] > Hparam.ymax) ab[8] = Hparam.ymax;
   if (ab[5] < Hparam.xmin) ab[5] = Hparam.xmin;
   if (ab[8] < Hparam.ymin) ab[8] = Hparam.ymin;

   xlab1l = gCurrentHist->GetXaxis()->GetXmin();
   xlab2l = gCurrentHist->GetXaxis()->GetXmax();
   if (Hoption.Logx) {
      if (xlab2l>0) {
         if (xlab1l>0) xlab1l = TMath::Log10(xlab1l);
         else          xlab1l = TMath::Log10(0.001*xlab2l);
         xlab2l = TMath::Log10(xlab2l);
      }
   }
   ylab1l = gCurrentHist->GetYaxis()->GetXmin();
   ylab2l = gCurrentHist->GetYaxis()->GetXmax();
   if (Hoption.Logy) {
      if (ylab2l>0) {
         if (ylab1l>0) ylab1l = TMath::Log10(ylab1l);
         else          ylab1l = TMath::Log10(0.001*ylab2l);
         ylab2l = TMath::Log10(ylab2l);
      }
   }

   //       Transform the cell position in the required coordinate system
   if (Hoption.System == kPOLAR) {
      ab[3] = 360*(ab[3] - xlab1l) / (xlab2l - xlab1l);
      ab[5] = 360*(ab[5] - xlab1l) / (xlab2l - xlab1l);
      ab[4] = (ab[4] - yval1l) / (yval2l - yval1l);
      ab[8] = (ab[8] - yval1l) / (yval2l - yval1l);
   } else if (Hoption.System == kCYLINDRICAL) {
      ab[3] = 360*(ab[3] - xlab1l) / (xlab2l - xlab1l);
      ab[5] = 360*(ab[5] - xlab1l) / (xlab2l - xlab1l);
   } else if (Hoption.System == kSPHERICAL) {
      ab[3] = 360*(ab[3] - xlab1l) / (xlab2l - xlab1l);
      ab[5] = 360*(ab[5] - xlab1l) / (xlab2l - xlab1l);
      ab[4] = 180*(ab[4] - ylab1l) / (ylab2l - ylab1l);
      ab[8] = 180*(ab[8] - ylab1l) / (ylab2l - ylab1l);
   } else if (Hoption.System == kRAPIDITY) {
      ab[3] = 360*(ab[3] - xlab1l) / (xlab2l - xlab1l);
      ab[5] = 360*(ab[5] - xlab1l) / (xlab2l - xlab1l);
      ab[4] = (180 - dangle*2)*(ab[4] - ylab1l) / (ylab2l - ylab1l) + dangle;
      ab[8] = (180 - dangle*2)*(ab[8] - ylab1l) / (ylab2l - ylab1l) + dangle;
   }

   //             Complete the cell coordinates
   ab[6]  = ab[4];
   ab[7]  = ab[5];
   ab[9]  = ab[3];
   ab[10] = ab[8];

   //              Get the content of the table, and loop on the
   //              stack if necessary.
   vv[1] = Hparam.zmin;
   vv[2] = Hparam.factor*gCurrentHist->GetBinContent(ixt, iyt);

   // In linear scale, 3D boxes all start from 0.
   if (Hparam.zmin<0 && !Hoption.Logz && gStyle->GetHistMinimumZero()) {
      if (vv[2]<0) {
         vv[1] = vv[2];
         vv[2] = 0;
      } else {
         vv[1]=0;
      }
   }

   TList *stack = gCurrentHist->GetPainter()->GetStack();
   Int_t nids = 0; //not yet implemented
   if (stack) nids = stack->GetSize();
   if (nids) {
      for (i = 2; i <= nids + 1; ++i) {
         TH1 *hid = (TH1*)stack->At(i-2);
         vv[i + 1] = Hparam.factor*hid->GetBinContent(ixt, iyt) + vv[i];
         vv[i + 1] = TMath::Max(Hparam.zmin, vv[i + 1]);
         //vv[i + 1] = TMath::Min(Hparam.zmax, vv[i + 1]);
      }
   }

   nv = nids + 2;
   for (i = 2; i <= nv; ++i) {
      if (Hoption.Logz) {
         if (vv[i] > 0)
            vv[i] = TMath::Max(Hparam.zmin, (Double_t)TMath::Log10(vv[i]));
         else
            vv[i] = Hparam.zmin;
         vv[i] = TMath::Min(vv[i], Hparam.zmax);
      } else {
            vv[i] = TMath::Max(Hparam.zmin, vv[i]);
            vv[i] = TMath::Min(Hparam.zmax, vv[i]);
      }
   }

   if (!Hoption.Logz) {
      i = 3;
      while (i <= nv) {
         if (vv[i] < vv[i - 1]) {
            vv[i - 1] = vv[i];
            i = 3;
            continue;
         }
         ++i;
      }
   }

   //          For cylindrical, spherical and pseudo-rapidity, the content
   //          is mapped onto the radius
   if (Hoption.System == kCYLINDRICAL || Hoption.System == kSPHERICAL || Hoption.System == kRAPIDITY) {
      for (i = 1; i <= nv; ++i) {
         vv[i] = (1 - rinrad)*((vv[i] - Hparam.zmin) /
                 (Hparam.zmax - Hparam.zmin)) + rinrad;
      }
   }

   for (i = 1; i <= nv; ++i) {
      for (j = 1; j <= 4; ++j) t[j + (i << 2)] = vv[i];
   }
}


//______________________________________________________________________________
void TPainter3dAlgorithms::LegoCartesian(Double_t ang, Int_t nx, Int_t ny, const char *chopt)
{
   // Draw stack of lego-plots in cartesian coordinates
   //
   //    Input: ANG      - angle between X ang Y
   //           NX       - number of cells along X
   //           NY       - number of cells along Y
   //
   //           FUN(IX,IY,NV,XY,V,T) - external routine
   //             IX     - X number of the cell
   //             IY     - Y number of the cell
   //             NV     - number of values for given cell
   //             XY(2,4)- coordinates of the cell corners
   //             V(NV)  - cell values
   //             T(4,NV)- additional function (for example: temperature)
   //
   //           DRFACE(ICODES,XYZ,NP,IFACE,T) - routine for face drawing
   //             ICODES(*) - set of codes for this line
   //               ICODES(1) - IX
   //               ICODES(2) - IY
   //               ICODES(3) - IV
   //               ICODES(4) - side: 1-face,2-right,3-back,4-left,
   //                                 5-bottom, 6-top
   //               XYZ(3,*)  - coordinates of nodes
   //               NP        - number of nodes
   //               IFACE(NP) - face
   //                T(4)   - additional function (here Z-coordinate)
   //
   //           CHOPT - options: 'BF' - from BACK to FRONT
   //                            'FB' - from FRONT to BACK
   //
   //Begin_Html
   /*
   <img src="gif/Lego1Cartesian.gif">
   */
   //End_Html

   // Local variables
   Double_t cosa, sina;
   Int_t ivis[4], iface[4];
   Double_t tface[4];
   Int_t incrx, incry, i1, k1, k2, ix1, iy1, ix2, iy2, i, iv, ix, iy, nv;
   Int_t icodes[4];
   Double_t zn, xy[8]; // was [2][4]
   Double_t xyz[24];   // was [3][8]
   Double_t *tn = 0;
   TView *view = 0;
   Int_t firstStackNumberDrawn=-1 ;  // necessary to compute fColorBottom when the 0 option is set and when the stack is seen from below (bottomview, theta<0.)

   sina = TMath::Sin(ang*kRad);
   cosa = TMath::Cos(ang*kRad);

   //          F I N D   T H E   M O S T   L E F T   P O I N T
   if (gPad) view = gPad->GetView();
   if (!view) {
      Error("LegoCartesian", "no TView in current pad");
      return;
   }
   tn = view->GetTN();

   i1 = 1;
   if (tn) {
      if (tn[0] < 0) i1 = 2;
      if (tn[0]*cosa + tn[1]*sina < 0) i1 = 5 - i1;
   }

   // Allocate v and tt arrays
   Double_t *v, *tt;
   Int_t vSize = fNStack+2;
   if (vSize > kVSizeMax) {
      v  = new Double_t[vSize];
      tt = new Double_t[4*vSize];
   } else {
      vSize = kVSizeMax;
      v  = &gV[0];
      tt = &gTT[0];
   }

   //          D E F I N E   O R D E R   O F   D R A W I N G
   if (*chopt == 'B' || *chopt == 'b') {
      incrx = -1;
      incry = -1;
   } else {
      incrx = 1;
      incry = 1;
   }
   if (i1 == 1 || i1 == 2) incrx = -incrx;
   if (i1 == 2 || i1 == 3) incry = -incry;
   ix1 = 1;
   iy1 = 1;
   if (incrx < 0) ix1 = nx;
   if (incry < 0) iy1 = ny;
   ix2 = nx - ix1 + 1;
   iy2 = ny - iy1 + 1;

   //          F I N D   V I S I B I L I T Y   O F   S I D E S
   ivis[0] = 0;
   ivis[1] = 0;
   ivis[2] = 0;
   ivis[3] = 0;
   nv      = 0;
   view->FindNormal(0, 1, 0, zn);
   if (zn < 0) ivis[0] = 1;
   if (zn > 0) ivis[2] = 1;
   view->FindNormal(sina, cosa, 0, zn);
   if (zn > 0) ivis[1] = 1;
   if (zn < 0) ivis[3] = 1;

   //          D R A W   S T A C K   O F   L E G O - P L O T S
   THistPainter *painter = (THistPainter*)gCurrentHist->GetPainter();
   for (iy = iy1; incry < 0 ? iy >= iy2 : iy <= iy2; iy += incry) {
      for (ix = ix1; incrx < 0 ? ix >= ix2 : ix <= ix2; ix += incrx) {
         if (!painter->IsInside(ix,iy)) continue;
         (this->*fLegoFunction)(ix, iy, nv, xy, v, tt);
         if (nv < 2 || nv > vSize) continue;
         if (Hoption.Zero) {
            Double_t total_content=0;
            for (iv = 1; iv < nv; ++iv) total_content += v[iv];
            if (total_content==0) continue;
         }
         icodes[0] = ix;
         icodes[1] = iy;
         for (i = 1; i <= 4; ++i) {
            xyz[i*3 - 3] = xy[2*i - 2] + xy[2*i - 1]*cosa;
            xyz[i*3 - 2] = xy[2*i - 1]*sina;
            xyz[(i + 4)*3 - 3] = xyz[i*3 - 3];
            xyz[(i + 4)*3 - 2] = xyz[i*3 - 2];
         }
   //         D R A W   S T A C K
         firstStackNumberDrawn = -1;
         for (iv = 1; iv < nv; ++iv) {
            for (i = 1; i <= 4; ++i) {
               xyz[i*3 - 1] = v[iv - 1];
               xyz[(i + 4)*3 - 1] = v[iv];
            }
            if (v[iv - 1] == v[iv]) continue;
            icodes[2] = iv;
            for (i = 1; i <= 4; ++i) {
               if (ivis[i - 1] == 0) continue;
               k1 = i;
               k2 = i + 1;
               if (i == 4) k2 = 1;
               icodes[3] = k1;
               iface[0] = k1;
               iface[1] = k2;
               iface[2] = k2 + 4;
               iface[3] = k1 + 4;
               tface[0] = tt[k1 + (iv << 2) - 5];
               tface[1] = tt[k2 + (iv << 2) - 5];
               tface[2] = tt[k2 + ((iv + 1) << 2) - 5];
               tface[3] = tt[k1 + ((iv + 1) << 2) - 5];
               fEdgeIdx = iv-1;
               (this->*fDrawFace)(icodes, xyz, 4, iface, tface);
            }
            if ( firstStackNumberDrawn==-1 ) firstStackNumberDrawn = fEdgeIdx;
         }
   //         D R A W   B O T T O M   F A C E
         view->FindNormal(0, 0, 1, zn);
         if (zn < 0) {
            icodes[2] = 1;
            icodes[3] = 5;
            for (i = 1; i <= 4; ++i) {
               xyz[i*3 - 1] = v[0];
               iface[i - 1] = 5 - i;
               tface[i - 1] = tt[5 - i - 1];
            }
            if (!Hoption.Zero) fEdgeIdx = 0;
            else {
               fEdgeIdx = firstStackNumberDrawn;
               fColorBottom = fColorMain[fEdgeIdx];
            }
            (this->*fDrawFace)(icodes, xyz, 4, iface, tface);
         }
   //         D R A W   T O P   F A C E
         if (zn > 0) {
            icodes[2] = nv - 1;
            icodes[3] = 6;
            for (i = 1; i <= 4; ++i) {
               iface[i - 1] = i + 4;
               tface[i - 1] = tt[i + (nv << 2) - 5];
            }
            Int_t cs = fColorTop;
            if ( nv <= 3 ) fEdgeIdx = 0 ;  // no stack or stack with only one histo
            else {
               if ( nv > 2 && (v[nv-1] == v[nv-2])) {
                  for (iv = nv-1; iv>2; iv--) {
                     if (v[nv-1] == v[iv-1]) {
                        fColorTop = fColorMain[iv-2];
                        fEdgeIdx  = iv-2;
                     }
                  }
               }
            }
            (this->*fDrawFace)(icodes, xyz, 4, iface, tface);
            fColorTop = cs;
         }
      }
   }
   if (vSize > kVSizeMax) {
      delete [] v;
      delete [] tt;
   }
}


//______________________________________________________________________________
void TPainter3dAlgorithms::LegoPolar(Int_t iordr, Int_t na, Int_t nb, const char *chopt)
{
   // Draw stack of lego-plots in polar coordinates
   //
   //    Input: IORDR - order of variables (0 - R,PHI; 1 - PHI,R)
   //           NA    - number of steps along 1st variable
   //           NB    - number of steps along 2nd variable
   //
   //           FUN(IA,IB,NV,AB,V,TT) - external routine
   //             IA      - cell number for 1st variable
   //             IB      - cell number for 2nd variable
   //             NV      - number of values for given cell
   //             AB(2,4) - coordinates of the cell corners
   //             V(NV)   - cell values
   //             TT(4,*) - additional function
   //
   //           DRFACE(ICODES,XYZ,NP,IFACE,T) - routine for face drawing
   //             ICODES(*) - set of codes for this face
   //               ICODES(1) - IA
   //               ICODES(2) - IB
   //               ICODES(3) - IV
   //               ICODES(4) - side: 1-internal,2-right,3-external,4-left
   //                                 5-bottom, 6-top
   //             XYZ(3,*)  - coordinates of nodes
   //             NP        - number of nodes in face
   //             IFACE(NP) - face
   //             T(NP)     - additional function
   //
   //            CHOPT       - options: 'BF' - from BACK to FRONT
   //                                   'FB' - from FRONT to BACK
   //
   //Begin_Html
   /*
   <img src="gif/Lego1Polar.gif">
   */
   //End_Html

   Int_t iphi, jphi, kphi, incr, nphi, ivis[6], iopt, iphi1, iphi2, iface[4], i, j;
   Double_t tface[4];
   Int_t incrr, k1, k2, ia, ib, ir1, ir2;
   Double_t ab[8];       // was [2][4]
   Int_t ir, jr, iv, nr, nv, icodes[4];
   Double_t xyz[24];     // was [3][8]
   ia = ib = 0;
   TView *view = 0;
   Int_t firstStackNumberDrawn=-1 ;  // necessary to compute fColorBottom when the 0 option is set and when the stack is seen from below (bottomview, theta<0.)

   if (gPad) view = gPad->GetView();
   if (!view) {
      Error("LegoPolar", "no TView in current pad");
      return;
   }

   if (iordr == 0) {
      jr   = 1;
      jphi = 2;
      nr   = na;
      nphi = nb;
   } else {
      jr   = 2;
      jphi = 1;
      nr   = nb;
      nphi = na;
   }
   if (nphi > 180) {
      Error("LegoPolar", "too many PHI sectors (%d)", nphi);
      return;
   }
   iopt = 2;
   if (*chopt == 'B' || *chopt == 'b') iopt = 1;

    // Allocate v and tt arrays
   Double_t *v, *tt;
   Int_t vSize = fNStack+2;
   if (vSize > kVSizeMax) {
      v  = new Double_t[vSize];
      tt = new Double_t[4*vSize];
   } else {
      vSize = kVSizeMax;
      v  = &gV[0];
      tt = &gTT[0];
   }

   //     P R E P A R E   P H I   A R R A Y
   //     F I N D    C R I T I C A L   S E C T O R S
   nv   = 0;
   kphi = nphi;
   if (iordr == 0) ia = nr;
   if (iordr != 0) ib = nr;
   for (i = 1; i <= nphi; ++i) {
      if (iordr == 0) ib = i;
      if (iordr != 0) ia = i;
      (this->*fLegoFunction)(ia, ib, nv, ab, v, tt);
      if (i == 1) fAphi[0] = ab[jphi - 1];
      fAphi[i - 1] = (fAphi[i - 1] + ab[jphi - 1]) / (float)2.;
      fAphi[i] = ab[jphi + 3];
   }
   view->FindPhiSectors(iopt, kphi, fAphi, iphi1, iphi2);

   //      E N C O D E   V I S I B I L I T Y   O F   S I D E S
   //      A N D   O R D E R   A L O N G   R
   for (i = 1; i <= nphi; ++i) {
      if (!iordr) ib = i;
      if (iordr)  ia = i;
      (this->*fLegoFunction)(ia, ib, nv, ab, v, tt);
      SideVisibilityEncode(iopt, ab[jphi - 1]*kRad, ab[jphi + 3]*kRad, fAphi[i - 1]);
   }

   //       D R A W   S T A C K   O F   L E G O - P L O T S
   incr = 1;
   iphi = iphi1;
L100:
   if (iphi > nphi) goto L300;

   //     D E C O D E   V I S I B I L I T Y   O F   S I D E S
   SideVisibilityDecode(fAphi[iphi - 1], ivis[0], ivis[1], ivis[2], ivis[3], ivis[4], ivis[5], incrr);
   ir1 = 1;
   if (incrr < 0) ir1 = nr;
   ir2 = nr - ir1 + 1;
   //      D R A W   L E G O S   F O R   S E C T O R
   for (ir = ir1; incrr < 0 ? ir >= ir2 : ir <= ir2; ir += incrr) {
      if (iordr == 0) { ia = ir;   ib = iphi; }
      else            { ia = iphi; ib = ir; }
      (this->*fLegoFunction)(ia, ib, nv, ab, v, tt);
      if (nv < 2 || nv > vSize) continue;
      if (Hoption.Zero) {
         Double_t total_content=0;
         for (iv = 1; iv < nv; ++iv) total_content += v[iv];
         if (total_content==0) continue;
      }
      icodes[0] = ia;
      icodes[1] = ib;
      for (i = 1; i <= 4; ++i) {
         j = i;
         if (iordr != 0 && i == 2) j = 4;
         if (iordr != 0 && i == 4) j = 2;
         xyz[j*3 - 3] = ab[jr + 2*i - 3]*TMath::Cos(ab[jphi + 2*i - 3]*kRad);
         xyz[j*3 - 2] = ab[jr + 2*i - 3]*TMath::Sin(ab[jphi + 2*i - 3]*kRad);
         xyz[(j + 4)*3 - 3] = xyz[j*3 - 3];
         xyz[(j + 4)*3 - 2] = xyz[j*3 - 2];
      }
   //      D R A W   S T A C K
      firstStackNumberDrawn = -1;
      for (iv = 1; iv < nv; ++iv) {
         for (i = 1; i <= 4; ++i) {
            xyz[i*3 - 1] = v[iv - 1];
            xyz[(i + 4)*3 - 1] = v[iv];
         }
         if (v[iv - 1] >= v[iv]) continue;
         icodes[2] = iv;
         for (i = 1; i <= 4; ++i) {
            if (ivis[i - 1] == 0) continue;
            k1 = i - 1;
            if (i == 1) k1 = 4;
            k2 = i;
            if (xyz[k1*3 - 3] == xyz[k2*3 - 3] && xyz[k1*3 - 2] ==
                xyz[k2*3 - 2]) continue;
            iface[0] = k1;
            iface[1] = k2;
            iface[2] = k2 + 4;
            iface[3] = k1 + 4;
            tface[0] = tt[k1 + (iv << 2) - 5];
            tface[1] = tt[k2 + (iv << 2) - 5];
            tface[2] = tt[k2 + ((iv + 1) << 2) - 5];
            tface[3] = tt[k1 + ((iv + 1) << 2) - 5];
            icodes[3] = i;
            fEdgeIdx  = iv-1;
            (this->*fDrawFace)(icodes, xyz, 4, iface, tface);
         }
         if ( firstStackNumberDrawn==-1 ) firstStackNumberDrawn = fEdgeIdx;
      }
   //         D R A W   B O T T O M   F A C E
      if (ivis[4] != 0) {
         icodes[2] = 1;
         icodes[3] = 5;
         for (i = 1; i <= 4; ++i) {
            xyz[i*3 - 1] = v[0];
            iface[i - 1] = 5 - i;
            tface[i - 1] = tt[5 - i - 1];
         }
         if (!Hoption.Zero) fEdgeIdx = 0;
         else {
            fEdgeIdx = firstStackNumberDrawn;
            fColorBottom = fColorMain[fEdgeIdx];
         }
         (this->*fDrawFace)(icodes, xyz, 4, iface, tface);
      }
   //         D R A W   T O P   F A C E
      if (ivis[5] != 0) {
         icodes[2] = nv - 1;
         icodes[3] = 6;
         for (i = 1; i <= 4; ++i) {
            iface[i - 1] = i + 4;
            tface[i - 1] = tt[i + (nv << 2) - 5];
         }
         Int_t cs = fColorTop;
         if ( nv <= 3 ) fEdgeIdx = 0 ;  // no stack or stack with only one histo
         else {
            if ( nv > 2 && (v[nv-1] == v[nv-2])) {
               for (iv = nv-1; iv>2; iv--) {
                  if (v[nv-1] == v[iv-1]) {
                     fColorTop = fColorMain[iv-2];
                     fEdgeIdx = iv-2;
                  }
               }
            }
         }
         (this->*fDrawFace)(icodes, xyz, 4, iface, tface);
         fColorTop = cs;
      }
   }
   //      N E X T   P H I
L300:
   iphi += incr;
   if (iphi == 0)      iphi = kphi;
   if (iphi > kphi)    iphi = 1;
   if (iphi != iphi2)  goto L100;
   if (incr == 0) {
      if (vSize > kVSizeMax) {
         delete [] v;
         delete [] tt;
      }
      return;
   }
   if (incr < 0) {
      incr = 0;
      goto L100;
   }
   incr = -1;
   iphi = iphi1;
   goto L300;
}


//______________________________________________________________________________
void TPainter3dAlgorithms::LegoCylindrical(Int_t iordr, Int_t na, Int_t nb, const char *chopt)
{
   // Draw stack of lego-plots in cylindrical coordinates
   //
   //    Input: IORDR - order of variables (0 - Z,PHI; 1 - PHI,Z)
   //           NA    - number of steps along 1st variable
   //           NPHI  - number of steps along 2nd variable
   //
   //           FUN(IA,IB,NV,AB,V,TT) - external routine
   //             IA      - cell number for 1st variable
   //             IB      - cell number for 2nd variable
   //             NV      - number of values for given cell
   //             AB(2,4) - coordinates of the cell corners
   //             V(NV)   - cell values
   //             TT(4,*) - additional function
   //
   //           DRFACE(ICODES,XYZ,NP,IFACE,T) - routine for face drawing
   //             ICODES(*) - set of codes for this face
   //               ICODES(1) - IA
   //               ICODES(2) - IB
   //               ICODES(3) - IV
   //               ICODES(4) - side: 1,2,3,4 - ordinary sides
   //                                 5-bottom,6-top
   //             XYZ(3,*)  - coordinates of nodes
   //             NP        - number of nodes in face
   //             IFACE(NP) - face
   //             T(NP)     - additional function
   //
   //           CHOPT       - options: 'BF' - from BACK to FRONT
   //                                  'FB' - from FRONT to BACK
   //
   //Begin_Html
   /*
   <img src="gif/Lego1Cylindrical.gif">
   */
   //End_Html

   Int_t iphi, jphi, kphi, incr, nphi, ivis[6], iopt, iphi1, iphi2, iface[4], i, j;
   Double_t tface[4], z;
   Double_t ab[8];       // was [2][4]
   Int_t ia, ib, idummy, iz1, iz2, nz, incrz, k1, k2, nv;
   Int_t iv, iz, jz, icodes[4];
   Double_t cosphi[4];
   Double_t sinphi[4];
   Double_t xyz[24];     // was [3][8]
   ia = ib = 0;
   TView *view = 0;
   Int_t firstStackNumberDrawn=-1 ;  // necessary to compute fColorBottom when the 0 option is set and when the stack is seen from below (bottomview, theta<0.)

   if (gPad) view = gPad->GetView();
   if (!view) {
      Error("LegoCylindrical", "no TView in current pad");
      return;
   }

   if (iordr == 0) {
      jz   = 1;
      jphi = 2;
      nz   = na;
      nphi = nb;
   } else {
      jz   = 2;
      jphi = 1;
      nz   = nb;
      nphi = na;
   }
   if (nphi > 180) {
      Error("LegoCylindrical", "too many PHI sectors (%d)", nphi);
      return;
   }
   iopt = 2;
   if (*chopt == 'B' || *chopt == 'b') iopt = 1;

    // Allocate v and tt arrays
   Double_t *v, *tt;
   Int_t vSize = fNStack+2;
   if (vSize > kVSizeMax) {
      v  = new Double_t[vSize];
      tt = new Double_t[4*vSize];
   } else {
      vSize = kVSizeMax;
      v  = &gV[0];
      tt = &gTT[0];
   }

   //       P R E P A R E   P H I   A R R A Y
   //       F I N D    C R I T I C A L   S E C T O R S
   nv   = 0;
   kphi = nphi;
   if (iordr == 0) ia = nz;
   if (iordr != 0) ib = nz;
   for (i = 1; i <= nphi; ++i) {
      if (iordr == 0) ib = i;
      if (iordr != 0) ia = i;
      (this->*fLegoFunction)(ia, ib, nv, ab, v, tt);
      if (i == 1)  fAphi[0] = ab[jphi - 1];
      fAphi[i - 1] = (fAphi[i - 1] + ab[jphi - 1]) / (float)2.;
      fAphi[i] = ab[jphi + 3];
   }
   view->FindPhiSectors(iopt, kphi, fAphi, iphi1, iphi2);

   //      E N C O D E   V I S I B I L I T Y   O F   S I D E S
   //      A N D   O R D E R   A L O N G   R
   for (i = 1; i <= nphi; ++i) {
      if (iordr == 0) ib = i;
      if (iordr != 0) ia = i;
      (this->*fLegoFunction)(ia, ib, nv, ab, v, tt);
      SideVisibilityEncode(iopt, ab[jphi - 1]*kRad, ab[jphi + 3]*kRad, fAphi[i - 1]);
   }

   //       F I N D   O R D E R   A L O N G   Z
   incrz = 1;
   iz1 = 1;
   view->FindNormal(0, 0, 1, z);
   if ((z <= 0 && iopt == 1) || (z > 0 && iopt == 2)) {
      incrz = -1;
      iz1 = nz;
   }
   iz2 = nz - iz1 + 1;

   //       D R A W   S T A C K   O F   L E G O - P L O T S
   incr = 1;
   iphi = iphi1;
L100:
   if (iphi > nphi) goto L400;
   //     D E C O D E   V I S I B I L I T Y   O F   S I D E S
   idummy = 0;
   SideVisibilityDecode(fAphi[iphi - 1], ivis[4], ivis[1], ivis[5], ivis[3], ivis[0], ivis[2], idummy);
   for (iz = iz1; incrz < 0 ? iz >= iz2 : iz <= iz2; iz += incrz) {
      if (iordr == 0) {ia = iz;   ib = iphi;}
      else            {ia = iphi; ib = iz;}
      (this->*fLegoFunction)(ia, ib, nv, ab, v, tt);
      if (nv < 2 || nv > vSize) continue;
      icodes[0] = ia;
      icodes[1] = ib;
      for (i = 1; i <= 4; ++i) {
         j = i;
         if (iordr != 0 && i == 2) j = 4;
         if (iordr != 0 && i == 4) j = 2;
         cosphi[j - 1] = TMath::Cos(ab[jphi + 2*i - 3]*kRad);
         sinphi[j - 1] = TMath::Sin(ab[jphi + 2*i - 3]*kRad);
         xyz[j*3 - 1] = ab[jz + 2*i - 3];
         xyz[(j + 4)*3 - 1] = ab[jz + 2*i - 3];
      }
   //      D R A W   S T A C K
      firstStackNumberDrawn = -1;
      for (iv = 1; iv < nv; ++iv) {
         for (i = 1; i <= 4; ++i) {
            xyz[i*3 - 3] = v[iv - 1]*cosphi[i - 1];
            xyz[i*3 - 2] = v[iv - 1]*sinphi[i - 1];
            xyz[(i + 4)*3 - 3] = v[iv]*cosphi[i - 1];
            xyz[(i + 4)*3 - 2] = v[iv]*sinphi[i - 1];
         }
         if (v[iv - 1] >= v[iv]) continue;
         icodes[2] = iv;
         for (i = 1; i <= 4; ++i) {
            if (ivis[i - 1] == 0) continue;
            k1 = i;
            k2 = i - 1;
            if (i == 1) k2 = 4;
            iface[0] = k1;
            iface[1] = k2;
            iface[2] = k2 + 4;
            iface[3] = k1 + 4;
            tface[0] = tt[k1 + (iv << 2) - 5];
            tface[1] = tt[k2 + (iv << 2) - 5];
            tface[2] = tt[k2 + ((iv + 1) << 2) - 5];
            tface[3] = tt[k1 + ((iv + 1) << 2) - 5];
            icodes[3] = i;
            fEdgeIdx = iv-1;
            (this->*fDrawFace)(icodes, xyz, 4, iface, tface);
         }
         if ( firstStackNumberDrawn==-1 ) firstStackNumberDrawn = fEdgeIdx;
      }
   //       D R A W   B O T T O M   F A C E
      if (ivis[4] != 0 && v[0] > 0) {
         icodes[2] = 1;
         icodes[3] = 5;
         for (i = 1; i <= 4; ++i) {
            xyz[i*3 - 3] = v[0]*cosphi[i - 1];
            xyz[i*3 - 2] = v[0]*sinphi[i - 1];
            iface[i - 1] = i;
            tface[i - 1] = tt[i - 1];
         }
         if (!Hoption.Zero) fEdgeIdx = 0;
         else {
            fEdgeIdx = firstStackNumberDrawn;
            fColorBottom = fColorMain[fEdgeIdx];
         }
         (this->*fDrawFace)(icodes, xyz, 4, iface, tface);
      }
   //      D R A W   T O P   F A C E
      if (ivis[5] != 0 && v[nv - 1] > 0) {
         icodes[2] = nv - 1;
         icodes[3] = 6;
         for (i = 1; i <= 4; ++i) {
            iface[i - 1] = 5 - i + 4;
            tface[i - 1] = tt[5 - i + (nv << 2) - 5];
         }
         Int_t cs = fColorTop;
         if ( nv <= 3 ) fEdgeIdx = 0 ;  // no stack or stack with only one histo
         else {
            if ( nv > 2 && (v[nv-1] == v[nv-2])) {
               for (iv = nv-1; iv>2; iv--) {
                  if (v[nv-1] == v[iv-1]) {
                     fColorTop = fColorMain[iv-2];
                     fEdgeIdx = iv-2;
                  }
               }
            }
         }
         (this->*fDrawFace)(icodes, xyz, 4, iface, tface);
         fColorTop = cs;
      }
   }
   //      N E X T   P H I
L400:
   iphi += incr;
   if (iphi == 0)     iphi = kphi;
   if (iphi > kphi)   iphi = 1;
   if (iphi != iphi2) goto L100;
   if (incr == 0) {
      if (vSize > kVSizeMax) {
         delete [] v;
         delete [] tt;
      }
      return;
   }
   if (incr < 0) {
      incr = 0;
      goto L100;
   }
   incr = -1;
   iphi = iphi1;
   goto L400;
}


//______________________________________________________________________________
void TPainter3dAlgorithms::LegoSpherical(Int_t ipsdr, Int_t iordr, Int_t na, Int_t nb, const char *chopt)
{
   // Draw stack of lego-plots spheric coordinates
   //
   //    Input: IPSDR - pseudo-rapidity flag
   //           IORDR - order of variables (0 - THETA,PHI; 1 - PHI,THETA)
   //           NA    - number of steps along 1st variable
   //           NB    - number of steps along 2nd variable
   //
   //           FUN(IA,IB,NV,AB,V,TT) - external routine
   //             IA      - cell number for 1st variable
   //             IB      - cell number for 2nd variable
   //             NV      - number of values for given cell
   //             AB(2,4) - coordinates of the cell corners
   //             V(NV)   - cell values
   //             TT(4,*) - additional function
   //
   //           DRFACE(ICODES,XYZ,NP,IFACE,T) - routine for face drawing
   //             ICODES(*) - set of codes for this face
   //               ICODES(1) - IA
   //               ICODES(2) - IB
   //               ICODES(3) - IV
   //               ICODES(4) - side: 1,2,3,4 - ordinary sides
   //                                 5-bottom,6-top
   //             XYZ(3,*)  - coordinates of nodes
   //             NP        - number of nodes in face
   //             IFACE(NP) - face
   //             T(NP)     - additional function
   //
   //           CHOPT       - options: 'BF' - from BACK to FRONT
   //                                  'FB' - from FRONT to BACK

   Int_t iphi, jphi, kphi, incr, nphi, ivis[6], iopt, iphi1, iphi2, iface[4], i, j;
   Double_t tface[4], costh[4];
   Double_t sinth[4];
   Int_t k1, k2, ia, ib, incrth, ith, jth, kth, nth, mth, ith1, ith2, nv;
   Double_t ab[8];       // was [2][4]
   Double_t th;
   Int_t iv, icodes[4];
   Double_t zn, cosphi[4];
   Double_t sinphi[4], th1, th2, phi;
   Double_t xyz[24];     // was [3][8]
   Double_t phi1, phi2;
   ia = ib = 0;
   TView *view = 0;
   Int_t firstStackNumberDrawn=-1 ;  // necessary to compute fColorBottom when the 0 option is set and when the stack is seen from below (bottomview, theta<0.)

   if (gPad) view = gPad->GetView();
   if (!view) {
      Error("LegoSpherical", "no TView in current pad");
      return;
   }

   if (iordr == 0) {
      jth  = 1;
      jphi = 2;
      nth  = na;
      nphi = nb;
   } else {
      jth  = 2;
      jphi = 1;
      nth  = nb;
      nphi = na;
   }
   if (nth > 180) {
      Error("LegoSpherical", "too many THETA sectors (%d)", nth);
      return;
   }
   if (nphi > 180) {
      Error("LegoSpherical", "too many PHI sectors (%d)", nphi);
      return;
   }
   iopt = 2;
   if (*chopt == 'B' || *chopt == 'b') iopt = 1;

   // Allocate v and tt arrays
   Double_t *v, *tt;
   Int_t vSize = fNStack+2;
   if (vSize > kVSizeMax) {
      v  = new Double_t[vSize];
      tt = new Double_t[4*vSize];
   } else {
      vSize = kVSizeMax;
      v  = &gV[0];
      tt = &gTT[0];
   }

   //       P R E P A R E   P H I   A R R A Y
   //       F I N D    C R I T I C A L   P H I   S E C T O R S
   nv  = 0;
   kphi = nphi;
   mth = nth / 2;
   if (mth == 0)    mth = 1;
   if (iordr == 0) ia = mth;
   if (iordr != 0) ib = mth;
   for (i = 1; i <= nphi; ++i) {
      if (iordr == 0) ib = i;
      if (iordr != 0) ia = i;
      (this->*fLegoFunction)(ia, ib, nv, ab, v, tt);
      if (i == 1)  fAphi[0] = ab[jphi - 1];
      fAphi[i - 1] = (fAphi[i - 1] + ab[jphi - 1]) / (float)2.;
      fAphi[i] = ab[jphi + 3];
   }
   view->FindPhiSectors(iopt, kphi, fAphi, iphi1, iphi2);

   //       P R E P A R E   T H E T A   A R R A Y
   if (iordr == 0) ib = 1;
   if (iordr != 0) ia = 1;
   for (i = 1; i <= nth; ++i) {
      if (iordr == 0) ia = i;
      if (iordr != 0) ib = i;
      (this->*fLegoFunction)(ia, ib, nv, ab, v, tt);
      if (i == 1) fAphi[0] = ab[jth - 1];
      fAphi[i - 1] = (fAphi[i - 1] + ab[jth - 1]) / (float)2.;
      fAphi[i] = ab[jth + 3];
   }

   //       D R A W   S T A C K   O F   L E G O - P L O T S
   kth = nth;

   incr = 1;
   iphi = iphi1;
L100:
   if (iphi > nphi) goto L500;

   //      F I N D    C R I T I C A L   T H E T A   S E C T O R S
   if (!iordr) {ia = mth;        ib = iphi; }
   else        {ia = iphi;ib = mth;  }
   (this->*fLegoFunction)(ia, ib, nv, ab, v, tt);
   phi = (ab[jphi - 1] + ab[jphi + 3]) / (float)2.;
   view->FindThetaSectors(iopt, phi, kth, fAphi, ith1, ith2);
   incrth = 1;
   ith = ith1;
L200:
   if (ith > nth)   goto L400;
   if (iordr == 0) ia = ith;
   if (iordr != 0) ib = ith;
   (this->*fLegoFunction)(ia, ib, nv, ab, v, tt);
   if (nv < 2 || nv > vSize) goto L400;

   //      D E F I N E   V I S I B I L I T Y   O F   S I D E S
   for (i = 1; i <= 6; ++i) ivis[i - 1] = 0;

   phi1 = kRad*ab[jphi - 1];
   phi2 = kRad*ab[jphi + 3];
   th1  = kRad*ab[jth - 1];
   th2  = kRad*ab[jth + 3];
   view->FindNormal(TMath::Sin(phi1), -TMath::Cos(phi1), 0, zn);
   if (zn > 0) ivis[1] = 1;
   view->FindNormal(-TMath::Sin(phi2), TMath::Cos(phi2), 0, zn);
   if (zn > 0) ivis[3] = 1;
   phi = (phi1 + phi2) / (float)2.;
   view->FindNormal(-TMath::Cos(phi)*TMath::Cos(th1), -TMath::Sin(phi)*TMath::Cos(th1), TMath::Sin(th1), zn);
   if (zn > 0) ivis[0] = 1;
   view->FindNormal(TMath::Cos(phi)*TMath::Cos(th2), TMath::Sin(phi)*TMath::Cos(th2), -TMath::Sin(th2), zn);
   if (zn > 0) ivis[2] = 1;
   th = (th1 + th2) / (float)2.;
   if (ipsdr == 1) th = kRad*90;
   view->FindNormal(TMath::Cos(phi)*TMath::Sin(th), TMath::Sin(phi)*TMath::Sin(th), TMath::Cos(th), zn);
   if (zn < 0) ivis[4] = 1;
   if (zn > 0) ivis[5] = 1;

   //      D R A W   S T A C K
   icodes[0] = ia;
   icodes[1] = ib;
   for (i = 1; i <= 4; ++i) {
      j = i;
      if (iordr != 0 && i == 2) j = 4;
      if (iordr != 0 && i == 4) j = 2;
      costh[j - 1]  = TMath::Cos(kRad*ab[jth + 2*i - 3]);
      sinth[j - 1]  = TMath::Sin(kRad*ab[jth + 2*i - 3]);
      cosphi[j - 1] = TMath::Cos(kRad*ab[jphi + 2*i - 3]);
      sinphi[j - 1] = TMath::Sin(kRad*ab[jphi + 2*i - 3]);
   }
   firstStackNumberDrawn = -1;
   for (iv = 1; iv < nv; ++iv) {
      if (ipsdr == 1) {
         for (i = 1; i <= 4; ++i) {
            xyz[i*3 - 3] = v[iv - 1]*cosphi[i - 1];
            xyz[i*3 - 2] = v[iv - 1]*sinphi[i - 1];
            xyz[i*3 - 1] = v[iv - 1]*costh[i - 1] / sinth[i - 1];
            xyz[(i + 4)*3 - 3] = v[iv]*cosphi[i - 1];
            xyz[(i + 4)*3 - 2] = v[iv]*sinphi[i - 1];
            xyz[(i + 4)*3 - 1] = v[iv]*costh[i - 1] / sinth[i - 1];
         }
      } else {
         for (i = 1; i <= 4; ++i) {
            xyz[i*3 - 3] = v[iv - 1]*sinth[i - 1]*cosphi[i - 1];
            xyz[i*3 - 2] = v[iv - 1]*sinth[i - 1]*sinphi[i - 1];
            xyz[i*3 - 1] = v[iv - 1]*costh[i - 1];
            xyz[(i + 4)*3 - 3] = v[iv]*sinth[i - 1]*cosphi[i - 1];
            xyz[(i + 4)*3 - 2] = v[iv]*sinth[i - 1]*sinphi[i - 1];
            xyz[(i + 4)*3 - 1] = v[iv]*costh[i - 1];
         }
      }
      if (v[iv - 1] >= v[iv]) continue;
      icodes[2] = iv;
      for (i = 1; i <= 4; ++i) {
         if (ivis[i - 1] == 0) continue;
         k1 = i - 1;
         if (i == 1) k1 = 4;
         k2 = i;
         iface[0] = k1;
         iface[1] = k2;
         iface[2] = k2 + 4;
         iface[3] = k1 + 4;
         tface[0] = tt[k1 + (iv << 2) - 5];
         tface[1] = tt[k2 + (iv << 2) - 5];
         tface[2] = tt[k2 + ((iv + 1) << 2) - 5];
         tface[3] = tt[k1 + ((iv + 1) << 2) - 5];
         icodes[3] = i;
         fEdgeIdx = iv-1;
         (this->*fDrawFace)(icodes, xyz, 4, iface, tface);
      }
      if ( firstStackNumberDrawn==-1 ) firstStackNumberDrawn = fEdgeIdx;
   }
   //      D R A W   B O T T O M   F A C E
   if (ivis[4] != 0 && v[0] > 0) {
      icodes[2] = 1;
      icodes[3] = 5;
      for (i = 1; i <= 4; ++i) {
         if (ipsdr == 1) {
            xyz[i*3 - 3] = v[0]*cosphi[i - 1];
            xyz[i*3 - 2] = v[0]*sinphi[i - 1];
            xyz[i*3 - 1] = v[0]*costh[i - 1] / sinth[i - 1];
         } else {
            xyz[i*3 - 3] = v[0]*sinth[i - 1]*cosphi[i - 1];
            xyz[i*3 - 2] = v[0]*sinth[i - 1]*sinphi[i - 1];
            xyz[i*3 - 1] = v[0]*costh[i - 1];
         }
         iface[i - 1] = 5 - i;
         tface[i - 1] = tt[5 - i - 1];
      }
      if (!Hoption.Zero) fEdgeIdx = 0;
      else {
         fEdgeIdx = firstStackNumberDrawn;
         fColorBottom = fColorMain[fEdgeIdx];
      }
      (this->*fDrawFace)(icodes, xyz, 4, iface, tface);
   }
   //      D R A W   T O P   F A C E
   if (ivis[5] != 0 && v[nv - 1] > 0) {
      icodes[2] = nv - 1;
      icodes[3] = 6;
      for (i = 1; i <= 4; ++i) {
         iface[i - 1] = i + 4;
         tface[i - 1] = tt[i + 4 + 2*nv - 5];
      }
      Int_t cs = fColorTop;
      if ( nv <= 3 ) fEdgeIdx = 0 ;  // no stack or stack with only one histo
      else {
         if ( nv > 2 && (v[nv-1] == v[nv-2])) {
            for (iv = nv-1; iv>2; iv--) {
               if (v[nv-1] == v[iv-1]) {
                  fColorTop = fColorMain[iv-2];
                  fEdgeIdx  = iv-2;
               }
            }
         }
      }
      (this->*fDrawFace)(icodes, xyz, 4, iface, tface);
      fColorTop = cs;
   }
   //      N E X T   T H E T A
L400:
   ith += incrth;
   if (ith == 0)    ith = kth;
   if (ith > kth)   ith = 1;
   if (ith != ith2) goto L200;
   if (incrth == 0) goto L500;
   if (incrth < 0) {
      incrth = 0;
      goto L200;
   }
   incrth = -1;
   ith = ith1;
   goto L400;
   //      N E X T   P H I
L500:
   iphi += incr;
   if (iphi == 0)     iphi = kphi;
   if (iphi > kphi)   iphi = 1;
   if (iphi != iphi2) goto L100;
   if (incr == 0) {
      if (vSize > kVSizeMax) {
         delete [] v;
         delete [] tt;
      }
      return;
   }
   if (incr < 0) {
      incr = 0;
      goto L100;
   }
   incr = -1;
   iphi = iphi1;
   goto L500;
}


//______________________________________________________________________________
void TPainter3dAlgorithms::LightSource(Int_t nl, Double_t yl, Double_t xscr,
                                       Double_t yscr, Double_t zscr, Int_t &irep)
{
   // Set light source
   //
   //    Input: NL   - source number: -1 off all light sources
   //                                  0 set diffused light
   //           YL   - intensity of the light source
   //           XSCR |
   //           YSCR  > direction of the light (in respect of the screen)
   //           ZSCR |
   //
   //    Output: IREP   - reply : 0 - O.K.
   //                            -1 - error in light sources definition:
   //                                 negative intensity
   //                                 source number greater than max
   //                                 light source is placed at origin

   /* Local variables */
   Int_t i;
   Double_t s;

   irep = 0;
   if (nl < 0)       goto L100;
   else if (nl == 0) goto L200;
   else              goto L300;

   //          S W I T C H   O F F   L I G H T S
L100:
   fLoff = 1;
   fYdl = 0;
   for (i = 1; i <= 4; ++i) {
      fYls[i - 1] = 0;
   }
   return;
   //          S E T   D I F F U S E D   L I G H T
L200:
   if (yl < 0) {
      Error("LightSource", "negative light intensity");
      irep = -1;
      return;
   }
   fYdl = yl;
   goto L400;
   //          S E T   L I G H T   S O U R C E
L300:
   if (nl > 4 || yl < 0) {
      Error("LightSource", "illegal light source number (nl=%d, yl=%f)", nl, yl);
      irep = -1;
      return;
   }
   s = TMath::Sqrt(xscr*xscr + yscr*yscr + zscr*zscr);
   if (s == 0) {
      Error("LightSource", "light source is placed at origin");
      irep = -1;
      return;
   }
   fYls[nl - 1] = yl;
   fVls[nl*3 - 3] = xscr / s;
   fVls[nl*3 - 2] = yscr / s;
   fVls[nl*3 - 1] = zscr / s;
   //         C H E C K   L I G H T S
L400:
   fLoff = 0;
   if (fYdl != 0) return;
   for (i = 1; i <= 4; ++i) {
      if (fYls[i - 1] != 0) return;
   }
   fLoff = 1;
}


//______________________________________________________________________________
void TPainter3dAlgorithms::Luminosity(Double_t *anorm, Double_t &flum)
{
   // Find surface luminosity at given point
   //                                         --
   //    Lightness model formula: Y = YD*QA + > YLi*(QD*cosNi+QS*cosRi)
   //                                         --
   //
   //            B1     = VN(3)*VL(2) - VN(2)*VL(3)
   //            B2     = VN(1)*VL(3) - VN(3)*VL(1)
   //            B3     = VN(2)*VL(1) - VN(1)*VL(2)
   //            B4     = VN(1)*VL(1) + VN(2)*VL(2) + VN(3)*VL(3)
   //            VR(1)  = VN(3)*B2 - VN(2)*B3 + VN(1)*B4
   //            VR(2)  =-VN(3)*B1 + VN(1)*B3 + VN(2)*B4
   //            VR(3)  = VN(2)*B1 - VN(1)*B2 + VN(3)*B4
   //            S      = SQRT(VR(1)*VR(1)+VR(2)*VR(2)+VR(3)*VR(3))
   //            VR(1)  = VR(1)/S
   //            VR(2)  = VR(2)/S
   //            VR(3)  = VR(3)/S
   //            COSR   = VR(1)*0. + VR(2)*0. + VR(3)*1.
   //
   //    References: WCtoNDC
   //
   //    Input: ANORM(3) - surface normal at given point
   //
   //    Output: FLUM - luminosity

   /* Local variables */
   Double_t cosn, cosr;
   Int_t i;
   Double_t s, vl[3], vn[3];
   TView *view = 0;

   if (gPad) view = gPad->GetView();
   if (!view) return;

   /* Parameter adjustments */
   --anorm;

   flum = 0;
   if (fLoff != 0) return;

   //          T R A N S F E R   N O R M A L  T O   SCREEN COORDINATES
   view->NormalWCtoNDC(&anorm[1], vn);
   s = TMath::Sqrt(vn[0]*vn[0] + vn[1]*vn[1] + vn[2]*vn[2]);
   if (vn[2] < 0) s = -(Double_t)s;
   vn[0] /= s;
   vn[1] /= s;
   vn[2] /= s;

   //          F I N D   L U M I N O S I T Y
   flum = fYdl*fQA;
   for (i = 1; i <= 4; ++i) {
      if (fYls[i - 1] <= 0) continue;
      vl[0] = fVls[i*3 - 3];
      vl[1] = fVls[i*3 - 2];
      vl[2] = fVls[i*3 - 1];
      cosn = vl[0]*vn[0] + vl[1]*vn[1] + vl[2]*vn[2];
      if (cosn < 0) continue;
      cosr = vn[1]*(vn[2]*vl[1] - vn[1]*vl[2]) - vn[0]*(vn[0]*vl[2]
             - vn[2]*vl[0]) + vn[2]*cosn;
      if (cosr <= 0) cosr = 0;
      flum += fYls[i - 1]*(fQD*cosn + fQS*TMath::Power(cosr, fNqs));
   }
}


//______________________________________________________________________________
void TPainter3dAlgorithms::ModifyScreen(Double_t *r1, Double_t *r2)
{
   // Modify SCREEN
   //
   //    Input: R1(3) - 1-st point of the line
   //           R2(3) - 2-nd point of the line

   /* Local variables */
   Int_t i, i1, i2;
   Double_t x1, x2, y1, y2, dy, ww, yy1, yy2, *tn;

   /* Parameter adjustments */
   --r2;
   --r1;

   TView *view = 0;
   if (gPad) view = gPad->GetView();

   if (view) {
      tn = view->GetTN();
      if (tn) {
         x1 = tn[0]*r1[1] + tn[1]*r1[2] + tn[2]*r1[3] + tn[3];
         x2 = tn[0]*r2[1] + tn[1]*r2[2] + tn[2]*r2[3] + tn[3];
         y1 = tn[4]*r1[1] + tn[5]*r1[2] + tn[6]*r1[3] + tn[7];
         y2 = tn[4]*r2[1] + tn[5]*r2[2] + tn[6]*r2[3] + tn[7];
      } else {
         Error("ModifyScreen", "invalid TView in current pad");
         return;
      }
   } else {
      Error("ModifyScreen", "no TView in current pad");
      return;
   }

   if (x1 >= x2) {
      ww = x1;
      x1 = x2;
      x2 = ww;
      ww = y1;
      y1 = y2;
      y2 = ww;
   }
   i1 = Int_t((x1 - fX0) / fDX) + 15;
   i2 = Int_t((x2 - fX0) / fDX) + 15;
   if (i1 == i2) return;

   //          M O D I F Y   B O U N D A R I E S   OF THE SCREEN
   dy = (y2 - y1) / (i2 - i1);
   for (i = i1; i <= i2 - 1; ++i) {
      yy1 = y1 + dy*(i - i1);
      yy2 = yy1 + dy;
      if (fD[2*i - 2] > yy1) fD[2*i - 2] = yy1;
      if (fD[2*i - 1] > yy2) fD[2*i - 1] = yy2;
      if (fU[2*i - 2] < yy1) fU[2*i - 2] = yy1;
      if (fU[2*i - 1] < yy2) fU[2*i - 1] = yy2;
   }
}


//______________________________________________________________________________
void TPainter3dAlgorithms::SetDrawFace(DrawFaceFunc_t drface)
{
   // Store pointer to current algorithm to draw faces

   fDrawFace = drface;
}


//______________________________________________________________________________
void TPainter3dAlgorithms::SetLegoFunction(LegoFunc_t fun)
{
   // Store pointer to current lego function

   fLegoFunction = fun;
}


//______________________________________________________________________________
void TPainter3dAlgorithms::SetSurfaceFunction(SurfaceFunc_t fun)
{
   // Store pointer to current surface function

   fSurfaceFunction = fun;
}


//______________________________________________________________________________
void TPainter3dAlgorithms::SetF3(TF3 *f3)
{
   // Static function
   // Store pointer to current implicit function

   fgCurrentF3 = f3;
}


//______________________________________________________________________________
void TPainter3dAlgorithms::SetF3ClippingBoxOff()
{
   // static function
   // Set the implicit function clipping box "off".

   fgF3Clipping = 0;
}


//______________________________________________________________________________
void TPainter3dAlgorithms::SetF3ClippingBoxOn(Double_t xclip,
                                              Double_t yclip, Double_t zclip)
{
   // static function
   // Set the implicit function clipping box "on" and define the clipping box.
   // xclip, yclip and zclip is a point within the function range. All the
   // function value having x<=xclip and y<=yclip and z>=zclip are clipped.

   fgF3Clipping = 1;
   fgF3XClip = xclip;
   fgF3YClip = yclip;
   fgF3ZClip = zclip;
}


//______________________________________________________________________________
void TPainter3dAlgorithms::SetColorDark(Color_t color, Int_t n)
{
   // Store dark color for stack number n

   if (n < 0 ) {fColorBottom = color; return;}
   if (n > fNStack ) {fColorTop  = color; return;}
   fColorDark[n] = color;
}


//______________________________________________________________________________
void TPainter3dAlgorithms::SetColorMain(Color_t color, Int_t n)
{
   // Store color for stack number n

   if (n < 0 ) {fColorBottom = color; return;}
   if (n > fNStack ) {fColorTop = color; return;}
   fColorMain[n] = color;
}


//______________________________________________________________________________
void TPainter3dAlgorithms::SetEdgeAtt(Color_t color, Style_t style, Width_t width, Int_t n)
{

   // Store edge attributes

   fEdgeColor[n] = color;
   fEdgeStyle[n] = style;
   fEdgeWidth[n] = width;
}


//______________________________________________________________________________
void TPainter3dAlgorithms::SideVisibilityDecode(Double_t val, Int_t &iv1, Int_t &iv2, Int_t &iv3, Int_t &iv4, Int_t &iv5, Int_t &iv6, Int_t &ir)
{
   // Decode side visibilities and order along R for sector
   //
   //    Input: VAL - encoded value
   //
   //    Output: IV1 ... IV6  - visibility of the sides
   //            IR           - increment along R

   Int_t ivis[6], i, k, num;

   k = Int_t(val);
   num = 128;
   for (i = 1; i <= 6; ++i) {
      ivis[i - 1] = 0;
      num /= 2;
      if (k < num) continue;
      k -= num;
      ivis[i - 1] = 1;
   }
   ir = 1;
   if (k == 1) ir = -1;
   iv1 = ivis[5];
   iv2 = ivis[4];
   iv3 = ivis[3];
   iv4 = ivis[2];
   iv5 = ivis[1];
   iv6 = ivis[0];
}


//______________________________________________________________________________
void TPainter3dAlgorithms::SideVisibilityEncode(Int_t iopt, Double_t phi1, Double_t phi2, Double_t &val)
{
   // Encode side visibilities and order along R for sector
   //
   //    Input: IOPT - options: 1 - from BACK to FRONT 'BF'
   //                           2 - from FRONT to BACK 'FB'
   //           PHI1 - 1st phi of sector
   //           PHI2 - 2nd phi of sector
   //
   //    Output: VAL - encoded value

   /* Local variables */
   Double_t zn, phi;
   Int_t k = 0;
   TView *view = 0;

   if (gPad) view = gPad->GetView();
   if (!view) {
      Error("SideVisibilityEncode", "no TView in current pad");
      return;
   }

   view->FindNormal(0, 0, 1, zn);
   if (zn > 0) k += 64;
   if (zn < 0) k += 32;
   view->FindNormal(-TMath::Sin(phi2), TMath::Cos(phi2), 0, zn);
   if (zn > 0) k += 16;
   view->FindNormal(TMath::Sin(phi1), -TMath::Cos(phi1), 0, zn);
   if (zn > 0) k += 4;
   phi = (phi1 + phi2) / (float)2.;
   view->FindNormal(TMath::Cos(phi), TMath::Sin(phi), 0, zn);
   if (zn > 0) k += 8;
   if (zn < 0) k += 2;
   if ((zn <= 0 && iopt == 1) || (zn > 0 && iopt == 2)) ++k;
   val = Double_t(k);
}


//______________________________________________________________________________
void TPainter3dAlgorithms::Spectrum(Int_t nl, Double_t fmin, Double_t fmax, Int_t ic, Int_t idc, Int_t &irep)
{
   // Set Spectrum
   //
   //    Input: NL   - number of levels
   //           FMIN - MIN function value
   //           FMAX - MAX function value
   //           IC   - initial color index (for 1st level)
   //           IDC  - color index increment
   //
   //    Output: IREP - reply: 0 O.K.
   //                         -1 error in parameters
   //                            F_max less than F_min
   //                            illegal number of levels
   //                            initial color index is negative
   //                            color index increment must be positive

   static const char *where = "Spectrum";

   /* Local variables */
   Double_t delf;
   Int_t i;

   irep = 0;
   if (nl == 0) {fNlevel = 0; return; }

   //          C H E C K   P A R A M E T E R S
   if (fmax <= fmin) {
      Error(where, "fmax (%f) less than fmin (%f)", fmax, fmin);
      irep = -1;
      return;
   }
   if (nl < 0 || nl > 256) {
      Error(where, "illegal number of levels (%d)", nl);
      irep = -1;
      return;
   }
   if (ic < 0) {
      Error(where, "initial color index is negative");
      irep = -1;
      return;
   }
   if (idc < 0) {
      Error(where, "color index increment must be positive");
      irep = -1;
   }

   //          S E T  S P E C T R
   const Int_t kMAXCOL = 50;
   delf    = (fmax - fmin) / nl;
   fNlevel = -(nl + 1);
   for (i = 1; i <= nl+1; ++i) {
      fFunLevel[i - 1] = fmin + (i - 1)*delf;
      fColorLevel[i] = ic + (i - 1)*idc;
      if (ic <= kMAXCOL && fColorLevel[i] > kMAXCOL) fColorLevel[i] -= kMAXCOL;
   }
   fColorLevel[0] = fColorLevel[1];
   fColorLevel[nl + 1] = fColorLevel[nl];
}


//______________________________________________________________________________
void TPainter3dAlgorithms::SurfaceCartesian(Double_t ang, Int_t nx, Int_t ny, const char *chopt)
{
   // Draw surface in cartesian coordinate system
   //
   //    Input: ANG      - angle between X ang Y
   //           NX       - number of steps along X
   //           NY       - number of steps along Y
   //
   //           FUN(IX,IY,F,T) - external routine
   //             IX     - X number of the cell
   //             IY     - Y number of the cell
   //             F(3,4) - face which corresponds to the cell
   //             T(4)   - additional function (for example: temperature)
   //
   //           DRFACE(ICODES,XYZ,NP,IFACE,T) - routine for face drawing
   //             ICODES(*) - set of codes for this face
   //               ICODES(1) - IX
   //               ICODES(2) - IY
   //             NP        - number of nodes in face
   //             IFACE(NP) - face
   //             T(NP)     - additional function
   //
   //           CHOPT - options: 'BF' - from BACK to FRONT
   //                            'FB' - from FRONT to BACK

   /* Initialized data */

   Int_t iface[4] = { 1,2,3,4 };

   /* Local variables */
   Double_t cosa, sina, f[12]        /* was [3][4] */;
   Int_t i, incrx, incry, i1, ix, iy;
   Double_t tt[4];
   Int_t icodes[3], ix1, iy1, ix2, iy2;  // was icode[2]. One element more to differentiate front & back boxes from data
   Double_t xyz[12]        /* was [3][4] */;
   Double_t *tn;

   sina = TMath::Sin(ang*kRad);
   cosa = TMath::Cos(ang*kRad);

   //          F I N D   T H E   M O S T   L E F T   P O I N T
   TView *view = 0;

   if (gPad) view = gPad->GetView();
   if (!view) {
      Error("SurfaceCartesian", "no TView in current pad");
      return;
   }
   tn = view->GetTN();

   i1 = 1;
   if (tn) {
      if (tn[0] < 0) i1 = 2;
      if (tn[0]*cosa + tn[1]*sina < 0) i1 = 5 - i1;
   }

   //          D E F I N E   O R D E R   O F   D R A W I N G
   if (*chopt == 'B' || *chopt == 'b') {incrx = -1; incry = -1;}
   else                                {incrx = 1;  incry = 1;}
   if (i1 == 1 || i1 == 2) incrx = -incrx;
   if (i1 == 2 || i1 == 3) incry = -incry;
   ix1 = 1;
   iy1 = 1;
   if (incrx < 0) ix1 = nx;
   if (incry < 0) iy1 = ny;
   ix2 = nx - ix1 + 1;
   iy2 = ny - iy1 + 1;

   //          D R A W   S U R F A C E
   icodes[2] = -1;   // -1 for data, 0 for front a back boxes
   fEdgeIdx = 0;   // constant since stacks are not (yet?) handled for surfaces
   THistPainter *painter = (THistPainter*)gCurrentHist->GetPainter();
   for (iy = iy1; incry < 0 ? iy >= iy2 : iy <= iy2; iy += incry) {
      for (ix = ix1; incrx < 0 ? ix >= ix2 : ix <= ix2; ix += incrx) {
         if (!painter->IsInside(ix,iy)) continue;
         (this->*fSurfaceFunction)(ix, iy, f, tt);
         for (i = 1; i <= 4; ++i) {
            xyz[i*3 - 3] = f[i*3 - 3] + f[i*3 - 2]*cosa;
            xyz[i*3 - 2] = f[i*3 - 2]*sina;
            xyz[i*3 - 1] = f[i*3 - 1];
            // added EJB -->
            Double_t al, ab;
            if (Hoption.Proj == 1 ) {
               THistPainter::ProjectAitoff2xy(xyz[i*3 - 3], xyz[i*3 - 2], al, ab);
               xyz[i*3 - 3] = al;
               xyz[i*3 - 2] = ab;
            } else if (Hoption.Proj == 2 ) {
               THistPainter::ProjectMercator2xy(xyz[i*3 - 3], xyz[i*3 - 2], al, ab);
               xyz[i*3 - 3] = al;
               xyz[i*3 - 2] = ab;
            } else if (Hoption.Proj == 3) {
               THistPainter::ProjectSinusoidal2xy(xyz[i*3 - 3], xyz[i*3 - 2], al, ab);
               xyz[i*3 - 3] = al;
               xyz[i*3 - 2] = ab;
            } else if (Hoption.Proj == 4) {
               THistPainter::ProjectParabolic2xy(xyz[i*3 - 3], xyz[i*3 - 2], al, ab);
               xyz[i*3 - 3] = al;
               xyz[i*3 - 2] = ab;
            }
         }
         icodes[0] = ix;
         icodes[1] = iy;
         (this->*fDrawFace)(icodes, xyz, 4, iface, tt);
      }
   }
}


//______________________________________________________________________________
void TPainter3dAlgorithms::SurfaceFunction(Int_t ia, Int_t ib, Double_t *f, Double_t *t)
{
   // Service function for Surfaces
   static Int_t ixadd[4] = { 0,1,1,0 };
   static Int_t iyadd[4] = { 0,0,1,1 };

   Double_t rinrad = gStyle->GetLegoInnerR();
   Double_t dangle = 10; //Delta angle for Rapidity option
   Double_t yval1l, yval2l;
   Double_t xlab1l, xlab2l, ylab1l, ylab2l;
   Int_t i, ixa, iya, icx, ixt, iyt;

    /* Parameter adjustments */
   --t;
   f -= 4;

   ixt = ia + Hparam.xfirst - 1;
   iyt = ib + Hparam.yfirst - 1;

   // xval1l = Hparam.xmin;
   // xval2l = Hparam.xmax;
   yval1l = Hparam.ymin;
   yval2l = Hparam.ymax;

   xlab1l = gCurrentHist->GetXaxis()->GetXmin();
   xlab2l = gCurrentHist->GetXaxis()->GetXmax();
   if (Hoption.Logx) {
      if (xlab2l>0) {
         if (xlab1l>0) xlab1l = TMath::Log10(xlab1l);
         else          xlab1l = TMath::Log10(0.001*xlab2l);
         xlab2l = TMath::Log10(xlab2l);
      }
   }
   ylab1l = gCurrentHist->GetYaxis()->GetXmin();
   ylab2l = gCurrentHist->GetYaxis()->GetXmax();
   if (Hoption.Logy) {
      if (ylab2l>0) {
         if (ylab1l>0) ylab1l = TMath::Log10(ylab1l);
         else          ylab1l = TMath::Log10(0.001*ylab2l);
         ylab2l = TMath::Log10(ylab2l);
      }
   }

   for (i = 1; i <= 4; ++i) {
      ixa = ixadd[i - 1];
      iya = iyadd[i - 1];
      Double_t xwid = gCurrentHist->GetXaxis()->GetBinWidth(ixt+ixa);
      Double_t ywid = gCurrentHist->GetYaxis()->GetBinWidth(iyt+iya);

   //          Compute the cell position in cartesian coordinates
   //          and compute the LOG if necessary
      f[i*3 + 1] = gCurrentHist->GetXaxis()->GetBinLowEdge(ixt+ixa) + 0.5*xwid;
      f[i*3 + 2] = gCurrentHist->GetYaxis()->GetBinLowEdge(iyt+iya) + 0.5*ywid;
      if (Hoption.Logx) {
         if (f[i*3 + 1] > 0) f[i*3 + 1] = TMath::Log10(f[i*3 + 1]);
         else                f[i*3 + 1] = Hparam.xmin;
      }
      if (Hoption.Logy) {
         if (f[i*3 + 2] > 0) f[i*3 + 2] = TMath::Log10(f[i*3 + 2]);
         else                f[i*3 + 2] = Hparam.ymin;
      }

   //     Transform the cell position in the required coordinate system
      if (Hoption.System == kPOLAR) {
         f[i*3 + 1] = 360*(f[i*3 + 1] - xlab1l) / (xlab2l - xlab1l);
         f[i*3 + 2] = (f[i*3 + 2] - yval1l) / (yval2l - yval1l);
      } else if (Hoption.System == kCYLINDRICAL) {
         f[i*3 + 1] = 360*(f[i*3 + 1] - xlab1l) / (xlab2l - xlab1l);
      } else if (Hoption.System == kSPHERICAL) {
         f[i*3 + 1] = 360*(f[i*3 + 1] - xlab1l) / (xlab2l - xlab1l);
         f[i*3 + 2] = 360*(f[i*3 + 2] - ylab1l) / (ylab2l - ylab1l);
      } else if (Hoption.System == kRAPIDITY) {
         f[i*3 + 1] = 360*(f[i*3 + 1] - xlab1l) / (xlab2l - xlab1l);
         f[i*3 + 2] = (180 - dangle*2)*(f[i*3 + 2] - ylab1l) / (ylab2l - ylab1l) + dangle;
      }

   //          Get the content of the table. If the X index (ICX) is
   //          greater than the X size of the table (NCX), that's mean
   //          IGTABL tried to close the surface and in this case the
   //          first channel should be used. */
      icx = ixt + ixa;
      if (icx > Hparam.xlast) icx = 1;
      f[i*3+3] = Hparam.factor*gCurrentHist->GetBinContent(icx, iyt + iya);
      if (Hoption.Logz) {
         if (f[i*3+3] > 0) f[i*3+3] = TMath::Log10(f[i*3+3]);
         else              f[i*3+3] = Hparam.zmin;
         if (f[i*3+3] < Hparam.zmin) f[i*3+3] = Hparam.zmin;
         if (f[i*3+3] > Hparam.zmax) f[i*3+3] = Hparam.zmax;
      } else {
         f[i*3+3] = TMath::Max(Hparam.zmin, f[i*3+3]);
         f[i*3+3] = TMath::Min(Hparam.zmax, f[i*3+3]);
      }

   // The colors on the surface can represent the content or the errors.
   // if (fSumw2.fN) t[i] = gCurrentHist->GetBinError(icx, iyt + iya);
   // else           t[i] = f[i * 3 + 3];
      t[i] = f[i * 3 + 3];
   }

   //          Define the position of the colored contours for SURF3
   if (Hoption.Surf == 23) {
      for (i = 1; i <= 4; ++i) f[i * 3 + 3] = fRmax[2];
   }

   if (Hoption.System == kCYLINDRICAL || Hoption.System == kSPHERICAL || Hoption.System == kRAPIDITY) {
      for (i = 1; i <= 4; ++i) {
         f[i*3 + 3] = (1 - rinrad)*((f[i*3 + 3] - Hparam.zmin) /
         (Hparam.zmax - Hparam.zmin)) + rinrad;
      }
   }
}


//______________________________________________________________________________
void TPainter3dAlgorithms::SurfacePolar(Int_t iordr, Int_t na, Int_t nb, const char *chopt)
{
   // Draw surface in polar coordinates
   //
   //    Input: IORDR - order of variables (0 - R,PHI, 1 - PHI,R)
   //           NA    - number of steps along 1st variable
   //           NB    - number of steps along 2nd variable
   //
   //           FUN(IA,IB,F,T) - external routine
   //             IA     - cell number for 1st variable
   //             IB     - cell number for 2nd variable
   //             F(3,4) - face which corresponds to the cell
   //               F(1,*) - A
   //               F(2,*) - B
   //               F(3,*) - Z
   //             T(4)   - additional function (for example: temperature)
   //
   //           DRFACE(ICODES,XYZ,NP,IFACE,T) - routine for face drawing
   //             ICODES(*) - set of codes for this face
   //               ICODES(1) - IA
   //               ICODES(2) - IB
   //             XYZ(3,*)  - coordinates of nodes
   //             NP        - number of nodes in face
   //             IFACE(NP) - face
   //             T(NP)     - additional function
   //
   //           CHOPT       - options: 'BF' - from BACK to FRONT
   //                                  'FB' - from FRONT to BACK

   /* Initialized data */
   static Int_t iface[4] = { 1,2,3,4 };
   TView *view = 0;

   if (gPad) view = gPad->GetView();
   if (!view) {
      Error("SurfacePolar", "no TView in current pad");
      return;
   }

   Int_t iphi, jphi, kphi, incr, nphi, iopt, iphi1, iphi2;
   Double_t f[12]        /* was [3][4] */;
   Int_t i, j, incrr, ir1, ir2;
   Double_t z;
   Int_t ia, ib, ir, jr, nr, icodes[3];  // was icode[2]. One element more to differentiate front & back boxes from data
   Double_t tt[4];
   Double_t phi, ttt[4], xyz[12]        /* was [3][4] */;
   ia = ib = 0;

   if (iordr == 0) {
      jr   = 1;
      jphi = 2;
      nr   = na;
      nphi = nb;
   } else {
      jr   = 2;
      jphi = 1;
      nr   = nb;
      nphi = na;
   }
   if (nphi > 180) {
      Error("SurfacePolar", "too many PHI sectors (%d)", nphi);
      return;
   }
   iopt = 2;
   if (*chopt == 'B' || *chopt == 'b') iopt = 1;

   //       P R E P A R E   P H I   A R R A Y
   //      F I N D    C R I T I C A L   S E C T O R S
   kphi = nphi;
   if (iordr == 0) ia = nr;
   if (iordr != 0) ib = nr;
   for (i = 1; i <= nphi; ++i) {
      if (iordr == 0) ib = i;
      if (iordr != 0) ia = i;
      (this->*fSurfaceFunction)(ia, ib, f, tt);
      if (i == 1) fAphi[0] = f[jphi - 1];
      fAphi[i - 1] = (fAphi[i - 1] + f[jphi - 1]) / (float)2.;
      fAphi[i] = f[jphi + 5];
   }
   view->FindPhiSectors(iopt, kphi, fAphi, iphi1, iphi2);

   //       D R A W   S U R F A C E
   icodes[2] = -1;   // -1 for data, 0 for front a back boxes
   fEdgeIdx = 0;   // constant since stacks are not (yet?) handled for surfaces
   incr = 1;
   iphi = iphi1;
L100:
   if (iphi > nphi) goto L300;

   //      F I N D   O R D E R   A L O N G   R
   if (iordr == 0) {ia = nr;         ib = iphi;}
   else            {ia = iphi;ib = nr;}

   (this->*fSurfaceFunction)(ia, ib, f, tt);
   phi = kRad*((f[jphi - 1] + f[jphi + 5]) / 2);
   view->FindNormal(TMath::Cos(phi), TMath::Sin(phi), 0, z);
   incrr = 1;
   ir1 = 1;
   if ((z <= 0 && iopt == 1) || (z > 0 && iopt == 2)) {
      incrr = -1;
      ir1 = nr;
   }
   ir2 = nr - ir1 + 1;
   //      D R A W   S U R F A C E   F O R   S E C T O R
   for (ir = ir1; incrr < 0 ? ir >= ir2 : ir <= ir2; ir += incrr) {
      if (iordr == 0) ia = ir;
      if (iordr != 0) ib = ir;

      (this->*fSurfaceFunction)(ia, ib, f, tt);
      for (i = 1; i <= 4; ++i) {
         j = i;
         if (iordr != 0 && i == 2) j = 4;
         if (iordr != 0 && i == 4) j = 2;
         xyz[j*3 - 3] = f[jr + i*3 - 4]*TMath::Cos(f[jphi + i*3 - 4]*kRad);
         xyz[j*3 - 2] = f[jr + i*3 - 4]*TMath::Sin(f[jphi + i*3 - 4]*kRad);
         xyz[j*3 - 1] = f[i*3 - 1];
         ttt[j - 1] = tt[i - 1];
      }
      icodes[0] = ia;
      icodes[1] = ib;
      (this->*fDrawFace)(icodes, xyz, 4, iface, ttt);
   }
   //      N E X T   P H I
L300:
   iphi += incr;
   if (iphi == 0)     iphi = kphi;
   if (iphi > kphi)   iphi = 1;
   if (iphi != iphi2) goto L100;
   if (incr == 0) return;
   if (incr < 0) {
      incr = 0;
      goto L100;
   }
   incr = -1;
   iphi = iphi1;
   goto L300;
}


//______________________________________________________________________________
void TPainter3dAlgorithms::SurfaceCylindrical(Int_t iordr, Int_t na, Int_t nb, const char *chopt)
{
   // Draw surface in cylindrical coordinates
   //
   //    Input: IORDR - order of variables (0 - Z,PHI, 1 - PHI,Z)
   //           NA    - number of steps along 1st variable
   //           NB    - number of steps along 2nd variable
   //
   //           FUN(IA,IB,F,T) - external routine
   //             IA     - cell number for 1st variable
   //             IB     - cell number for 2nd variable
   //             F(3,4) - face which corresponds to the cell
   //               F(1,*) - A
   //               F(2,*) - B
   //               F(3,*) - R
   //             T(4)   - additional function (for example: temperature)
   //
   //           DRFACE(ICODES,XYZ,NP,IFACE,T) - routine for face drawing
   //             ICODES(*) - set of codes for this face
   //               ICODES(1) - IA
   //               ICODES(2) - IB
   //             XYZ(3,*)  - coordinates of nodes
   //             NP        - number of nodes in face
   //             IFACE(NP) - face
   //             T(NP)     - additional function
   //
   //           CHOPT       - options: 'BF' - from BACK to FRONT
   //                                  'FB' - from FRONT to BACK
   //
   //Begin_Html
   /*
   <img src="gif/Surface1Cylindrical.gif">
   */
   //End_Html

   /* Initialized data */
   static Int_t iface[4] = { 1,2,3,4 };

   Int_t iphi, jphi, kphi, incr, nphi, iopt, iphi1, iphi2;
   Int_t i, j, incrz, nz, iz1, iz2;
   Int_t ia, ib, iz, jz, icodes[3];  // was icode[2]. One element more to differentiate front & back boxes from data
   Double_t f[12]        /* was [3][4] */;
   Double_t z;
   Double_t tt[4];
   Double_t ttt[4], xyz[12]        /* was [3][4] */;
   ia = ib = 0;
   TView *view = 0;

   if (gPad) view = gPad->GetView();
   if (!view) {
      Error("SurfaceCylindrical", "no TView in current pad");
      return;
   }

   if (iordr == 0) {
      jz   = 1;
      jphi = 2;
      nz   = na;
      nphi = nb;
   } else {
      jz   = 2;
      jphi = 1;
      nz   = nb;
      nphi = na;
   }
   if (nphi > 180) {
      Error("SurfaceCylindrical", "too many PHI sectors (%d)", nphi);
      return;
   }
   iopt = 2;
   if (*chopt == 'B' || *chopt == 'b') iopt = 1;

   //       P R E P A R E   P H I   A R R A Y
   //       F I N D    C R I T I C A L   S E C T O R S
   kphi = nphi;
   if (iordr == 0) ia = nz;
   if (iordr != 0) ib = nz;
   for (i = 1; i <= nphi; ++i) {
      if (iordr == 0) ib = i;
      if (iordr != 0) ia = i;
      (this->*fSurfaceFunction)(ia, ib, f, tt);
      if (i == 1) fAphi[0] = f[jphi - 1];
      fAphi[i - 1] = (fAphi[i - 1] + f[jphi - 1]) / (float)2.;
      fAphi[i] = f[jphi + 5];
   }
   view->FindPhiSectors(iopt, kphi, fAphi, iphi1, iphi2);

   //       F I N D   O R D E R   A L O N G   Z
   incrz = 1;
   iz1 = 1;
   view->FindNormal(0, 0, 1, z);
   if ((z <= 0 && iopt == 1) || (z > 0 && iopt == 2)) {
      incrz = -1;
      iz1 = nz;
   }
   iz2 = nz - iz1 + 1;

   //       D R A W   S U R F A C E
   icodes[2] = -1;   // -1 for data, 0 for front a back boxes
   fEdgeIdx = 0;   // constant since stacks are not (yet?) handled for surfaces
   incr = 1;
   iphi = iphi1;
L100:
   if (iphi > nphi) goto L400;
   for (iz = iz1; incrz < 0 ? iz >= iz2 : iz <= iz2; iz += incrz) {
      if (iordr == 0) {ia = iz;   ib = iphi;}
      else             {ia = iphi; ib = iz;}
      (this->*fSurfaceFunction)(ia, ib, f, tt);
      for (i = 1; i <= 4; ++i) {
         j = i;
         if (iordr == 0 && i == 2) j = 4;
         if (iordr == 0 && i == 4) j = 2;
         xyz[j*3 - 3] = f[i*3 - 1]*TMath::Cos(f[jphi + i*3 - 4]*kRad);
         xyz[j*3 - 2] = f[i*3 - 1]*TMath::Sin(f[jphi + i*3 - 4]*kRad);
         xyz[j*3 - 1] = f[jz + i*3 - 4];
         ttt[j - 1] = tt[i - 1];
      }
      icodes[0] = ia;
      icodes[1] = ib;
      (this->*fDrawFace)(icodes, xyz, 4, iface, ttt);
   }
   //      N E X T   P H I
L400:
   iphi += incr;
   if (iphi == 0)     iphi = kphi;
   if (iphi > kphi)   iphi = 1;
   if (iphi != iphi2) goto L100;
   if (incr ==  0) return;
   if (incr < 0) {
      incr = 0;
      goto L100;
   }
   incr = -1;
   iphi = iphi1;
   goto L400;
}


//______________________________________________________________________________
void TPainter3dAlgorithms::SurfaceSpherical(Int_t ipsdr, Int_t iordr, Int_t na, Int_t nb, const char *chopt)
{
   // Draw surface in spheric coordinates
   //
   //    Input: IPSDR - pseudo-rapidity flag
   //           IORDR - order of variables (0 - THETA,PHI; 1 - PHI,THETA)
   //           NA    - number of steps along 1st variable
   //           NB    - number of steps along 2nd variable
   //
   //           FUN(IA,IB,F,T) - external routine
   //             IA     - cell number for 1st variable
   //             IB     - cell number for 2nd variable
   //             F(3,4) - face which corresponds to the cell
   //               F(1,*) - A
   //               F(2,*) - B
   //               F(3,*) - R
   //             T(4)   - additional function (for example: temperature)
   //
   //           DRFACE(ICODES,XYZ,NP,IFACE,T) - routine for face drawing
   //             ICODES(*) - set of codes for this face
   //               ICODES(1) - IA
   //               ICODES(2) - IB
   //             XYZ(3,*)  - coordinates of nodes
   //             NP        - number of nodes in face
   //             IFACE(NP) - face
   //             T(NP)     - additional function
   //
   //           CHOPT       - options: 'BF' - from BACK to FRONT
   //                                  'FB' - from FRONT to BACK

   /* Initialized data */
   static Int_t iface[4] = { 1,2,3,4 };

   Int_t iphi, jphi, kphi, incr, nphi, iopt, iphi1, iphi2;
   Int_t i, j, incrth, ith, jth, kth, nth, mth, ith1, ith2;
   Int_t ia, ib, icodes[3];  // was icode[2]. One element more to differentiate front & back boxes from data
   Double_t f[12]        /* was [3][4] */;
   Double_t tt[4];
   Double_t phi;
   Double_t ttt[4], xyz[12]        /* was [3][4] */;
   ia = ib = 0;
   TView *view = 0;

   if (gPad) view = gPad->GetView();
   if (!view) {
      Error("SurfaceSpherical", "no TView in current pad");
      return;
   }

   if (iordr == 0) {
      jth  = 1;
      jphi = 2;
      nth  = na;
      nphi = nb;
   } else {
      jth  = 2;
      jphi = 1;
      nth  = nb;
      nphi = na;
   }
   if (nth > 180)  {
      Error("SurfaceSpherical", "too many THETA sectors (%d)", nth);
      return;
   }
   if (nphi > 180) {
      Error("SurfaceSpherical", "too many PHI sectors (%d)", nphi);
      return;
   }
   iopt = 2;
   if (*chopt == 'B' || *chopt == 'b') iopt = 1;

   //       P R E P A R E   P H I   A R R A Y
   //       F I N D    C R I T I C A L   P H I   S E C T O R S
   kphi = nphi;
   mth = nth / 2;
   if (mth == 0)    mth = 1;
   if (iordr == 0) ia = mth;
   if (iordr != 0) ib = mth;
   for (i = 1; i <= nphi; ++i) {
      if (iordr == 0) ib = i;
      if (iordr != 0) ia = i;
      (this->*fSurfaceFunction)(ia, ib, f, tt);
      if (i == 1) fAphi[0] = f[jphi - 1];
      fAphi[i - 1] = (fAphi[i - 1] + f[jphi - 1]) / (float)2.;
      fAphi[i] = f[jphi + 5];
   }
   view->FindPhiSectors(iopt, kphi, fAphi, iphi1, iphi2);

   //       P R E P A R E   T H E T A   A R R A Y
   if (iordr == 0) ib = 1;
   if (iordr != 0) ia = 1;
   for (i = 1; i <= nth; ++i) {
      if (iordr == 0) ia = i;
      if (iordr != 0) ib = i;

      (this->*fSurfaceFunction)(ia, ib, f, tt);
      if (i == 1) fAphi[0] = f[jth - 1];
      fAphi[i - 1] = (fAphi[i - 1] + f[jth - 1]) / (float)2.;
      fAphi[i] = f[jth + 5];
   }

   //       D R A W   S U R F A C E
   icodes[2] = -1;   // -1 for data, 0 for front a back boxes
   fEdgeIdx = 0;   // constant since stacks are not (yet?) handled for surfaces
   kth  = nth;
   incr = 1;
   iphi = iphi1;
L100:
   if (iphi > nphi) goto L500;

   //      F I N D    C R I T I C A L   T H E T A   S E C T O R S
   if (iordr == 0) {ia = mth; ib = iphi;}
   else             {ia = iphi;ib = mth;}

   (this->*fSurfaceFunction)(ia, ib, f, tt);
   phi = (f[jphi - 1] + f[jphi + 5]) / (float)2.;
   view->FindThetaSectors(iopt, phi, kth, fAphi, ith1, ith2);
   incrth = 1;
   ith = ith1;
L200:
   if (ith > nth)   goto L400;
   if (iordr == 0) ia = ith;
   if (iordr != 0) ib = ith;

   (this->*fSurfaceFunction)(ia, ib, f, tt);
   if (ipsdr == 1) {
      for (i = 1; i <= 4; ++i) {
         j = i;
         if (iordr != 0 && i == 2) j = 4;
         if (iordr != 0 && i == 4) j = 2;
         xyz[j * 3 - 3] = f[i*3 - 1]*TMath::Cos(f[jphi + i*3 - 4]*kRad);
         xyz[j * 3 - 2] = f[i*3 - 1]*TMath::Sin(f[jphi + i*3 - 4]*kRad);
         xyz[j * 3 - 1] = f[i*3 - 1]*TMath::Cos(f[jth  + i*3 - 4]*kRad) /
                          TMath::Sin(f[jth + i*3 - 4]*kRad);
         ttt[j - 1] = tt[i - 1];
      }
   } else {
      for (i = 1; i <= 4; ++i) {
         j = i;
         if (iordr != 0 && i == 2) j = 4;
         if (iordr != 0 && i == 4) j = 2;
         xyz[j*3 - 3] = f[i*3 - 1]*TMath::Sin(f[jth + i*3 - 4]*kRad)*TMath::Cos(f[jphi + i*3 - 4]*kRad);
         xyz[j*3 - 2] = f[i*3 - 1]*TMath::Sin(f[jth + i*3 - 4]*kRad)*TMath::Sin(f[jphi + i*3 - 4]*kRad);
         xyz[j*3 - 1] = f[i*3 - 1]*TMath::Cos(f[jth + i*3 - 4]*kRad);
         ttt[j - 1] = tt[i - 1];
      }
   }
   icodes[0] = ia;
   icodes[1] = ib;
   (this->*fDrawFace)(icodes, xyz, 4, iface, ttt);
   //      N E X T   T H E T A
L400:
   ith += incrth;
   if (ith == 0)    ith = kth;
   if (ith > kth)   ith = 1;
   if (ith != ith2) goto L200;
   if (incrth == 0)  goto L500;
   if (incrth < 0) {
      incrth = 0;
      goto L200;
   }
   incrth = -1;
   ith = ith1;
   goto L400;
   //      N E X T   P H I
L500:
   iphi += incr;
   if (iphi == 0)     iphi = kphi;
   if (iphi > kphi)   iphi = 1;
   if (iphi != iphi2) goto L100;
   if (incr == 0) return;
   if (incr < 0) {
      incr = 0;
      goto L100;
   }
   incr = -1;
   iphi = iphi1;
   goto L500;
}


//______________________________________________________________________________
void TPainter3dAlgorithms::SurfaceProperty(Double_t qqa, Double_t qqd, Double_t qqs, Int_t nnqs, Int_t &irep)
{
   // Set surface property coefficients
   //
   //    Input: QQA  - diffusion coefficient for diffused light  [0.,1.]
   //           QQD  - diffusion coefficient for direct light    [0.,1.]
   //           QQS  - diffusion coefficient for reflected light [0.,1.]
   //           NNCS - power coefficient for reflected light     (.GE.1)
   //
   //                                         --
   //    Lightness model formula: Y = YD*QA + > YLi*(QD*cosNi+QS*cosRi)
   //                                         --
   //
   //    Output: IREP   - reply : 0 - O.K.
   //                            -1 - error in cooefficients

   irep = 0;
   if (qqa < 0 || qqa > 1 || qqd < 0 || qqd > 1 || qqs < 0 || qqs > 1 || nnqs < 1) {
      Error("SurfaceProperty", "error in coefficients");
      irep = -1;
      return;
   }
   fQA  = qqa;
   fQD  = qqd;
   fQS  = qqs;
   fNqs = nnqs;
}


//______________________________________________________________________________
void TPainter3dAlgorithms::ImplicitFunction(Double_t *rmin, Double_t *rmax,
                             Int_t nx, Int_t ny, Int_t nz, const char *chopt)
{
   // Draw implicit function FUN(X,Y,Z) = 0 in cartesian coordinates using
   // hidden surface removal algorithm "Painter".
   //
   //     Input: FUN      - external routine FUN(X,Y,Z)
   //            RMIN(3)  - min scope coordinates
   //            RMAX(3)  - max scope coordinates
   //            NX       - number of steps along X
   //            NY       - number of steps along Y
   //            NZ       - number of steps along Z
   //
   //            DRFACE(ICODES,XYZ,NP,IFACE,T) - routine for face drawing
   //              ICODES(*) - set of codes for this face
   //                ICODES(1) - 1
   //                ICODES(2) - 1
   //                ICODES(3) - 1
   //              NP        - number of nodes in face
   //              IFACE(NP) - face
   //              T(NP)     - additional function (lightness)
   //
   //            CHOPT - options: 'BF' - from BACK to FRONT
   //                             'FB' - from FRONT to BACK

   Int_t ix,    iy,    iz;
   Int_t ix1,   iy1,   iz1;
   Int_t ix2,   iy2,   iz2;
   Int_t incr,  incrx, incry, incrz;
   Int_t icodes[3], i, i1, i2, k, nnod, ntria;
   Double_t x1=0, x2=0, y1, y2, z1, z2;
   Double_t dx, dy, dz;
   Double_t p[8][3], pf[8], pn[8][3], t[3], fsurf, w;

   Double_t xyz[kNmaxp][3], xyzn[kNmaxp][3], grad[kNmaxp][3];
   Double_t dtria[kNmaxt][6], abcd[kNmaxt][4];
   Int_t    itria[kNmaxt][3], iorder[kNmaxt];
   TView *view = 0;

   if (gPad) view = gPad->GetView();
   if (!view) {
      Error("ImplicitFunction", "no TView in current pad");
      return;
   }
   Double_t *tnorm = view->GetTnorm();
   if (!tnorm) return;

   //       D E F I N E   O R D E R   O F   D R A W I N G
   if (*chopt == 'B' || *chopt == 'b') {
      incrx = +1;
      incry = +1;
      incrz = +1;
   } else {
      incrx = -1;
      incry = -1;
      incrz = -1;
   }
   if (tnorm[8]  < 0.) incrx =-incrx;
   if (tnorm[9]  < 0.) incry =-incry;
   if (tnorm[10] < 0.) incrz =-incrz;
   ix1 = 1;
   iy1 = 1;
   iz1 = 1;
   if (incrx == -1) ix1 = nx;
   if (incry == -1) iy1 = ny;
   if (incrz == -1) iz1 = nz;
   ix2 = nx - ix1 + 1;
   iy2 = ny - iy1 + 1;
   iz2 = nz - iz1 + 1;
   dx  = (rmax[0]-rmin[0]) / nx;
   dy  = (rmax[1]-rmin[1]) / ny;
   dz  = (rmax[2]-rmin[2]) / nz;

   // Define the colors used to draw the function
   Float_t r=0., g=0., b=0., hue, light, satur, light2;
   TColor *colref = gROOT->GetColor(fgCurrentF3->GetFillColor());
   if (colref) colref->GetRGB(r, g, b);
   TColor::RGBtoHLS(r, g, b, hue, light, satur);
   TColor *acol;
   acol = gROOT->GetColor(kF3FillColor1);
   if (acol) acol->SetRGB(r, g, b);
   if (light >= 0.5) {
      light2 = .5*light;
   } else {
      light2 = 1-.5*light;
   }
   TColor::HLStoRGB(hue, light2, satur, r, g, b);
   acol = gROOT->GetColor(kF3FillColor2);
   if (acol) acol->SetRGB(r, g, b);
   colref = gROOT->GetColor(fgCurrentF3->GetLineColor());
   if (colref) colref->GetRGB(r, g, b);
   acol = gROOT->GetColor(kF3LineColor);
   if (acol) acol->SetRGB(r, g, b);

   //       D R A W   F U N C T I O N
   for (iz = iz1; incrz < 0 ? iz >= iz2 : iz <= iz2; iz += incrz) {
      z1     = (iz-1)*dz + rmin[2];
      z2     = z1 + dz;
      p[0][2] = z1;
      p[1][2] = z1;
      p[2][2] = z1;
      p[3][2] = z1;
      p[4][2] = z2;
      p[5][2] = z2;
      p[6][2] = z2;
      p[7][2] = z2;
      for (iy = iy1; incry < 0 ? iy >= iy2 : iy <= iy2; iy += incry) {
         y1      = (iy-1)*dy + rmin[1];
         y2      = y1 + dy;
         p[0][1] = y1;
         p[1][1] = y1;
         p[2][1] = y2;
         p[3][1] = y2;
         p[4][1] = y1;
         p[5][1] = y1;
         p[6][1] = y2;
         p[7][1] = y2;
         if (incrx == +1) {
            x2    = rmin[0];
            pf[1] = fgCurrentF3->Eval(x2,y1,z1);
            pf[2] = fgCurrentF3->Eval(x2,y2,z1);
            pf[5] = fgCurrentF3->Eval(x2,y1,z2);
            pf[6] = fgCurrentF3->Eval(x2,y2,z2);
         } else {
            x1    = rmax[0];
            pf[0] = fgCurrentF3->Eval(x1,y1,z1);
            pf[3] = fgCurrentF3->Eval(x1,y2,z1);
            pf[4] = fgCurrentF3->Eval(x1,y1,z2);
            pf[7] = fgCurrentF3->Eval(x1,y2,z2);
         }
         for (ix = ix1; incrx < 0 ? ix >= ix2 : ix <= ix2; ix += incrx) {
            icodes[0] = ix;
            icodes[1] = iy;
            icodes[2] = iz;
            if (incrx == +1) {
               x1     = x2;
               x2     = x2 + dx;
               pf[0]  = pf[1];
               pf[3]  = pf[2];
               pf[4]  = pf[5];
               pf[7]  = pf[6];
               pf[1]  = fgCurrentF3->Eval(x2,y1,z1);
               pf[2]  = fgCurrentF3->Eval(x2,y2,z1);
               pf[5]  = fgCurrentF3->Eval(x2,y1,z2);
               pf[6]  = fgCurrentF3->Eval(x2,y2,z2);
            } else {
               x2     = x1;
               x1     = x1 - dx;
               pf[1]  = pf[0];
               pf[2]  = pf[3];
               pf[5]  = pf[4];
               pf[6]  = pf[7];
               pf[0]  = fgCurrentF3->Eval(x1,y1,z1);
               pf[3]  = fgCurrentF3->Eval(x1,y2,z1);
               pf[4]  = fgCurrentF3->Eval(x1,y1,z2);
               pf[7]  = fgCurrentF3->Eval(x1,y2,z2);
            }
            if (pf[0] >= -kFdel) goto L110;
            if (pf[1] >= -kFdel) goto L120;
            if (pf[2] >= -kFdel) goto L120;
            if (pf[3] >= -kFdel) goto L120;
            if (pf[4] >= -kFdel) goto L120;
            if (pf[5] >= -kFdel) goto L120;
            if (pf[6] >= -kFdel) goto L120;
            if (pf[7] >= -kFdel) goto L120;
            goto L510;
L110:
            if (pf[1] < -kFdel) goto L120;
            if (pf[2] < -kFdel) goto L120;
            if (pf[3] < -kFdel) goto L120;
            if (pf[4] < -kFdel) goto L120;
            if (pf[5] < -kFdel) goto L120;
            if (pf[6] < -kFdel) goto L120;
            if (pf[7] < -kFdel) goto L120;
            goto L510;
L120:
            p[0][0] = x1;
            p[1][0] = x2;
            p[2][0] = x2;
            p[3][0] = x1;
            p[4][0] = x1;
            p[5][0] = x2;
            p[6][0] = x2;
            p[7][0] = x1;

            //       F I N D   G R A D I E N T S
            // Find X-gradient
            if (ix == 1) {
               pn[0][0] = (pf[1] - pf[0]) / dx;
               pn[3][0] = (pf[2] - pf[3]) / dx;
               pn[4][0] = (pf[5] - pf[4]) / dx;
               pn[7][0] = (pf[6] - pf[7]) / dx;
            } else {
               pn[0][0] = (pf[1] - fgCurrentF3->Eval(x1-dx,y1,z1)) / (dx + dx);
               pn[3][0] = (pf[2] - fgCurrentF3->Eval(x1-dx,y2,z1)) / (dx + dx);
               pn[4][0] = (pf[5] - fgCurrentF3->Eval(x1-dx,y1,z2)) / (dx + dx);
               pn[7][0] = (pf[6] - fgCurrentF3->Eval(x1-dx,y2,z2)) / (dx + dx);
            }
            if (ix == nx) {
               pn[1][0] = (pf[1] - pf[0]) / dx;
               pn[2][0] = (pf[2] - pf[3]) / dx;
               pn[5][0] = (pf[5] - pf[4]) / dx;
               pn[6][0] = (pf[6] - pf[7]) / dx;
            } else {
               pn[1][0] = (fgCurrentF3->Eval(x2+dx,y1,z1) - pf[0]) / (dx + dx);
               pn[2][0] = (fgCurrentF3->Eval(x2+dx,y2,z1) - pf[3]) / (dx + dx);
               pn[5][0] = (fgCurrentF3->Eval(x2+dx,y1,z2) - pf[4]) / (dx + dx);
               pn[6][0] = (fgCurrentF3->Eval(x2+dx,y2,z2) - pf[7]) / (dx + dx);
            }
            // Find Y-gradient
            if (iy == 1) {
               pn[0][1] = (pf[3] - pf[0]) / dy;
               pn[1][1] = (pf[2] - pf[1]) / dy;
               pn[4][1] = (pf[7] - pf[4]) / dy;
               pn[5][1] = (pf[6] - pf[5]) / dy;
            } else {
               pn[0][1] = (pf[3] - fgCurrentF3->Eval(x1,y1-dy,z1)) / (dy + dy);
               pn[1][1] = (pf[2] - fgCurrentF3->Eval(x2,y1-dy,z1)) / (dy + dy);
               pn[4][1] = (pf[7] - fgCurrentF3->Eval(x1,y1-dy,z2)) / (dy + dy);
               pn[5][1] = (pf[6] - fgCurrentF3->Eval(x2,y1-dy,z2)) / (dy + dy);
            }
            if (iy == ny) {
               pn[2][1] = (pf[2] - pf[1]) / dy;
               pn[3][1] = (pf[3] - pf[0]) / dy;
               pn[6][1] = (pf[6] - pf[5]) / dy;
               pn[7][1] = (pf[7] - pf[4]) / dy;
            } else {
               pn[2][1] = (fgCurrentF3->Eval(x2,y2+dy,z1) - pf[1]) / (dy + dy);
               pn[3][1] = (fgCurrentF3->Eval(x1,y2+dy,z1) - pf[0]) / (dy + dy);
               pn[6][1] = (fgCurrentF3->Eval(x2,y2+dy,z2) - pf[5]) / (dy + dy);
               pn[7][1] = (fgCurrentF3->Eval(x1,y2+dy,z2) - pf[4]) / (dy + dy);
            }
            // Find Z-gradient
            if (iz == 1) {
               pn[0][2] = (pf[4] - pf[0]) / dz;
               pn[1][2] = (pf[5] - pf[1]) / dz;
               pn[2][2] = (pf[6] - pf[2]) / dz;
               pn[3][2] = (pf[7] - pf[3]) / dz;
            } else {
               pn[0][2] = (pf[4] - fgCurrentF3->Eval(x1,y1,z1-dz)) / (dz + dz);
               pn[1][2] = (pf[5] - fgCurrentF3->Eval(x2,y1,z1-dz)) / (dz + dz);
               pn[2][2] = (pf[6] - fgCurrentF3->Eval(x2,y2,z1-dz)) / (dz + dz);
               pn[3][2] = (pf[7] - fgCurrentF3->Eval(x1,y2,z1-dz)) / (dz + dz);
            }
            if (iz == nz) {
               pn[4][2] = (pf[4] - pf[0]) / dz;
               pn[5][2] = (pf[5] - pf[1]) / dz;
               pn[6][2] = (pf[6] - pf[2]) / dz;
               pn[7][2] = (pf[7] - pf[3]) / dz;
            } else {
               pn[4][2] = (fgCurrentF3->Eval(x1,y1,z2+dz) - pf[0]) / (dz + dz);
               pn[5][2] = (fgCurrentF3->Eval(x2,y1,z2+dz) - pf[1]) / (dz + dz);
               pn[6][2] = (fgCurrentF3->Eval(x2,y2,z2+dz) - pf[2]) / (dz + dz);
               pn[7][2] = (fgCurrentF3->Eval(x1,y2,z2+dz) - pf[3]) / (dz + dz);
            }
            fsurf = 0.;
            MarchingCube(fsurf, p, pf, pn, nnod, ntria, xyz, grad, itria);
            if (ntria == 0)   goto L510;

            for ( i=1 ; i<=nnod ; i++ ) {
               view->WCtoNDC(&xyz[i-1][0], &xyzn[i-1][0]);
               Luminosity(&grad[i-1][0], w);
               grad[i-1][0] = w;
            }
            ZDepth(xyzn, ntria, itria, dtria, abcd, (Int_t*)iorder);
            if (ntria == 0)   goto L510;
            incr = 1;
            if (*chopt == 'B' || *chopt == 'b') incr =-1;
            i1 = 1;
            if (incr == -1) i1 = ntria;
            i2 = ntria - i1 + 1;
            // If clipping box is on do not draw the triangles
            if (fgF3Clipping) {
               if(x2<=fgF3XClip && y2 <=fgF3YClip && z2>=fgF3ZClip) goto L510;
            }
            // Draw triangles
            for (i=i1; incr < 0 ? i >= i2 : i <= i2; i += incr) {
               k      = iorder[i-1];
               t[0]   = grad[TMath::Abs(itria[k-1][0])-1][0];
               t[1]   = grad[TMath::Abs(itria[k-1][1])-1][0];
               t[2]   = grad[TMath::Abs(itria[k-1][2])-1][0];
               (this->*fDrawFace)(icodes, (Double_t*)xyz, 3, &itria[k-1][0], t);
            }
L510:
            continue;
         }
      }
   }
}


//______________________________________________________________________________
void TPainter3dAlgorithms::MarchingCube(Double_t fiso, Double_t p[8][3],
                                        Double_t f[8], Double_t g[8][3],
                                        Int_t &nnod, Int_t &ntria,
                                        Double_t xyz[][3],
                                        Double_t grad[][3],
                                        Int_t itria[][3])
{
   // Topological decider for "Marching Cubes" algorithm Find set of triangles
   // aproximating the isosurface F(x,y,z)=Fiso inside the cube
   // (improved version)
   //
   // Input: FISO   - function value for isosurface
   //        P(3,8) - cube vertexes
   //        F(8)   - function values at the vertexes
   //        G(3,8) - function gradients at the vertexes
   //
   // Output: NNOD       - number of nodes     (maximum 13)
   //         NTRIA      - number of triangles (maximum 12)
   //         XYZ(3,*)   - nodes
   //         GRAD(3,*)  - node normales       (not normalized)
   //         ITRIA(3,*) - triangles
   //

   static Int_t irota[24][8] = { { 1,2,3,4,5,6,7,8 }, { 2,3,4,1,6,7,8,5 },
                                 { 3,4,1,2,7,8,5,6 }, { 4,1,2,3,8,5,6,7 },
                                 { 6,5,8,7,2,1,4,3 }, { 5,8,7,6,1,4,3,2 },
                                 { 8,7,6,5,4,3,2,1 }, { 7,6,5,8,3,2,1,4 },
                                 { 2,6,7,3,1,5,8,4 }, { 6,7,3,2,5,8,4,1 },
                                 { 7,3,2,6,8,4,1,5 }, { 3,2,6,7,4,1,5,8 },
                                 { 5,1,4,8,6,2,3,7 }, { 1,4,8,5,2,3,7,6 },
                                 { 4,8,5,1,3,7,6,2 }, { 8,5,1,4,7,6,2,3 },
                                 { 5,6,2,1,8,7,3,4 }, { 6,2,1,5,7,3,4,8 },
                                 { 2,1,5,6,3,4,8,7 }, { 1,5,6,2,4,8,7,3 },
                                 { 4,3,7,8,1,2,6,5 }, { 3,7,8,4,2,6,5,1 },
                                 { 7,8,4,3,6,5,1,2 }, { 8,4,3,7,5,1,2,6 } };

   static Int_t iwhat[21] = { 1,3,5,65,50,67,74,51,177,105,113,58,165,178,
                              254,252,250,190,205,188,181 };
   Int_t j, i, i1, i2, i3, ir, irt=0, k, k1, k2, incr, icase=0, n;
   Int_t itr[3];

   nnod  = 0;
   ntria = 0;

   // F I N D   C O N F I G U R A T I O N   T Y P E
   for ( i=1; i<=8 ; i++) {
      fF8[i-1] = f[i-1] - fiso;
   }
   for ( ir=1 ; ir<=24 ; ir++ ) {
      k    = 0;
      incr = 1;
      for ( i=1 ; i<=8 ; i++ ) {
         if (fF8[irota[ir-1][i-1]-1] >= 0.) k = k + incr;
         incr = incr + incr;
      }
      if (k==0 || k==255) return;
      for ( i=1 ; i<=21 ; i++ ) {
         if (k != iwhat[i-1]) continue;
            icase = i;
            irt   = ir;
            goto L200;
      }
   }

   // R O T A T E   C U B E
L200:
   for ( i=1 ; i<=8 ; i++ ) {
      k        = irota[irt-1][i-1];
      fF8[i-1] = f[k-1] - fiso;
      fP8[i-1][0] = p[k-1][0];
      fP8[i-1][1] = p[k-1][1];
      fP8[i-1][2] = p[k-1][2];
      fG8[i-1][0] = g[k-1][0];
      fG8[i-1][1] = g[k-1][1];
      fG8[i-1][2] = g[k-1][2];
   }

   // V A R I O U S   C O N F I G U R A T I O N S
   n = 0;
   switch ((int)icase) {
      case 1:
      case 15:
         MarchingCubeCase00(1, 4, 9, 0, 0, 0, nnod, ntria, xyz, grad, itria);
         goto L400;
      case 2:
      case 16:
         MarchingCubeCase00(2, 4, 9, 10, 0, 0, nnod, ntria, xyz, grad, itria);
         goto L400;
      case 3:
      case 17:
         MarchingCubeCase03(nnod, ntria, xyz, grad, itria);
         goto L400;
      case 4:
      case 18:
         MarchingCubeCase04(nnod, ntria, xyz, grad, itria);
         goto L400;
      case 5:
      case 19:
         MarchingCubeCase00(6, 2, 1, 9, 8, 0, nnod, ntria, xyz, grad, itria);
         goto L400;
      case 6:
      case 20:
         MarchingCubeCase06(nnod, ntria, xyz, grad, itria);
         goto L400;
      case 7:
      case 21:
         MarchingCubeCase07(nnod, ntria, xyz, grad, itria);
         goto L400;
      case 8:
         MarchingCubeCase00(2, 4, 8, 6, 0, 0, nnod, ntria, xyz, grad, itria);
         goto L500;
      case 9:
         MarchingCubeCase00(1, 4, 12, 7, 6, 10, nnod, ntria, xyz, grad, itria);
         goto L500;
      case 0:
         MarchingCubeCase10(nnod, ntria, xyz, grad, itria);
         goto L500;
      case 11:
         MarchingCubeCase00(1, 4, 8, 7, 11, 10, nnod, ntria, xyz, grad, itria);
         goto L500;
      case 12:
         MarchingCubeCase12(nnod, ntria, xyz, grad, itria);
         goto L500;
      case 13:
         MarchingCubeCase13(nnod, ntria, xyz, grad, itria);
         goto L500;
      case 14:
         MarchingCubeCase00(1, 9, 12, 7, 6, 2, nnod, ntria, xyz, grad, itria);
         goto L500;
   }

   // I F   N E E D E D ,   I N V E R T   T R I A N G L E S
L400:
   if (ntria == 0) return;
   if (icase <= 14) goto L500;
   for ( i=1; i<=ntria ; i++ ) {
      i1 = TMath::Abs(itria[i-1][0]);
      i2 = TMath::Abs(itria[i-1][1]);
      i3 = TMath::Abs(itria[i-1][2]);
      if (itria[i-1][2] < 0) i1 =-i1;
      if (itria[i-1][1] < 0) i3 =-i3;
      if (itria[i-1][0] < 0) i2 =-i2;
      itria[i-1][0] = i1;
      itria[i-1][1] = i3;
      itria[i-1][2] = i2;
   }

   // R E M O V E   V E R Y   S M A L L   T R I A N G L E S
L500:
   n = n + 1;
L510:
   if (n > ntria) return;
   for ( i=1 ; i<=3 ; i++ ) {
      i1 = i;
      i2 = i + 1;
      if (i == 3) i2 = 1;
      k1 = TMath::Abs(itria[n-1][i1-1]);
      k2 = TMath::Abs(itria[n-1][i2-1]);
      if (TMath::Abs(xyz[k1-1][0]-xyz[k2-1][0]) > kDel) continue;
      if (TMath::Abs(xyz[k1-1][1]-xyz[k2-1][1]) > kDel) continue;
      if (TMath::Abs(xyz[k1-1][2]-xyz[k2-1][2]) > kDel) continue;
      i3 = i - 1;
      if (i == 1) i3 = 3;
      goto L530;
   }
   goto L500;

   // R E M O V E   T R I A N G L E
L530:
   for ( i=1 ; i<=3 ; i++ ) {
      itr[i-1] = itria[n-1][i-1];
      itria[n-1][i-1] = itria[ntria-1][i-1];
   }
   ntria = ntria - 1;
   if (ntria == 0) return;
   if (itr[i2-1]*itr[i3-1] > 0) goto L510;

   // C O R R E C T   O T H E R   T R I A N G L E S
   if (itr[i2-1] < 0) {
      k1 =-itr[i2-1];
      k2 =-TMath::Abs(itr[i3-1]);
   }
   if (itr[i3-1] < 0) {
      k1 =-itr[i3-1];
      k2 =-TMath::Abs(itr[i1-1]);
   }
   for ( j=1 ; j<=ntria ; j++ ) {
      for ( i=1 ; i<=3 ; i++ ) {
         if (itria[j-1][i-1] != k2) continue;
         i2 = TMath::Abs(itria[j-1][0]);
         if (i != 3) i2 = TMath::Abs(itria[j-1][i]);
         if (i2 == k1) itria[j-1][i-1] =-itria[j-1][i-1];
         goto L560;
      }
L560:
      continue;
   }
   goto L510;
}


//______________________________________________________________________________
void TPainter3dAlgorithms::MarchingCubeCase00(Int_t k1, Int_t k2, Int_t k3,
                                              Int_t k4, Int_t k5, Int_t k6,
                                              Int_t &nnod, Int_t &ntria,
                                              Double_t xyz[52][3],
                                              Double_t grad[52][3],
                                              Int_t itria[48][3])
{
   // Consideration of trivial cases: 1,2,5,8,9,11,14
   //
   // Input: K1,...,K6 - edges intersected with isosurface
   //
   // Output: the same as for IHMCUB

   static Int_t it[4][4][3] = { { { 1,2, 3 }, { 0,0, 0 }, { 0,0, 0 }, { 0,0, 0 } },
                                { { 1,2,-3 }, {-1,3, 4 }, { 0,0, 0 }, { 0,0, 0 } },
                                { { 1,2,-3 }, {-1,3,-4 }, {-1,4, 5 }, { 0,0, 0 } },
                                { { 1,2,-3 }, {-1,3,-4 }, {-4,6,-1 }, { 4,5,-6 } }
                              };
   Int_t it2[4][3], i, j;

   Int_t ie[6];

   // S E T   N O D E S   &   N O R M A L E S
   ie[0] = k1;
   ie[1] = k2;
   ie[2] = k3;
   ie[3] = k4;
   ie[4] = k5;
   ie[5] = k6;
   nnod  = 6;
   if (ie[5] == 0) nnod = 5;
   if (ie[4] == 0) nnod = 4;
   if (ie[3] == 0) nnod = 3;
   MarchingCubeFindNodes(nnod, ie, xyz, grad);

   // S E T   T R I A N G L E S
   ntria = nnod - 2;
   // Copy "it" into a 2D matrix to be passed to MarchingCubeSetTriangles
   for ( i=0; i<3 ; i++) {
      for ( j=0; j<4 ; j++) {
         it2[j][i] = it[ntria-1][j][i];
      }
   }
   MarchingCubeSetTriangles(ntria, it2, itria);
}


//______________________________________________________________________________
void TPainter3dAlgorithms::MarchingCubeCase03(Int_t &nnod, Int_t &ntria,
                               Double_t xyz[52][3], Double_t grad[52][3], Int_t itria[48][3])
{
   // Consider case No 3
   //
   // Input: see common HCMCUB
   //
   // Output: the same as for IHMCUB

   Double_t f0;
   static Int_t ie[6]     = { 4,9,1, 2,11,3 };
   static Int_t it1[2][3] = { { 1,2,3 }, { 4,5,6 } };
   static Int_t it2[4][3] = { { 1,2,-5 }, { -1,5,6 }, { 5,-2,4 }, { -4,2,3 } };

   //  S E T   N O D E S   &   N O R M A L E S
   nnod = 6;
   MarchingCubeFindNodes(nnod, ie, xyz, grad);

   //  F I N D   C O N F I G U R A T I O N
   f0 = (fF8[0]*fF8[2]-fF8[1]*fF8[3]) / (fF8[0]+fF8[2]-fF8[1]-fF8[3]);
   if (f0>=0. && fF8[0]>=0.) goto L100;
   if (f0<0. && fF8[0]<0.) goto L100;
   ntria = 2;
   MarchingCubeSetTriangles(ntria, it1, itria);
   return;

   //  N O T   S E P A R A T E D   F R O N T   F A C E
L100:
   ntria = 4;
   MarchingCubeSetTriangles(ntria, it2, itria);
}


//______________________________________________________________________________
void TPainter3dAlgorithms::MarchingCubeCase04(Int_t &nnod, Int_t &ntria,
                               Double_t xyz[52][3], Double_t grad[52][3], Int_t itria[48][3])
{
   // Consider case No 4
   //
   // Input: see common HCMCUB
   //
   // Output: the same as for IHMCUB

   Int_t irep;
   static Int_t ie[6]     = { 4,9,1, 7,11,6 };
   static Int_t it1[2][3] = { { 1,2,3 }, { 4,5,6 } };
   static Int_t it2[6][3] = { { 1,2,4 }, { 2,3,6 }, { 3,1,5 },
                              { 4,5,1 }, { 5,6,3 }, { 6,4,2 } };

   //  S E T   N O D E S   &   N O R M A L E S
   nnod = 6;
   MarchingCubeFindNodes(nnod, ie, xyz, grad);

   //  I S   T H E R E   S U R F A C E   P E N E T R A T I O N ?
   MarchingCubeSurfacePenetration(fF8[0], fF8[1], fF8[2], fF8[3],
                                  fF8[4], fF8[5], fF8[6], fF8[7], irep);
   if (irep == 0) {
      ntria = 2;
      MarchingCubeSetTriangles(ntria, it1, itria);
   } else {
      ntria = 6;
      MarchingCubeSetTriangles(ntria, it2, itria);
   }
}


//______________________________________________________________________________
void TPainter3dAlgorithms::MarchingCubeCase06(Int_t &nnod, Int_t &ntria,
                               Double_t xyz[52][3], Double_t grad[52][3], Int_t itria[48][3])
{
   // Consider case No 6
   //
   // Input: see common HCMCUB
   //
   // Output: the same as for IHMCUB

   Double_t f0;
   Int_t irep;

   static Int_t ie[7]     = { 2,4,9,10, 6,7,11 };
   static Int_t it1[5][3] = { { 6,7,-1 }, { -6,1,2 }, { 6,2,3 }, { 6,3,-4 }, { -6,4,5 } };
   static Int_t it2[3][3] = { { 1,2,-3 }, { -1,3,4 }, { 5,6,7 } };
   static Int_t it3[7][3] = { { 6,7,-1 }, { -6,1,2 }, { 6,2,3 }, { 6,3,-4 }, { -6,4,5 },
                              { 1,7,-5 }, { -1,5,4 } };

   //  S E T   N O D E S   &   N O R M A L E S
   nnod = 7;
   MarchingCubeFindNodes(nnod, ie, xyz, grad);

   //  F I N D   C O N F I G U R A T I O N
   f0 = (fF8[1]*fF8[6]-fF8[5]*fF8[2]) / (fF8[1]+fF8[6]-fF8[5]-fF8[2]);
   if (f0>=0. && fF8[1]>=0.) goto L100;
   if (f0<0. && fF8[1]<0.) goto L100;

   //  I S   T H E R E   S U R F A C E   P E N E T R A T I O N ?
   MarchingCubeSurfacePenetration(fF8[2], fF8[1], fF8[5], fF8[6],
                                  fF8[3], fF8[0], fF8[4], fF8[7], irep);
   if (irep == 1) {
      ntria = 7;
      MarchingCubeSetTriangles(ntria, it3, itria);
   } else {
      ntria = 3;
      MarchingCubeSetTriangles(ntria, it2, itria);
   }
   return;

   //  N O T   S E P A R A T E D   R I G H T   F A C E
L100:
   ntria = 5;
   MarchingCubeSetTriangles(ntria, it1, itria);
}


//______________________________________________________________________________
void TPainter3dAlgorithms::MarchingCubeCase07(Int_t &nnod, Int_t &ntria,
                               Double_t xyz[52][3], Double_t grad[52][3],
                               Int_t itria[48][3])
{
   // Consider case No 7
   //
   // Input: see common HCMCUB
   //
   // Output: the same as for IHMCUB

   Double_t f1, f2, f3;
   Int_t icase, irep;
   static Int_t ie[9] = { 3,12,4, 1,10,2, 11,6,7 };
   static Int_t it[9][9][3] = {
   {{  1,2,3}, {  4,5,6}, {  7,8,9}, {  0,0,0}, {  0,0,0}, {  0,0,0}, {  0,0,0}, {  0,0,0}, {  0,0,0}},
   {{  1,2,3}, { 4,9,-7}, { -4,7,6}, { 9,4,-5}, { -9,5,8}, {  0,0,0}, {  0,0,0}, {  0,0,0}, {  0,0,0}},
   {{  4,5,6}, { 8,3,-1}, { -8,1,7}, { 3,8,-9}, { -3,9,2}, {  0,0,0}, {  0,0,0}, {  0,0,0}, {  0,0,0}},
   {{-10,2,3}, {10,3,-1}, {-10,1,7}, {10,7,-6}, {-10,6,4}, {10,4,-5}, {-10,5,8}, { 10,8,9}, {10,9,-2}},
   {{  7,8,9}, { 2,5,-6}, { -2,6,1}, { 5,2,-3}, { -5,3,4}, {  0,0,0}, {  0,0,0}, {  0,0,0}, {  0,0,0}},
   {{-10,1,2}, {10,2,-3}, {-10,3,4}, { 10,4,5}, {10,5,-8}, {-10,8,9}, {10,9,-7}, {-10,7,6}, {10,6,-1}},
   {{ 10,2,3}, {10,3,-4}, {-10,4,5}, {10,5,-6}, {-10,6,1}, {10,1,-7}, {-10,7,8}, {10,8,-9}, {-10,9,2}},
   {{  1,7,6}, { -4,2,3}, {-4,9,-2}, {-9,4,-5}, { -9,5,8}, {  0,0,0}, {  0,0,0}, {  0,0,0}, {  0,0,0}},
   {{ -1,9,2}, {  1,2,3}, { 1,3,-4}, { 6,-1,4}, {  6,4,5}, { 6,-5,7}, { -7,5,8}, {  7,8,9}, { 7,-9,1}}
   };

   Int_t it2[9][3], i, j;

   //  S E T   N O D E S   &   N O R M A L E S
   nnod = 9;
   MarchingCubeFindNodes(nnod, ie, xyz, grad);

   //  F I N D   C O N F I G U R A T I O N
   f1 = (fF8[2]*fF8[5]-fF8[1]*fF8[6]) / (fF8[2]+fF8[5]-fF8[1]-fF8[6]);
   f2 = (fF8[2]*fF8[7]-fF8[3]*fF8[6]) / (fF8[2]+fF8[7]-fF8[3]-fF8[6]);
   f3 = (fF8[2]*fF8[0]-fF8[1]*fF8[3]) / (fF8[2]+fF8[0]-fF8[1]-fF8[3]);
   icase = 1;
   if (f1>=0. && fF8[2] <0.) icase = icase + 1;
   if (f1 <0. && fF8[2]>=0.) icase = icase + 1;
   if (f2>=0. && fF8[2] <0.) icase = icase + 2;
   if (f2 <0. && fF8[2]>=0.) icase = icase + 2;
   if (f3>=0. && fF8[2] <0.) icase = icase + 4;
   if (f3 <0. && fF8[2]>=0.) icase = icase + 4;
   ntria = 5;

   switch ((int)icase) {
      case 1:  goto L100;
      case 2:  goto L400;
      case 3:  goto L400;
      case 4:  goto L200;
      case 5:  goto L400;
      case 6:  goto L200;
      case 7:  goto L200;
      case 8:  goto L300;
   }

L100:
   ntria = 3;
   goto L400;

   //  F I N D   A D D I T I O N A L   P O I N T
L200:
   nnod  = 10;
   ntria = 9;

   // Copy "it" into a 2D matrix to be passed to MarchingCubeMiddlePoint
   for ( i=0; i<3 ; i++) {
      for ( j=0; j<9 ; j++) {
         it2[j][i] = it[icase-1][j][i];
      }
   }
   MarchingCubeMiddlePoint(9, xyz, grad, it2, &xyz[nnod-1][0], &grad[nnod-1][0]);
   goto L400;

   //  I S   T H E R E   S U R F A C E   P E N E T R A T I O N ?
L300:
   MarchingCubeSurfacePenetration(fF8[3], fF8[2], fF8[6], fF8[7],
                                  fF8[0], fF8[1], fF8[5], fF8[4], irep);
   if (irep != 2) goto L400;
   ntria = 9;
   icase = 9;

   //  S E T   T R I A N G L E S
L400:
   // Copy "it" into a 2D matrix to be passed to MarchingCubeSetTriangles
   for ( i=0; i<3 ; i++) {
      for ( j=0; j<9 ; j++) {
         it2[j][i] = it[icase-1][j][i];
      }
   }
   MarchingCubeSetTriangles(ntria, it2, itria);
}


//______________________________________________________________________________
void TPainter3dAlgorithms::MarchingCubeCase10(Int_t &nnod, Int_t &ntria,
                               Double_t xyz[52][3], Double_t grad[52][3], Int_t itria[48][3])
{
   // Consider case No 10
   //
   // Input: see common HCMCUB
   //
   // Output: the same as for IHMCUB

   Double_t f1, f2;
   Int_t icase, irep;
   static Int_t ie[8] = { 1,3,12,9, 5,7,11,10 };
   static Int_t it[6][8][3] = {
   {{1,2,-3}, {-1,3,4}, {5,6,-7}, {-5,7,8}, { 0,0,0}, { 0,0,0}, { 0,0,0}, { 0,0,0}},
   {{ 9,1,2}, { 9,2,3}, { 9,3,4}, { 9,4,5}, { 9,5,6}, { 9,6,7}, { 9,7,8}, { 9,8,1}},
   {{ 9,1,2}, { 9,4,1}, { 9,3,4}, { 9,6,3}, { 9,5,6}, { 9,8,5}, { 9,7,8}, { 9,2,7}},
   {{1,2,-7}, {-1,7,8}, {5,6,-3}, {-5,3,4}, { 0,0,0}, { 0,0,0}, { 0,0,0}, { 0,0,0}},
   {{1,2,-7}, {-1,7,8}, {2,3,-6}, {-2,6,7}, {3,4,-5}, {-3,5,6}, {4,1,-8}, {-4,8,5}},
   {{1,2,-3}, {-1,3,4}, {2,7,-6}, {-2,6,3}, {7,8,-5}, {-7,5,6}, {8,1,-4}, {-8,4,5}}
   };
   Int_t it2[8][3], i, j;

   //  S E T   N O D E S   &   N O R M A L E S
   nnod = 8;
   MarchingCubeFindNodes(nnod, ie, xyz, grad);

   //  F I N D   C O N F I G U R A T I O N
   f1 = (fF8[0]*fF8[5]-fF8[1]*fF8[4]) / (fF8[0]+fF8[5]-fF8[1]-fF8[4]);
   f2 = (fF8[3]*fF8[6]-fF8[2]*fF8[7]) / (fF8[3]+fF8[6]-fF8[2]-fF8[5]);
   icase = 1;
   if (f1 >= 0.) icase = icase + 1;
   if (f2 >= 0.) icase = icase + 2;
   if (icase==1 || icase==4) goto L100;

   // D I F F E R E N T    T O P   A N D   B O T T O M
   nnod  = 9;
   ntria = 8;
   // Copy "it" into a 2D matrix to be passed to MarchingCubeMiddlePoint
   for ( i=0; i<3 ; i++) {
      for ( j=0; j<8 ; j++) {
         it2[j][i] = it[icase-1][j][i];
      }
   }
   MarchingCubeMiddlePoint(8, xyz, grad, it2, &xyz[nnod-1][0], &grad[nnod-1][0]);
   goto L200;

   //  I S   T H E R E   S U R F A C E   P E N E T R A T I O N ?
L100:
   MarchingCubeSurfacePenetration(fF8[0], fF8[1], fF8[5], fF8[4],
                                  fF8[3], fF8[2], fF8[6], fF8[7], irep);
   ntria = 4;
   if (irep == 0) goto L200;
   //  "B O T T L E   N E C K"
   ntria = 8;
   if (icase == 1) icase = 5;
   if (icase == 4) icase = 6;

   //  S E T   T R I A N G L E S
L200:
   // Copy "it" into a 2D matrix to be passed to MarchingCubeSetTriangles
   for ( i=0; i<3 ; i++) {
      for ( j=0; j<8 ; j++) {
         it2[j][i] = it[icase-1][j][i];
      }
   }
   MarchingCubeSetTriangles(ntria, it2, itria);
}


//______________________________________________________________________________
void TPainter3dAlgorithms::MarchingCubeCase12(Int_t &nnod, Int_t &ntria,
                               Double_t xyz[52][3], Double_t grad[52][3], Int_t itria[48][3])
{
   // Consider case No 12
   //
   // Input: see common HCMCUB
   //
   // Output: the same as for IHMCUB

   Double_t f1, f2;
   Int_t icase, irep;
   static Int_t ie[8] = { 3,12,4, 1,9,8,6,2 };
   static Int_t it[6][8][3] = {
   {{ 1,2,3},  {4,5,-6}, {-4,6,8}, { 6,7,8}, { 0,0,0}, { 0,0,0}, { 0,0,0}, { 0,0,0}},
   {{-9,1,2},  {9,2,-3}, {-9,3,4}, {9,4,-5}, {-9,5,6}, {9,6,-7}, {-9,7,8}, {9,8,-1}},
   {{9,1,-2},  {-9,2,6}, {9,6,-7}, {-9,7,8}, {9,8,-4}, {-9,4,5}, {9,5,-3}, {-9,3,1}},
   {{ 3,4,5},  {1,2,-6}, {-1,6,8}, { 6,7,8}, { 0,0,0}, { 0,0,0}, { 0,0,0}, { 0,0,0}},
   {{ 7,8,6},  {6,8,-1}, {-6,1,2}, {3,1,-8}, {-3,8,4}, { 3,4,5}, {3,5,-6}, {-3,6,2}},
   {{ 7,8,6},  {6,8,-4}, {-6,4,5}, {3,4,-8}, {-3,8,1}, { 3,1,2}, {3,2,-6}, {-3,6,5}}
   };
   Int_t it2[8][3], i, j;

   //  S E T   N O D E S   &   N O R M A L E S
   nnod = 8;
   MarchingCubeFindNodes(nnod, ie, xyz, grad);

   //  F I N D   C O N F I G U R A T I O N
   f1 = (fF8[0]*fF8[2]-fF8[1]*fF8[3]) / (fF8[0]+fF8[2]-fF8[1]-fF8[3]);
   f2 = (fF8[0]*fF8[7]-fF8[3]*fF8[4]) / (fF8[0]+fF8[7]-fF8[3]-fF8[4]);
   icase = 1;
   if (f1 >= 0.) icase = icase + 1;
   if (f2 >= 0.) icase = icase + 2;
   if (icase==1 || icase==4) goto L100;

   //  F I N D   A D D I T I O N A L   P O I N T
   nnod  = 9;
   ntria = 8;
   // Copy "it" into a 2D matrix to be passed to MarchingCubeMiddlePoint
   for ( i=0; i<3 ; i++) {
      for ( j=0; j<8 ; j++) {
         it2[j][i] = it[icase-1][j][i];
      }
   }
   MarchingCubeMiddlePoint(8, xyz, grad, it2, &xyz[nnod-1][0], &grad[nnod-1][0]);
   goto L200;

   //  I S   T H E R E   S U R F A C E   P E N E T R A T I O N ?
L100:
   MarchingCubeSurfacePenetration(fF8[0], fF8[1], fF8[2], fF8[3],
                                  fF8[4], fF8[5], fF8[6], fF8[7], irep);
   ntria = 4;
   if (irep != 1) goto L200;
   //  "B O T T L E   N E C K"
   ntria = 8;
   if (icase == 1) icase = 5;
   if (icase == 4) icase = 6;

   //  S E T   T R I A N G L E S
L200:
   // Copy "it" into a 2D matrix to be passed to MarchingCubeSetTriangles
   for ( i=0; i<3 ; i++) {
      for ( j=0; j<8 ; j++) {
         it2[j][i] = it[icase-1][j][i];
      }
   }
   MarchingCubeSetTriangles(ntria, it2, itria);
}


//______________________________________________________________________________
void TPainter3dAlgorithms::MarchingCubeCase13(Int_t &nnod, Int_t &ntria,
                               Double_t xyz[52][3], Double_t grad[52][3], Int_t itria[48][3])
{
   // Consider case No 13
   //
   // Input: see common HCMCUB
   //
   // Output: the same as for IHMCUB

   Double_t ff[8];
   Double_t f1, f2, f3, f4;
   Int_t nr, nf, i, k, incr, n, kr, icase, irep;
   static Int_t irota[12][8] = {
         {1,2,3,4,5,6,7,8}, {1,5,6,2,4,8,7,3}, {1,4,8,5,2,3,7,6},
         {3,7,8,4,2,6,5,1}, {3,2,6,7,4,1,5,8}, {3,4,1,2,7,8,5,6},
         {6,7,3,2,5,8,4,1}, {6,5,8,7,2,1,4,3}, {6,2,1,5,7,3,4,8},
         {8,4,3,7,5,1,2,6}, {8,5,1,4,7,6,2,3}, {8,7,6,5,4,3,2,1} };
   static Int_t iwhat[8] = { 63,62,54,26,50,9,1,0 };
   static Int_t ie[12] = { 1,2,3,4,5,6,7,8,9,10,11,12 };
   static Int_t iface[6][4] = {
         {1,2,3,4}, {5,6,7,8}, {1,2,6,5}, {2,6,7,3}, {4,3,7,8}, {1,5,8,4} };
   static Int_t it1[4][3] = { {1,2,10}, {9,5,8}, {6,11,7}, {3,4,12} };
   static Int_t it2[4][3] = { {5,6,10}, {1,4,9}, {2,11,3}, {7,8,12} };
   static Int_t it3[6][3] = { {10,12,-3}, {-10,3,2}, {12,10,-1}, {-12,1,4},
         {9,5,8}, {6,11,7} };
   static Int_t it4[6][3] = { {11,9,-1}, {-11,1,2}, {9,11,-3}, {-9,3,4},
         {5,6,10}, {7,8,12} };
   static Int_t it5[10][3] = { {13,2,-11}, {-13,11,7}, {13,7,-6}, {-13,6,10},
         {13,10,1}, {13,1,-4}, {-13,4,12}, {13,12,-3}, {-13,3,2}, {5,8,9} };
   static Int_t it6[10][3] = { {13,2,-10}, {-13,10,5}, {13,5,-6}, {-13,6,11},
         {13,11,3}, {13,3,-4}, {-13,4,9}, {13,9,-1}, {-13,1,2}, {12,7,8} };
   static Int_t it7[12][3] = { {13,2,-11}, {-13,11,7}, {13,7,-6}, {-13,6,10},
         {13,10,-5}, {-13,5,8}, {13,8,-9}, {-13,9,1},
         {13,1,-4}, {-13,4,12}, {13,12,-3}, {-13,3,2} };
   static Int_t it8[6][3] = { {3,8,12}, {3,-2,-8}, {-2,5,-8}, {2,10,-5},
         {7,6,11}, {1,4,9} };
   static Int_t it9[10][3] = { {7,12,-3}, {-7,3,11}, {11,3,2}, {6,11,-2}, {-6,2,10},
         {6,10,5}, {7,6,-5}, {-7,5,8}, {7,8,12}, {1,4,9} };
   static Int_t it10[10][3] = { {9,1,-10}, {-9,10,5}, {9,5,8}, {4,9,-8}, {-4,8,12},
         {4,12,3}, {1,4,-3}, {-1,3,2}, {1,2,10}, {7,6,11} };

      nnod = 0;
      ntria = 0;

   // F I N D   C O N F I G U R A T I O N   T Y P E
   for ( nr=1 ; nr<=12 ; nr++ ) {
      k = 0;
      incr = 1;
      for ( nf=1 ; nf<=6 ; nf++ ) {
         f1 = fF8[irota[nr-1][iface[nf-1][0]-1]-1];
         f2 = fF8[irota[nr-1][iface[nf-1][1]-1]-1];
         f3 = fF8[irota[nr-1][iface[nf-1][2]-1]-1];
         f4 = fF8[irota[nr-1][iface[nf-1][3]-1]-1];
         if ((f1*f3-f2*f4)/(f1+f3-f2-f4) >= 0.) k = k + incr;
         incr = incr + incr;
      }
      for ( i=1 ; i<=8 ; i++ ) {
         if (k != iwhat[i-1]) continue;
         icase = i;
         kr = nr;
         goto L200;
      }
   }
   Error("MarchingCubeCase13", "configuration is not found");
   return;

   //  R O T A T E   C U B E
L200:
   if (icase==1 || icase==8) goto L300;
   for ( n=1 ; n<=8 ; n++) {
      k = irota[kr-1][n-1];
      ff[n-1] = fF8[k-1];
      for ( i=1 ; i<=3 ; i++ ) {
         xyz[n-1][i-1] = fP8[k-1][i-1];
         grad[n-1][i-1] = fG8[k-1][i-1];
      }
   }
   for ( n=1 ; n<=8 ; n++ ) {
      fF8[n-1] = ff[n-1];
      for ( i=1 ; i<=3 ; i++ ) {
         fP8[n-1][i-1] = xyz[n-1][i-1];
         fG8[n-1][i-1] = grad[n-1][i-1];
      }
   }

   //  S E T   N O D E S   &   N O R M A L E S
L300:
   nnod = 12;
   MarchingCubeFindNodes(nnod, ie, xyz, grad);

   //  V A R I O U S   C O N F I G U R A T I O N S
   switch ((int)icase) {
      case 1:
         ntria = 4;
         MarchingCubeSetTriangles(ntria, it1, itria);
         return;
      case 8:
         ntria = 4;
         MarchingCubeSetTriangles(ntria, it2, itria);
         return;
      case 2:
         ntria = 6;
         MarchingCubeSetTriangles(ntria, it3, itria);
         return;
      case 7:
         ntria = 6;
         MarchingCubeSetTriangles(ntria, it4, itria);
         return;
      case 3:
         nnod = 13;
         ntria = 10;
         MarchingCubeMiddlePoint(9, xyz, grad, it5,
                                 &xyz[nnod-1][0], &grad[nnod-1][0]);
         MarchingCubeSetTriangles(ntria, it5, itria);
         return;
      case 6:
         nnod = 13;
         ntria = 10;
         MarchingCubeMiddlePoint(9, xyz, grad, it6,
                                 &xyz[nnod-1][0], &grad[nnod-1][0]);
         MarchingCubeSetTriangles(ntria, it6, itria);
         return;
      case 5:
         nnod = 13;
         ntria = 12;
         MarchingCubeMiddlePoint(12, xyz, grad, it7,
                                 &xyz[nnod-1][0], &grad[nnod-1][0]);
         MarchingCubeSetTriangles(ntria, it7, itria);
         return;
      //  I S   T H E R E   S U R F A C E   P E N E T R A T I O N ?
      case 4:
         MarchingCubeSurfacePenetration(fF8[2], fF8[3], fF8[0], fF8[1],
                                        fF8[6], fF8[7], fF8[4], fF8[5], irep);
         switch ((int)(irep+1)) {
            case 1:
               ntria = 6;
               MarchingCubeSetTriangles(ntria, it8, itria);
               return;
            case 2:
               ntria = 10;
               MarchingCubeSetTriangles(ntria, it9, itria);
               return;
            case 3:
               ntria = 10;
               MarchingCubeSetTriangles(ntria, it10, itria);
         }
   }
}


//______________________________________________________________________________
void TPainter3dAlgorithms::MarchingCubeSetTriangles(Int_t ntria, Int_t it[][3],
                                                    Int_t itria[48][3])
{
   // Set triangles (if parameter IALL=1, all edges will be visible)
   //
   // Input: NTRIA   - number of triangles
   //        IT(3,*) - triangles
   //
   // Output: ITRIA(3,*) - triangles

   Int_t n, i, k;

   for ( n=1 ; n<=ntria ; n++ ) {
      for ( i=1 ; i<=3 ; i++ ) {
         k = it[n-1][i-1];
         itria[n-1][i-1] = k;
      }
   }
}


//______________________________________________________________________________
void TPainter3dAlgorithms::MarchingCubeMiddlePoint(Int_t nnod, Double_t xyz[52][3],
                                    Double_t grad[52][3],
                                    Int_t it[][3], Double_t *pxyz,
                                    Double_t *pgrad)
{
   // Find middle point of a polygon
   //
   // Input: NNOD      - number of nodes in the polygon
   //        XYZ(3,*)  - node coordinates
   //        GRAD(3,*) - node normales
   //        IT(3,*)   - division of the polygons into triangles
   //
   // Output: PXYZ(3)  - middle point coordinates
   //         PGRAD(3) - middle point normale

   Double_t p[3], g[3];
   Int_t i, n, k;

   for ( i=1 ; i<=3 ; i++ ) {
      p[i-1] = 0.;
      g[i-1] = 0.;
   }
   for ( n=1 ; n<=nnod ; n++ ) {
      k = it[n-1][2];
      if (k < 0) k =-k;
      for ( i=1 ; i<=3 ; i++ ) {
         p[i-1] = p[i-1] + xyz[k-1][i-1];
         g[i-1] = g[i-1] + grad[k-1][i-1];
      }
   }
   for ( i=1 ; i<=3 ; i++ ) {
      pxyz[i-1] = p[i-1] / nnod;
      pgrad[i-1] = g[i-1] / nnod;
   }
}


//______________________________________________________________________________
void TPainter3dAlgorithms::MarchingCubeSurfacePenetration(Double_t a00, Double_t a10,
                                           Double_t a11, Double_t a01,
                                           Double_t b00, Double_t b10,
                                           Double_t b11, Double_t b01,
                                           Int_t &irep)
{
   // Check for surface penetration ("bottle neck")
   //
   // Input: A00,A10,A11,A01 - vertex values for 1st face
   //        B00,B10,B11,B01 - vertex values for opposite face
   //
   // Output: IREP - 1,2 - there is surface penetration
   //                0   - there is not surface penetration

   Double_t a, b, c, d, s0, s1, s2;
   Int_t iposa, iposb;

   irep = 0;
   a = (a11-a01)*(b00-b10) - (a00-a10)*(b11-b01);
   if (a == 0.) return;
   b = a01*(b00-b10)-(a11-a01)*b00-(a00-a10)*b01+a00*(b11-b01);
   c = a00*b01 - a01*b00;
   d = b*b-4*a*c;
   if (d <= 0.) return;
   d = TMath::Sqrt(d);
   if (TMath::Abs(-b+d) > TMath::Abs(2*a)) return;
   s1 = (-b+d) / (2*a);
   if (s1<0. || s1>1.) return;
   if (TMath::Abs(-b-d) > TMath::Abs(2*a)) return;
   s2 = (-b-d) / (2*a);
   if (s2<0. || s2>1.) return;

   //  C A S E   N O   4 ?
   iposa = 0;
   if (a00 >= 0) iposa = iposa + 1;
   if (a01 >= 0) iposa = iposa + 2;
   if (a10 >= 0) iposa = iposa + 4;
   if (a11 >= 0) iposa = iposa + 8;
   if (iposa==6 || iposa==9) goto L100;
   irep = 1;
   return;

   //  N O T   C A S E   N O   4
L100:
   s0 = (a00-a01) / (a00+a11-a10-a01);
   if (s1>=s0 && s2<s0) return;
   if (s1<s0 && s2>=s0) return;
   irep = 1;
   if (s1 >= s0) irep = 2;

   //  C A S E S   N O   10, 13 ?
   iposb = 0;
   if (b00 >= 0) iposb = iposb + 1;
   if (b01 >= 0) iposb = iposb + 2;
   if (b10 >= 0) iposb = iposb + 4;
   if (b11 >= 0) iposb = iposb + 8;
   if (iposb!=6 && iposb!=9)  return;
   s0 = (b00-b01) / (b00+b11-b10-b01);
   if (iposa != iposb) goto L200;
   //  C A S E   N O   10
   if (irep==1 && s1>s0) return;
   if (irep==2 && s1<s0) return;
   irep = 0;
   return;
   //  C A S E   N O   13
L200:
   if (irep==1 && s1<s0) return;
   if (irep==2 && s1>s0) return;
   irep = 0;
}


//______________________________________________________________________________
void TPainter3dAlgorithms::MarchingCubeFindNodes(Int_t nnod,
                                  Int_t *ie, Double_t xyz[52][3],
                                  Double_t grad[52][3])
{
   // Find nodes and normales
   //
   // Input: NNOD  - number of nodes
   //        IE(*) - edges which have section node
   //
   // Output: XYZ(3,*)  - nodes
   //         GRAD(3,*) - node normales (not normalized)

   Int_t n, k, i, n1, n2;
   Double_t t;
   static Int_t iedge[12][2] = {
         {1,2}, {2,3}, {3,4}, {4,1}, {5,6}, {6,7}, {7,8}, {8,5}, {1,5}, {2,6}, {3,7}, {4,8} };

   for ( n=1 ; n<=nnod ; n++ ) {
      k = ie[n-1];
      if (k < 0) k =-k;
      n1 = iedge[k-1][0];
      n2 = iedge[k-1][1];
      t = fF8[n1-1] / (fF8[n1-1]-fF8[n2-1]);
      for ( i=1 ; i<=3 ; i++ ) {
         xyz[n-1][i-1] = (fP8[n2-1][i-1]-fP8[n1-1][i-1])*t + fP8[n1-1][i-1];
         grad[n-1][i-1] = (fG8[n2-1][i-1]-fG8[n1-1][i-1])*t + fG8[n1-1][i-1];
      }
   }
}


//______________________________________________________________________________
void TPainter3dAlgorithms::ZDepth(Double_t xyz[52][3], Int_t &nface,
                                  Int_t iface[48][3], Double_t dface[48][6],
                                  Double_t abcd[48][4], Int_t *iorder)
{
   // Z-depth algorithm for set of triangles
   //
   // Input: XYZ(3,*)   - nodes
   //        NFACE      - number of triangular faces
   //        IFACE(3,*) - faces (triangles)
   //
   // Arrays: DFACE(6,*) - array for min-max scopes
   //         ABCD(4,*)  - array for face plane equations
   //
   // Output: IORDER(*) - face order

   Int_t n, nf, i1, i2, i3, i, icur, k, itst, kface, kf, irep;
   Int_t nn[3], kk[3];
   Double_t wmin, wmax, a, b, c, q, zcur;
   Double_t v[2][3], abcdn[4], abcdk[4];

   //  S E T   I N I T I A L   O R D E R
   //  I G N O R E   V E R Y   S M A L L   F A C E S
   //  S E T   M I N - M A X   S C O P E S
   //  S E T   F A C E   P L A N E   E Q U A T I O N S
   nf = 0;
   for ( n=1 ; n<=nface ; n++ ) {
      i1 = TMath::Abs(iface[n-1][0]);
      i2 = TMath::Abs(iface[n-1][1]);
      i3 = TMath::Abs(iface[n-1][2]);
   //       A R E A   T E S T
      if (TMath::Abs(xyz[i2-1][0]-xyz[i1-1][0])<=kDel &&
          TMath::Abs(xyz[i2-1][1]-xyz[i1-1][1])<=kDel &&
          TMath::Abs(xyz[i2-1][2]-xyz[i1-1][2])<=kDel) continue;
      if (TMath::Abs(xyz[i3-1][0]-xyz[i2-1][0])<=kDel &&
          TMath::Abs(xyz[i3-1][1]-xyz[i2-1][1])<=kDel &&
          TMath::Abs(xyz[i3-1][2]-xyz[i2-1][2])<=kDel) continue;
      if (TMath::Abs(xyz[i1-1][0]-xyz[i3-1][0])<=kDel &&
          TMath::Abs(xyz[i1-1][1]-xyz[i3-1][1])<=kDel &&
          TMath::Abs(xyz[i1-1][2]-xyz[i3-1][2])<=kDel) continue;
   //       P R O J E C T I O N   T E S T
      if (TMath::Abs(xyz[i2-1][0]-xyz[i1-1][0])<=kDel &&
          TMath::Abs(xyz[i2-1][1]-xyz[i1-1][1])<=kDel &&
          TMath::Abs(xyz[i3-1][0]-xyz[i2-1][0])<=kDel &&
          TMath::Abs(xyz[i3-1][1]-xyz[i2-1][1])<=kDel &&
          TMath::Abs(xyz[i1-1][0]-xyz[i3-1][0])<=kDel &&
          TMath::Abs(xyz[i1-1][1]-xyz[i3-1][1])<=kDel) continue;
      nf = nf + 1;
      iorder[nf-1] = n;
   //       F I N D   M I N - M A X
      for ( i=1 ; i<=3 ; i++ ) {
         wmin = xyz[i1-1][i-1];
         wmax = xyz[i1-1][i-1];
         if (wmin > xyz[i2-1][i-1]) wmin = xyz[i2-1][i-1];
         if (wmax < xyz[i2-1][i-1]) wmax = xyz[i2-1][i-1];
         if (wmin > xyz[i3-1][i-1]) wmin = xyz[i3-1][i-1];
         if (wmax < xyz[i3-1][i-1]) wmax = xyz[i3-1][i-1];
         dface[n-1][i-1] = wmin;
         dface[n-1][i+2] = wmax;
      }
   //      F I N D   F A C E   E Q U A T I O N
      for ( i=1 ; i<=3 ; i++ ) {
         v[0][i-1] = xyz[i2-1][i-1] - xyz[i1-1][i-1];
         v[1][i-1] = xyz[i3-1][i-1] - xyz[i2-1][i-1];
      }
      a = (v[0][1]*v[1][2] - v[0][2]*v[1][1]);
      b = (v[0][2]*v[1][0] - v[0][0]*v[1][2]);
      c = (v[0][0]*v[1][1] - v[0][1]*v[1][0]);
      q = TMath::Sqrt(a*a+b*b+c*c);
      if (c < 0.) q =-q;
      a = a / q;
      b = b / q;
      c = c / q;
      abcd[n-1][0] = a;
      abcd[n-1][1] = b;
      abcd[n-1][2] = c;
      abcd[n-1][3] =-(a*xyz[i1-1][0] + b*xyz[i1-1][1] + c*xyz[i1-1][2]);
   }
   nface = nf;
   if (nf <= 1) return;

   //  S O R T   T R I A N G L E S   A L O N G   Z - M I N
   for ( icur=2 ; icur<=nface ; icur++ ) {
      k = iorder[icur-1];
      zcur = dface[k-1][2];
      for ( itst=icur-1 ; itst>=1 ; itst-- ) {
         k = iorder[itst-1];
         if (zcur < dface[k-1][2]) break;
         k = iorder[itst-1];
         iorder[itst-1] = iorder[itst];
         iorder[itst] = k;
      }
   }

   //  Z - D E P T H   A L G O R I T H M
   kface  = nface;
L300:
   if (kface == 1) goto L900;
   nf = iorder[kface-1];
   if (nf < 0) nf =-nf;
   abcdn[0] = abcd[nf-1][0];
   abcdn[1] = abcd[nf-1][1];
   abcdn[2] = abcd[nf-1][2];
   abcdn[3] = abcd[nf-1][3];
   nn[0] = TMath::Abs(iface[nf-1][0]);
   nn[1] = TMath::Abs(iface[nf-1][1]);
   nn[2] = TMath::Abs(iface[nf-1][2]);

   //  I N T E R N A L   L O O P
   for ( k=kface-1 ; k>=1 ; k-- ) {
      kf = iorder[k-1];
      if (kf < 0) kf =-kf;
      if (dface[nf-1][5] > dface[kf-1][2]+kDel) goto L400;
      if (iorder[k-1] > 0) goto L900;
      goto L800;

   //  M I N - M A X   T E S T
L400:
      if (dface[kf-1][0] >= dface[nf-1][3]-kDel) goto L800;
      if (dface[kf-1][3] <= dface[nf-1][0]+kDel) goto L800;
      if (dface[kf-1][1] >= dface[nf-1][4]-kDel) goto L800;
      if (dface[kf-1][4] <= dface[nf-1][1]+kDel) goto L800;

   //  K F   B E F O R E   N F ?
      kk[0] = TMath::Abs(iface[kf-1][0]);
      kk[1] = TMath::Abs(iface[kf-1][1]);
      kk[2] = TMath::Abs(iface[kf-1][2]);
      if (abcdn[0]*xyz[kk[0]-1][0]+abcdn[1]*xyz[kk[0]-1][1]+
          abcdn[2]*xyz[kk[0]-1][2]+abcdn[3] < -kDel) goto L500;
      if (abcdn[0]*xyz[kk[1]-1][0]+abcdn[1]*xyz[kk[1]-1][1]+
          abcdn[2]*xyz[kk[1]-1][2]+abcdn[3] < -kDel) goto L500;
      if (abcdn[0]*xyz[kk[2]-1][0]+abcdn[1]*xyz[kk[2]-1][1]+
          abcdn[2]*xyz[kk[2]-1][2]+abcdn[3] < -kDel) goto L500;
      goto L800;

   //  N F    A F T E R    K F ?
L500:
      abcdk[0] = abcd[kf-1][0];
      abcdk[1] = abcd[kf-1][1];
      abcdk[2] = abcd[kf-1][2];
      abcdk[3] = abcd[kf-1][3];
      if (abcdk[0]*xyz[nn[0]-1][0]+abcdk[1]*xyz[nn[0]-1][1]+
          abcdk[2]*xyz[nn[0]-1][2]+abcdk[3] > kDel) goto L600;
      if (abcdk[0]*xyz[nn[1]-1][0]+abcdk[1]*xyz[nn[1]-1][1]+
          abcdk[2]*xyz[nn[1]-1][2]+abcdk[3] > kDel) goto L600;
      if (abcdk[0]*xyz[nn[2]-1][0]+abcdk[1]*xyz[nn[2]-1][1]+
          abcdk[2]*xyz[nn[2]-1][2]+abcdk[3] > kDel) goto L600;
      goto L800;

   //  E D G E   B Y   E D G E   T E S T
   //  K F - E D G E S   A G A I N S T   N F
L600:
      for ( i=1 ; i<=3 ; i++ ) {
         i1 = kk[i-1];
         i2 = kk[0];
         if (i != 3) i2 = kk[i];
         TestEdge(kDel, xyz, i1, i2, nn, abcdn, irep);
         if ( irep<0 ) goto L700;
         if ( irep==0 ) continue;
         if ( irep>0 ) goto L800;
      }
   //  N F - E D G E S   A G A I N S T   K F
      for ( i=1 ; i<=3 ; i++ ) {
         i1 = nn[i-1];
         i2 = nn[0];
         if (i != 3) i2 = nn[i];
         TestEdge(kDel, xyz, i1, i2, kk, abcdk, irep);
         if ( irep<0 ) goto L800;
         if ( irep==0 ) continue;
         if ( irep>0 ) goto L700;
      }
      goto L800;

   //  C H A N G E   F A C E   O R D E R
L700:
      kf = iorder[k-1];
      for ( i=k+1 ; i<=kface ; i++ ) {
         iorder[i-2] = iorder[i-1];
      }
      iorder[kface-1] =-kf;
      if (kf > 0) goto L300;
      goto L900;
L800:
      continue;
   }

   //  N E X T   F A C E
L900:
   if (iorder[kface-1] < 0) iorder[kface-1] =-iorder[kface-1];
   kface = kface - 1;
   if (kface > 0) goto L300;
}


//______________________________________________________________________________
void TPainter3dAlgorithms::TestEdge(Double_t del, Double_t xyz[52][3], Int_t i1, Int_t i2,
                     Int_t iface[3], Double_t abcd[4], Int_t &irep)
{
   // Test edge against face (triangle)
   //
   // Input: DEL      - precision
   //        XYZ(3,*) - nodes
   //        I1       - 1-st node of edge
   //        I2       - 2-nd node of edge
   //        IFACE(3) - triangular face
   //        ABCD(4)  - face plane
   //
   // Output: IREP:-1 - edge under face
   //               0 - no decision
   //              +1 - edge before face

   Int_t k, k1, k2, ixy, i;
   Double_t a, b, c, d1, d2, dd, xy, tmin, tmax, tmid, x, y, z;
   Double_t d[3], delta[3], t[2];

   irep  = 0;

   //  F I N D   I N T E R S E C T I O N   P O I N T S
   delta[0] = xyz[i2-1][0] - xyz[i1-1][0];
   delta[1] = xyz[i2-1][1] - xyz[i1-1][1];
   delta[2] = xyz[i2-1][2] - xyz[i1-1][2];
   if (TMath::Abs(delta[0])<=del && TMath::Abs(delta[1])<=del) return;
   ixy = 1;
   if (TMath::Abs(delta[1]) > TMath::Abs(delta[0])) ixy = 2;
   a = delta[1];
   b =-delta[0];
   c =-(a*xyz[i1-1][0] + b*xyz[i1-1][1]);
   d[0] = a*xyz[iface[0]-1][0] + b*xyz[iface[0]-1][1] + c;
   d[1] = a*xyz[iface[1]-1][0] + b*xyz[iface[1]-1][1] + c;
   d[2] = a*xyz[iface[2]-1][0] + b*xyz[iface[2]-1][1] + c;
   k = 0;
   for ( i=1 ; i<=3 ; i++ ) {
      k1 = i;
      k2 = i + 1;
      if (i == 3) k2 = 1;
      if (d[k1-1]>=0. && d[k2-1]>=0.) continue;
      if (d[k1-1] <0. && d[k2-1] <0.) continue;
      d1 = d[k1-1] / (d[k1-1] - d[k2-1]);
      d2 = d[k2-1] / (d[k1-1] - d[k2-1]);
      xy = d1*xyz[iface[k2-1]-1][ixy-1] - d2*xyz[iface[k1-1]-1][ixy-1];
      k = k + 1;
      t[k-1] = (xy-xyz[i1-1][ixy-1]) / delta[ixy-1];
      if (k == 2) goto L200;
   }
   return;

   //  C O M P A R E   Z - D E P T H
L200:
   tmin = TMath::Min(t[0],t[1]);
   tmax = TMath::Max(t[0],t[1]);
   if (tmin>1. || tmax<0) return;
   if (tmin < 0.) tmin = 0.;
   if (tmax > 1.) tmax = 1.;
   tmid = (tmin + tmax) / 2.;
   x = delta[0]*tmid + xyz[i1-1][0];
   y = delta[1]*tmid + xyz[i1-1][1];
   z = delta[2]*tmid + xyz[i1-1][2];
   dd = abcd[0]*x + abcd[1]*y + abcd[2]*z + abcd[3];
   if (dd > del) goto L997;
   if (dd <-del) goto L998;
   return;

L997:
   irep =+1;
   return;
L998:
   irep =-1;
}


//______________________________________________________________________________
void TPainter3dAlgorithms::IsoSurface (Int_t ns, Double_t *s, Int_t nx,
                                       Int_t ny, Int_t nz,
                                       Double_t *x, Double_t *y, Double_t *z,
                                       const char *chopt)
{
   // Draw set of isosurfaces for a scalar function defined on a grid.
   //
   //     Input: NS          - number of isosurfaces
   //            S(*)        - isosurface values
   //            NX          - number of slices along X
   //            NY          - number of slices along Y
   //            NZ          - number of slices along Z
   //            X(*)        - slices along X
   //            Y(*)        - slices along Y
   //            Z(*)        - slices along Z
   //            F(NX,NY,NZ) - function values <- Not used, current histo used instead
   //
   //            DRFACE(ICODES,XYZ,NP,IFACE,T) - routine for face drawing
   //              ICODES(1) - isosurface number
   //              ICODES(2) - isosurface number
   //              ICODES(3) - isosurface number
   //              NP        - number of nodes in face
   //              IFACE(NP) - face
   //              T(NP)     - additional function (lightness)
   //
   //            CHOPT - options: 'BF' - from BACK to FRONT
   //                             'FB' - from FRONT to BACK

   Double_t p[8][3], pf[8], pn[8][3];
   Double_t p0[3], p1[3], p2[3], p3[3], t[3];
   Double_t fsurf, w, d1, d2, df1, df2;
   Int_t icodes[3];
   Int_t i, i1, i2, j, ibase, nnod, knod, ntria, ktria, iopt, iready;
   Int_t ixcrit, iycrit, izcrit, incrx, incry, incrz, incr;
   Int_t ix, ix1=0, ix2=0, iy, iy1=0, iy2=0, iz, iz1=0, iz2=0, k, kx, ky, kz, isurf, nsurf;

   Double_t xyz[kNmaxp][3], xyzn[kNmaxp][3], grad[kNmaxp][3];
   Double_t dtria[kNmaxt][6], abcd[kNmaxt][4];
   Int_t    itria[kNmaxt][3], iorder[kNmaxt], iattr[kNmaxt];

   static Int_t ind[8][3] = { { 0,0,0 }, { 1,0,0 }, { 1,0,1 }, { 0,0,1 },
                              { 0,1,0 }, { 1,1,0 }, { 1,1,1 }, { 0,1,1 } };
   for (i=0;i<kNmaxp;i++) {
      xyzn[i][0] = 0.;
      xyzn[i][1] = 0.;
      xyzn[i][2] = 0.;
   }

   TView *view = 0;

   if (gPad) view = gPad->GetView();
   if (!view) {
      Error("ImplicitFunction", "no TView in current pad");
      return;
   }

   nsurf = ns;
   if (nsurf > kNiso) {
      Warning("IsoSurface","Number of isosurfaces too large. Increase kNiso");
   }
   iopt = 2;
   if (*chopt == 'B' || *chopt == 'b') iopt = 1;

   //       F I N D   X - , Y - , Z - C R I T I C A L
   //       This logic works for parallel projection only.
   //       For central projection another logic should be implemented.
   p0[0] = x[0];
   p0[1] = y[0];
   p0[2] = z[0];
   view->WCtoNDC(p0, p0);
   p1[0] = x[nx-1];
   p1[1] = y[0];
   p1[2] = z[0];
   view->WCtoNDC(p1, p1);
   p2[0] = x[0];
   p2[1] = y[ny-1];
   p2[2] = z[0];
   view->WCtoNDC(p2, p2);
   p3[0] = x[0];
   p3[1] = y[0];
   p3[2] = z[nz-1];
   view->WCtoNDC(p3, p3);
   ixcrit = nx;
   iycrit = ny;
   izcrit = nz;
   if (p1[2] < p0[2]) ixcrit = 1;
   if (p2[2] < p0[2]) iycrit = 1;
   if (p3[2] < p0[2]) izcrit = 1;

   //       L O O P   A L O N G   G R I D
   //       This logic works for both (parallel & central) projections.
   incrx = 1;
   incry = 1;
   incrz = 1;
L110:
   if (incrz >= 0) {
      if (iopt == 1) iz1 = 1;
      if (iopt == 1) iz2 = izcrit-1;
      if (iopt == 2) iz1 = izcrit;
      if (iopt == 2) iz2 = nz - 1;
   } else {
      if (iopt == 1) iz1 = nz - 1;
      if (iopt == 1) iz2 = izcrit;
      if (iopt == 2) iz1 = izcrit-1;
      if (iopt == 2) iz2 = 1;
   }
   for (iz = iz1; incrz < 0 ? iz >= iz2 : iz <= iz2; iz += incrz) {
L120:
      if (incry >= 0) {
         if (iopt == 1) iy1 = 1;
         if (iopt == 1) iy2 = iycrit-1;
         if (iopt == 2) iy1 = iycrit;
         if (iopt == 2) iy2 = ny - 1;
      } else {
         if (iopt == 1) iy1 = ny - 1;
         if (iopt == 1) iy2 = iycrit;
         if (iopt == 2) iy1 = iycrit-1;
         if (iopt == 2) iy2 = 1;
      }
      for (iy = iy1; incry < 0 ? iy >= iy2 : iy <= iy2; iy += incry) {
L130:
         if (incrx >= 0) {
            if (iopt == 1) ix1 = 1;
            if (iopt == 1) ix2 = ixcrit-1;
            if (iopt == 2) ix1 = ixcrit;
            if (iopt == 2) ix2 = nx - 1;
         } else {
            if (iopt == 1) ix1 = nx - 1;
            if (iopt == 1) ix2 = ixcrit;
            if (iopt == 2) ix1 = ixcrit-1;
            if (iopt == 2) ix2 = 1;
         }
         for (ix = ix1; incrx < 0 ? ix >= ix2 : ix <= ix2; ix += incrx) {
            nnod = 0;
            ntria = 0;
            iready = 0;
            for ( isurf=1 ; isurf<=nsurf ; isurf++ ) {
               fsurf = s[isurf-1];
               if (gCurrentHist->GetBinContent(ix,  iy,  iz)   >= fsurf)
                  goto L210;
               if (gCurrentHist->GetBinContent(ix+1,iy,  iz)   >= fsurf)
                  goto L220;
               if (gCurrentHist->GetBinContent(ix,  iy+1,iz)   >= fsurf)
                  goto L220;
               if (gCurrentHist->GetBinContent(ix+1,iy+1,iz)   >= fsurf)
                  goto L220;
               if (gCurrentHist->GetBinContent(ix,  iy,  iz+1) >= fsurf)
                  goto L220;
               if (gCurrentHist->GetBinContent(ix+1,iy,  iz+1) >= fsurf)
                  goto L220;
               if (gCurrentHist->GetBinContent(ix,  iy+1,iz+1) >= fsurf)
                  goto L220;
               if (gCurrentHist->GetBinContent(ix+1,iy+1,iz+1) >= fsurf)
                  goto L220;
               continue;
L210:
               if (gCurrentHist->GetBinContent(ix+1,iy,  iz)   < fsurf)
                  goto L220;
               if (gCurrentHist->GetBinContent(ix,  iy+1,iz)   < fsurf)
                  goto L220;
               if (gCurrentHist->GetBinContent(ix+1,iy+1,iz)   < fsurf)
                  goto L220;
               if (gCurrentHist->GetBinContent(ix,  iy,  iz+1) < fsurf)
                  goto L220;
               if (gCurrentHist->GetBinContent(ix+1,iy,  iz+1) < fsurf)
                  goto L220;
               if (gCurrentHist->GetBinContent(ix,  iy+1,iz+1) < fsurf)
                  goto L220;
               if (gCurrentHist->GetBinContent(ix+1,iy+1,iz+1) < fsurf)
                  goto L220;
               continue;

   //       P R E P A R E   C U B E   ( P A R A L L E P I P E D )
L220:
               if (iready !=0) goto L310;
               iready = 1;
               for ( i=1 ; i<=8 ; i++ ) {
                  kx = ix + ind[i-1][0];
                  ky = iy + ind[i-1][1];
                  kz = iz + ind[i-1][2];
                  p[i-1][0] = x[kx-1];
                  p[i-1][1] = y[ky-1];
                  p[i-1][2] = z[kz-1];
                  pf[i-1] = gCurrentHist->GetBinContent(kx,ky,kz);
   //       F I N D   X - G R A D I E N T
                  if (kx == 1) {
                     pn[i-1][0] = (gCurrentHist->GetBinContent(2,ky,kz) -
                                   gCurrentHist->GetBinContent(1,ky,kz)) /
                                   (x[1]-x[0]);
                  } else if (kx == nx) {
                     pn[i-1][0] = (gCurrentHist->GetBinContent(kx,ky,kz) -
                                   gCurrentHist->GetBinContent(kx-1,ky,kz)) /
                                   (x[kx-1]-x[kx-2]);
                  } else {
                     d1 = x[kx-1] - x[kx-2];
                     d2 = x[kx] - x[kx-1];
                     if (d1 == d2) {
                        pn[i-1][0] = (gCurrentHist->GetBinContent(kx+1,ky,kz) -
                                      gCurrentHist->GetBinContent(kx-1,ky,kz)) /
                                      (d1+d1);
                     } else {
                        df1 = gCurrentHist->GetBinContent(kx,ky,kz) -
                              gCurrentHist->GetBinContent(kx-1,ky,kz);
                        df2 = gCurrentHist->GetBinContent(kx+1,ky,kz) -
                              gCurrentHist->GetBinContent(kx,ky,kz);
                        pn[i-1][0] = (df1*d2*d2+df2*d1*d1)/(d1*d2*d2+d2*d1*d1);
                     }
                  }
   //       F I N D   Y - G R A D I E N T
                  if (ky == 1) {
                     pn[i-1][1] = (gCurrentHist->GetBinContent(kx,2,kz) -
                                   gCurrentHist->GetBinContent(kx,1,kz)) /
                                   (y[1]-y[0]);
                  } else if (ky == ny) {
                     pn[i-1][1] = (gCurrentHist->GetBinContent(kx,ky,kz) -
                                   gCurrentHist->GetBinContent(kx,ky-1,kz)) /
                                   (y[ky-1]-y[ky-2]);
                  } else {
                     d1 = y[ky-1] - y[ky-2];
                     d2 = y[ky] - y[ky-1];
                     if (d1 == d2) {
                        pn[i-1][1] = (gCurrentHist->GetBinContent(kx,ky+1,kz) -
                                      gCurrentHist->GetBinContent(kx,ky-1,kz)) /
                                      (d1+d1);
                     } else {
                        df1 = gCurrentHist->GetBinContent(kx,ky,kz) -
                              gCurrentHist->GetBinContent(kx,ky-1,kz);
                        df2 = gCurrentHist->GetBinContent(kx,ky+1,kz) -
                              gCurrentHist->GetBinContent(kx,ky,kz);
                        pn[i-1][1] = (df1*d2*d2+df2*d1*d1)/(d1*d2*d2+d2*d1*d1);
                     }
                  }
   //       F I N D   Z - G R A D I E N T
                  if (kz == 1) {
                     pn[i-1][2] = (gCurrentHist->GetBinContent(kx,ky,2) -
                                   gCurrentHist->GetBinContent(kx,ky,1)) /
                                   (z[1]-z[0]);
                  } else if (kz == nz) {
                     pn[i-1][2] = (gCurrentHist->GetBinContent(kx,ky,kz) -
                                   gCurrentHist->GetBinContent(kx,ky,kz-1)) /
                                   (z[kz-1]-z[kz-2]);
                  } else {
                     d1 = z[kz-1] - z[kz-2];
                     d2 = z[kz] - z[kz-1];
                     if (d1 == d2) {
                        pn[i-1][2] = (gCurrentHist->GetBinContent(kx,ky,kz+1) -
                                      gCurrentHist->GetBinContent(kx,ky,kz-1)) /
                                      (d1+d1);
                     } else {
                        df1 = gCurrentHist->GetBinContent(kx,ky,kz) -
                              gCurrentHist->GetBinContent(kx,ky,kz-1);
                        df2 = gCurrentHist->GetBinContent(kx,ky,kz+1) -
                              gCurrentHist->GetBinContent(kx,ky,kz);
                        pn[i-1][2] = (df1*d2*d2+df2*d1*d1)/(d1*d2*d2+d2*d1*d1);
                     }
                  }
               }

   //       F I N D   S E T   O F   T R I A N G L E S
L310:
               Double_t xyz_tmp[kNmaxp][3], grad_tmp[kNmaxp][3];
               Int_t itria_tmp[kNmaxt][3], l;

               MarchingCube(s[isurf-1], p, pf, pn, knod, ktria,
                            xyz_tmp, grad_tmp, itria_tmp);

               for( l=0 ; l<knod ; l++) {
                  xyz[nnod+l][0] = xyz_tmp[l][0];
                  xyz[nnod+l][1] = xyz_tmp[l][1];
                  xyz[nnod+l][2] = xyz_tmp[l][2];
                  grad[nnod+l][0] = grad_tmp[l][0];
                  grad[nnod+l][1] = grad_tmp[l][1];
                  grad[nnod+l][2] = grad_tmp[l][2];
               }
               for( l=0 ; l<ktria ; l++) {
                  itria[ntria+l][0] = itria_tmp[l][0];
                  itria[ntria+l][1] = itria_tmp[l][1];
                  itria[ntria+l][2] = itria_tmp[l][2];
               }

               for ( i=ntria+1 ; i<=ntria+ktria ; i++ ) {
                 for ( j=1 ; j<=3 ; j++ ){
                     ibase = nnod;
                     if (itria[i-1][j-1] < 0) ibase =-nnod;
                     itria[i-1][j-1] = itria[i-1][j-1] + ibase;
                  }
                  iattr[i-1] = isurf;
               }
               nnod = nnod + knod;
               ntria = ntria + ktria;
            }

   //       D E P T H   S O R T,   D R A W I N G
            if (ntria == 0) continue;
            for ( i=1 ; i<=nnod ; i++ ) {
               view->WCtoNDC(&xyz[i-1][0], &xyzn[i-1][0]);
               Luminosity(&grad[i-1][0], w);
               grad[i-1][0] = w;
            }
            ZDepth(xyzn, ntria, itria, dtria, abcd, (Int_t*)iorder);
            if (ntria == 0) continue;
            incr = 1;
            if (iopt == 1) incr = -1;
            i1 = 1;
            if (incr == -1) i1 = ntria;
            i2 = ntria - i1 + 1;
            for (i = i1; incr < 0 ? i >= i2 : i <= i2; i += incr) {
               k = iorder[i-1];
               t[0] = grad[TMath::Abs(itria[k-1][0])-1][0];
               t[1] = grad[TMath::Abs(itria[k-1][1])-1][0];
               t[2] = grad[TMath::Abs(itria[k-1][2])-1][0];
               icodes[0] = iattr[k-1];
               icodes[1] = iattr[k-1];
               icodes[2] = iattr[k-1];
               DrawFaceGouraudShaded(icodes, xyz, 3, &itria[k-1][0], t);
            }
         }
         incrx = -incrx;
         if (incrx < 0) goto L130;
      }
      incry = -incry;
      if (incry < 0) goto L120;
   }
   incrz = -incrz;
   if (incrz < 0) goto L110;
}

//______________________________________________________________________________
void TPainter3dAlgorithms::DrawFaceGouraudShaded(Int_t *icodes,
                                                 Double_t xyz[][3],
                                                 Int_t np, Int_t *iface,
                                                 Double_t *t)
{
   // Draw the faces for the Gouraud Shaded Iso surfaces

   Int_t i, k, irep;
   Double_t p3[12][3];
   TView *view = 0;

   if (gPad) view = gPad->GetView();
   if (!view) {
      Error("ImplicitFunction", "no TView in current pad");
      return;
   }

   if (icodes[0]==1) Spectrum(fNcolor, fFmin, fFmax, fIc1, 1, irep);
   if (icodes[0]==2) Spectrum(fNcolor, fFmin, fFmax, fIc2, 1, irep);
   if (icodes[0]==3) Spectrum(fNcolor, fFmin, fFmax, fIc3, 1, irep);
   for ( i=1 ; i<=np ; i++) {
      k = iface[i-1];
      if (k<0) k = -k;
      view->WCtoNDC(&xyz[k-1][0], &p3[i-1][0]);
   }
   FillPolygon(np, (Double_t *)p3, (Double_t *)t);
}
 TPainter3dAlgorithms.cxx:1
 TPainter3dAlgorithms.cxx:2
 TPainter3dAlgorithms.cxx:3
 TPainter3dAlgorithms.cxx:4
 TPainter3dAlgorithms.cxx:5
 TPainter3dAlgorithms.cxx:6
 TPainter3dAlgorithms.cxx:7
 TPainter3dAlgorithms.cxx:8
 TPainter3dAlgorithms.cxx:9
 TPainter3dAlgorithms.cxx:10
 TPainter3dAlgorithms.cxx:11
 TPainter3dAlgorithms.cxx:12
 TPainter3dAlgorithms.cxx:13
 TPainter3dAlgorithms.cxx:14
 TPainter3dAlgorithms.cxx:15
 TPainter3dAlgorithms.cxx:16
 TPainter3dAlgorithms.cxx:17
 TPainter3dAlgorithms.cxx:18
 TPainter3dAlgorithms.cxx:19
 TPainter3dAlgorithms.cxx:20
 TPainter3dAlgorithms.cxx:21
 TPainter3dAlgorithms.cxx:22
 TPainter3dAlgorithms.cxx:23
 TPainter3dAlgorithms.cxx:24
 TPainter3dAlgorithms.cxx:25
 TPainter3dAlgorithms.cxx:26
 TPainter3dAlgorithms.cxx:27
 TPainter3dAlgorithms.cxx:28
 TPainter3dAlgorithms.cxx:29
 TPainter3dAlgorithms.cxx:30
 TPainter3dAlgorithms.cxx:31
 TPainter3dAlgorithms.cxx:32
 TPainter3dAlgorithms.cxx:33
 TPainter3dAlgorithms.cxx:34
 TPainter3dAlgorithms.cxx:35
 TPainter3dAlgorithms.cxx:36
 TPainter3dAlgorithms.cxx:37
 TPainter3dAlgorithms.cxx:38
 TPainter3dAlgorithms.cxx:39
 TPainter3dAlgorithms.cxx:40
 TPainter3dAlgorithms.cxx:41
 TPainter3dAlgorithms.cxx:42
 TPainter3dAlgorithms.cxx:43
 TPainter3dAlgorithms.cxx:44
 TPainter3dAlgorithms.cxx:45
 TPainter3dAlgorithms.cxx:46
 TPainter3dAlgorithms.cxx:47
 TPainter3dAlgorithms.cxx:48
 TPainter3dAlgorithms.cxx:49
 TPainter3dAlgorithms.cxx:50
 TPainter3dAlgorithms.cxx:51
 TPainter3dAlgorithms.cxx:52
 TPainter3dAlgorithms.cxx:53
 TPainter3dAlgorithms.cxx:54
 TPainter3dAlgorithms.cxx:55
 TPainter3dAlgorithms.cxx:56
 TPainter3dAlgorithms.cxx:57
 TPainter3dAlgorithms.cxx:58
 TPainter3dAlgorithms.cxx:59
 TPainter3dAlgorithms.cxx:60
 TPainter3dAlgorithms.cxx:61
 TPainter3dAlgorithms.cxx:62
 TPainter3dAlgorithms.cxx:63
 TPainter3dAlgorithms.cxx:64
 TPainter3dAlgorithms.cxx:65
 TPainter3dAlgorithms.cxx:66
 TPainter3dAlgorithms.cxx:67
 TPainter3dAlgorithms.cxx:68
 TPainter3dAlgorithms.cxx:69
 TPainter3dAlgorithms.cxx:70
 TPainter3dAlgorithms.cxx:71
 TPainter3dAlgorithms.cxx:72
 TPainter3dAlgorithms.cxx:73
 TPainter3dAlgorithms.cxx:74
 TPainter3dAlgorithms.cxx:75
 TPainter3dAlgorithms.cxx:76
 TPainter3dAlgorithms.cxx:77
 TPainter3dAlgorithms.cxx:78
 TPainter3dAlgorithms.cxx:79
 TPainter3dAlgorithms.cxx:80
 TPainter3dAlgorithms.cxx:81
 TPainter3dAlgorithms.cxx:82
 TPainter3dAlgorithms.cxx:83
 TPainter3dAlgorithms.cxx:84
 TPainter3dAlgorithms.cxx:85
 TPainter3dAlgorithms.cxx:86
 TPainter3dAlgorithms.cxx:87
 TPainter3dAlgorithms.cxx:88
 TPainter3dAlgorithms.cxx:89
 TPainter3dAlgorithms.cxx:90
 TPainter3dAlgorithms.cxx:91
 TPainter3dAlgorithms.cxx:92
 TPainter3dAlgorithms.cxx:93
 TPainter3dAlgorithms.cxx:94
 TPainter3dAlgorithms.cxx:95
 TPainter3dAlgorithms.cxx:96
 TPainter3dAlgorithms.cxx:97
 TPainter3dAlgorithms.cxx:98
 TPainter3dAlgorithms.cxx:99
 TPainter3dAlgorithms.cxx:100
 TPainter3dAlgorithms.cxx:101
 TPainter3dAlgorithms.cxx:102
 TPainter3dAlgorithms.cxx:103
 TPainter3dAlgorithms.cxx:104
 TPainter3dAlgorithms.cxx:105
 TPainter3dAlgorithms.cxx:106
 TPainter3dAlgorithms.cxx:107
 TPainter3dAlgorithms.cxx:108
 TPainter3dAlgorithms.cxx:109
 TPainter3dAlgorithms.cxx:110
 TPainter3dAlgorithms.cxx:111
 TPainter3dAlgorithms.cxx:112
 TPainter3dAlgorithms.cxx:113
 TPainter3dAlgorithms.cxx:114
 TPainter3dAlgorithms.cxx:115
 TPainter3dAlgorithms.cxx:116
 TPainter3dAlgorithms.cxx:117
 TPainter3dAlgorithms.cxx:118
 TPainter3dAlgorithms.cxx:119
 TPainter3dAlgorithms.cxx:120
 TPainter3dAlgorithms.cxx:121
 TPainter3dAlgorithms.cxx:122
 TPainter3dAlgorithms.cxx:123
 TPainter3dAlgorithms.cxx:124
 TPainter3dAlgorithms.cxx:125
 TPainter3dAlgorithms.cxx:126
 TPainter3dAlgorithms.cxx:127
 TPainter3dAlgorithms.cxx:128
 TPainter3dAlgorithms.cxx:129
 TPainter3dAlgorithms.cxx:130
 TPainter3dAlgorithms.cxx:131
 TPainter3dAlgorithms.cxx:132
 TPainter3dAlgorithms.cxx:133
 TPainter3dAlgorithms.cxx:134
 TPainter3dAlgorithms.cxx:135
 TPainter3dAlgorithms.cxx:136
 TPainter3dAlgorithms.cxx:137
 TPainter3dAlgorithms.cxx:138
 TPainter3dAlgorithms.cxx:139
 TPainter3dAlgorithms.cxx:140
 TPainter3dAlgorithms.cxx:141
 TPainter3dAlgorithms.cxx:142
 TPainter3dAlgorithms.cxx:143
 TPainter3dAlgorithms.cxx:144
 TPainter3dAlgorithms.cxx:145
 TPainter3dAlgorithms.cxx:146
 TPainter3dAlgorithms.cxx:147
 TPainter3dAlgorithms.cxx:148
 TPainter3dAlgorithms.cxx:149
 TPainter3dAlgorithms.cxx:150
 TPainter3dAlgorithms.cxx:151
 TPainter3dAlgorithms.cxx:152
 TPainter3dAlgorithms.cxx:153
 TPainter3dAlgorithms.cxx:154
 TPainter3dAlgorithms.cxx:155
 TPainter3dAlgorithms.cxx:156
 TPainter3dAlgorithms.cxx:157
 TPainter3dAlgorithms.cxx:158
 TPainter3dAlgorithms.cxx:159
 TPainter3dAlgorithms.cxx:160
 TPainter3dAlgorithms.cxx:161
 TPainter3dAlgorithms.cxx:162
 TPainter3dAlgorithms.cxx:163
 TPainter3dAlgorithms.cxx:164
 TPainter3dAlgorithms.cxx:165
 TPainter3dAlgorithms.cxx:166
 TPainter3dAlgorithms.cxx:167
 TPainter3dAlgorithms.cxx:168
 TPainter3dAlgorithms.cxx:169
 TPainter3dAlgorithms.cxx:170
 TPainter3dAlgorithms.cxx:171
 TPainter3dAlgorithms.cxx:172
 TPainter3dAlgorithms.cxx:173
 TPainter3dAlgorithms.cxx:174
 TPainter3dAlgorithms.cxx:175
 TPainter3dAlgorithms.cxx:176
 TPainter3dAlgorithms.cxx:177
 TPainter3dAlgorithms.cxx:178
 TPainter3dAlgorithms.cxx:179
 TPainter3dAlgorithms.cxx:180
 TPainter3dAlgorithms.cxx:181
 TPainter3dAlgorithms.cxx:182
 TPainter3dAlgorithms.cxx:183
 TPainter3dAlgorithms.cxx:184
 TPainter3dAlgorithms.cxx:185
 TPainter3dAlgorithms.cxx:186
 TPainter3dAlgorithms.cxx:187
 TPainter3dAlgorithms.cxx:188
 TPainter3dAlgorithms.cxx:189
 TPainter3dAlgorithms.cxx:190
 TPainter3dAlgorithms.cxx:191
 TPainter3dAlgorithms.cxx:192
 TPainter3dAlgorithms.cxx:193
 TPainter3dAlgorithms.cxx:194
 TPainter3dAlgorithms.cxx:195
 TPainter3dAlgorithms.cxx:196
 TPainter3dAlgorithms.cxx:197
 TPainter3dAlgorithms.cxx:198
 TPainter3dAlgorithms.cxx:199
 TPainter3dAlgorithms.cxx:200
 TPainter3dAlgorithms.cxx:201
 TPainter3dAlgorithms.cxx:202
 TPainter3dAlgorithms.cxx:203
 TPainter3dAlgorithms.cxx:204
 TPainter3dAlgorithms.cxx:205
 TPainter3dAlgorithms.cxx:206
 TPainter3dAlgorithms.cxx:207
 TPainter3dAlgorithms.cxx:208
 TPainter3dAlgorithms.cxx:209
 TPainter3dAlgorithms.cxx:210
 TPainter3dAlgorithms.cxx:211
 TPainter3dAlgorithms.cxx:212
 TPainter3dAlgorithms.cxx:213
 TPainter3dAlgorithms.cxx:214
 TPainter3dAlgorithms.cxx:215
 TPainter3dAlgorithms.cxx:216
 TPainter3dAlgorithms.cxx:217
 TPainter3dAlgorithms.cxx:218
 TPainter3dAlgorithms.cxx:219
 TPainter3dAlgorithms.cxx:220
 TPainter3dAlgorithms.cxx:221
 TPainter3dAlgorithms.cxx:222
 TPainter3dAlgorithms.cxx:223
 TPainter3dAlgorithms.cxx:224
 TPainter3dAlgorithms.cxx:225
 TPainter3dAlgorithms.cxx:226
 TPainter3dAlgorithms.cxx:227
 TPainter3dAlgorithms.cxx:228
 TPainter3dAlgorithms.cxx:229
 TPainter3dAlgorithms.cxx:230
 TPainter3dAlgorithms.cxx:231
 TPainter3dAlgorithms.cxx:232
 TPainter3dAlgorithms.cxx:233
 TPainter3dAlgorithms.cxx:234
 TPainter3dAlgorithms.cxx:235
 TPainter3dAlgorithms.cxx:236
 TPainter3dAlgorithms.cxx:237
 TPainter3dAlgorithms.cxx:238
 TPainter3dAlgorithms.cxx:239
 TPainter3dAlgorithms.cxx:240
 TPainter3dAlgorithms.cxx:241
 TPainter3dAlgorithms.cxx:242
 TPainter3dAlgorithms.cxx:243
 TPainter3dAlgorithms.cxx:244
 TPainter3dAlgorithms.cxx:245
 TPainter3dAlgorithms.cxx:246
 TPainter3dAlgorithms.cxx:247
 TPainter3dAlgorithms.cxx:248
 TPainter3dAlgorithms.cxx:249
 TPainter3dAlgorithms.cxx:250
 TPainter3dAlgorithms.cxx:251
 TPainter3dAlgorithms.cxx:252
 TPainter3dAlgorithms.cxx:253
 TPainter3dAlgorithms.cxx:254
 TPainter3dAlgorithms.cxx:255
 TPainter3dAlgorithms.cxx:256
 TPainter3dAlgorithms.cxx:257
 TPainter3dAlgorithms.cxx:258
 TPainter3dAlgorithms.cxx:259
 TPainter3dAlgorithms.cxx:260
 TPainter3dAlgorithms.cxx:261
 TPainter3dAlgorithms.cxx:262
 TPainter3dAlgorithms.cxx:263
 TPainter3dAlgorithms.cxx:264
 TPainter3dAlgorithms.cxx:265
 TPainter3dAlgorithms.cxx:266
 TPainter3dAlgorithms.cxx:267
 TPainter3dAlgorithms.cxx:268
 TPainter3dAlgorithms.cxx:269
 TPainter3dAlgorithms.cxx:270
 TPainter3dAlgorithms.cxx:271
 TPainter3dAlgorithms.cxx:272
 TPainter3dAlgorithms.cxx:273
 TPainter3dAlgorithms.cxx:274
 TPainter3dAlgorithms.cxx:275
 TPainter3dAlgorithms.cxx:276
 TPainter3dAlgorithms.cxx:277
 TPainter3dAlgorithms.cxx:278
 TPainter3dAlgorithms.cxx:279
 TPainter3dAlgorithms.cxx:280
 TPainter3dAlgorithms.cxx:281
 TPainter3dAlgorithms.cxx:282
 TPainter3dAlgorithms.cxx:283
 TPainter3dAlgorithms.cxx:284
 TPainter3dAlgorithms.cxx:285
 TPainter3dAlgorithms.cxx:286
 TPainter3dAlgorithms.cxx:287
 TPainter3dAlgorithms.cxx:288
 TPainter3dAlgorithms.cxx:289
 TPainter3dAlgorithms.cxx:290
 TPainter3dAlgorithms.cxx:291
 TPainter3dAlgorithms.cxx:292
 TPainter3dAlgorithms.cxx:293
 TPainter3dAlgorithms.cxx:294
 TPainter3dAlgorithms.cxx:295
 TPainter3dAlgorithms.cxx:296
 TPainter3dAlgorithms.cxx:297
 TPainter3dAlgorithms.cxx:298
 TPainter3dAlgorithms.cxx:299
 TPainter3dAlgorithms.cxx:300
 TPainter3dAlgorithms.cxx:301
 TPainter3dAlgorithms.cxx:302
 TPainter3dAlgorithms.cxx:303
 TPainter3dAlgorithms.cxx:304
 TPainter3dAlgorithms.cxx:305
 TPainter3dAlgorithms.cxx:306
 TPainter3dAlgorithms.cxx:307
 TPainter3dAlgorithms.cxx:308
 TPainter3dAlgorithms.cxx:309
 TPainter3dAlgorithms.cxx:310
 TPainter3dAlgorithms.cxx:311
 TPainter3dAlgorithms.cxx:312
 TPainter3dAlgorithms.cxx:313
 TPainter3dAlgorithms.cxx:314
 TPainter3dAlgorithms.cxx:315
 TPainter3dAlgorithms.cxx:316
 TPainter3dAlgorithms.cxx:317
 TPainter3dAlgorithms.cxx:318
 TPainter3dAlgorithms.cxx:319
 TPainter3dAlgorithms.cxx:320
 TPainter3dAlgorithms.cxx:321
 TPainter3dAlgorithms.cxx:322
 TPainter3dAlgorithms.cxx:323
 TPainter3dAlgorithms.cxx:324
 TPainter3dAlgorithms.cxx:325
 TPainter3dAlgorithms.cxx:326
 TPainter3dAlgorithms.cxx:327
 TPainter3dAlgorithms.cxx:328
 TPainter3dAlgorithms.cxx:329
 TPainter3dAlgorithms.cxx:330
 TPainter3dAlgorithms.cxx:331
 TPainter3dAlgorithms.cxx:332
 TPainter3dAlgorithms.cxx:333
 TPainter3dAlgorithms.cxx:334
 TPainter3dAlgorithms.cxx:335
 TPainter3dAlgorithms.cxx:336
 TPainter3dAlgorithms.cxx:337
 TPainter3dAlgorithms.cxx:338
 TPainter3dAlgorithms.cxx:339
 TPainter3dAlgorithms.cxx:340
 TPainter3dAlgorithms.cxx:341
 TPainter3dAlgorithms.cxx:342
 TPainter3dAlgorithms.cxx:343
 TPainter3dAlgorithms.cxx:344
 TPainter3dAlgorithms.cxx:345
 TPainter3dAlgorithms.cxx:346
 TPainter3dAlgorithms.cxx:347
 TPainter3dAlgorithms.cxx:348
 TPainter3dAlgorithms.cxx:349
 TPainter3dAlgorithms.cxx:350
 TPainter3dAlgorithms.cxx:351
 TPainter3dAlgorithms.cxx:352
 TPainter3dAlgorithms.cxx:353
 TPainter3dAlgorithms.cxx:354
 TPainter3dAlgorithms.cxx:355
 TPainter3dAlgorithms.cxx:356
 TPainter3dAlgorithms.cxx:357
 TPainter3dAlgorithms.cxx:358
 TPainter3dAlgorithms.cxx:359
 TPainter3dAlgorithms.cxx:360
 TPainter3dAlgorithms.cxx:361
 TPainter3dAlgorithms.cxx:362
 TPainter3dAlgorithms.cxx:363
 TPainter3dAlgorithms.cxx:364
 TPainter3dAlgorithms.cxx:365
 TPainter3dAlgorithms.cxx:366
 TPainter3dAlgorithms.cxx:367
 TPainter3dAlgorithms.cxx:368
 TPainter3dAlgorithms.cxx:369
 TPainter3dAlgorithms.cxx:370
 TPainter3dAlgorithms.cxx:371
 TPainter3dAlgorithms.cxx:372
 TPainter3dAlgorithms.cxx:373
 TPainter3dAlgorithms.cxx:374
 TPainter3dAlgorithms.cxx:375
 TPainter3dAlgorithms.cxx:376
 TPainter3dAlgorithms.cxx:377
 TPainter3dAlgorithms.cxx:378
 TPainter3dAlgorithms.cxx:379
 TPainter3dAlgorithms.cxx:380
 TPainter3dAlgorithms.cxx:381
 TPainter3dAlgorithms.cxx:382
 TPainter3dAlgorithms.cxx:383
 TPainter3dAlgorithms.cxx:384
 TPainter3dAlgorithms.cxx:385
 TPainter3dAlgorithms.cxx:386
 TPainter3dAlgorithms.cxx:387
 TPainter3dAlgorithms.cxx:388
 TPainter3dAlgorithms.cxx:389
 TPainter3dAlgorithms.cxx:390
 TPainter3dAlgorithms.cxx:391
 TPainter3dAlgorithms.cxx:392
 TPainter3dAlgorithms.cxx:393
 TPainter3dAlgorithms.cxx:394
 TPainter3dAlgorithms.cxx:395
 TPainter3dAlgorithms.cxx:396
 TPainter3dAlgorithms.cxx:397
 TPainter3dAlgorithms.cxx:398
 TPainter3dAlgorithms.cxx:399
 TPainter3dAlgorithms.cxx:400
 TPainter3dAlgorithms.cxx:401
 TPainter3dAlgorithms.cxx:402
 TPainter3dAlgorithms.cxx:403
 TPainter3dAlgorithms.cxx:404
 TPainter3dAlgorithms.cxx:405
 TPainter3dAlgorithms.cxx:406
 TPainter3dAlgorithms.cxx:407
 TPainter3dAlgorithms.cxx:408
 TPainter3dAlgorithms.cxx:409
 TPainter3dAlgorithms.cxx:410
 TPainter3dAlgorithms.cxx:411
 TPainter3dAlgorithms.cxx:412
 TPainter3dAlgorithms.cxx:413
 TPainter3dAlgorithms.cxx:414
 TPainter3dAlgorithms.cxx:415
 TPainter3dAlgorithms.cxx:416
 TPainter3dAlgorithms.cxx:417
 TPainter3dAlgorithms.cxx:418
 TPainter3dAlgorithms.cxx:419
 TPainter3dAlgorithms.cxx:420
 TPainter3dAlgorithms.cxx:421
 TPainter3dAlgorithms.cxx:422
 TPainter3dAlgorithms.cxx:423
 TPainter3dAlgorithms.cxx:424
 TPainter3dAlgorithms.cxx:425
 TPainter3dAlgorithms.cxx:426
 TPainter3dAlgorithms.cxx:427
 TPainter3dAlgorithms.cxx:428
 TPainter3dAlgorithms.cxx:429
 TPainter3dAlgorithms.cxx:430
 TPainter3dAlgorithms.cxx:431
 TPainter3dAlgorithms.cxx:432
 TPainter3dAlgorithms.cxx:433
 TPainter3dAlgorithms.cxx:434
 TPainter3dAlgorithms.cxx:435
 TPainter3dAlgorithms.cxx:436
 TPainter3dAlgorithms.cxx:437
 TPainter3dAlgorithms.cxx:438
 TPainter3dAlgorithms.cxx:439
 TPainter3dAlgorithms.cxx:440
 TPainter3dAlgorithms.cxx:441
 TPainter3dAlgorithms.cxx:442
 TPainter3dAlgorithms.cxx:443
 TPainter3dAlgorithms.cxx:444
 TPainter3dAlgorithms.cxx:445
 TPainter3dAlgorithms.cxx:446
 TPainter3dAlgorithms.cxx:447
 TPainter3dAlgorithms.cxx:448
 TPainter3dAlgorithms.cxx:449
 TPainter3dAlgorithms.cxx:450
 TPainter3dAlgorithms.cxx:451
 TPainter3dAlgorithms.cxx:452
 TPainter3dAlgorithms.cxx:453
 TPainter3dAlgorithms.cxx:454
 TPainter3dAlgorithms.cxx:455
 TPainter3dAlgorithms.cxx:456
 TPainter3dAlgorithms.cxx:457
 TPainter3dAlgorithms.cxx:458
 TPainter3dAlgorithms.cxx:459
 TPainter3dAlgorithms.cxx:460
 TPainter3dAlgorithms.cxx:461
 TPainter3dAlgorithms.cxx:462
 TPainter3dAlgorithms.cxx:463
 TPainter3dAlgorithms.cxx:464
 TPainter3dAlgorithms.cxx:465
 TPainter3dAlgorithms.cxx:466
 TPainter3dAlgorithms.cxx:467
 TPainter3dAlgorithms.cxx:468
 TPainter3dAlgorithms.cxx:469
 TPainter3dAlgorithms.cxx:470
 TPainter3dAlgorithms.cxx:471
 TPainter3dAlgorithms.cxx:472
 TPainter3dAlgorithms.cxx:473
 TPainter3dAlgorithms.cxx:474
 TPainter3dAlgorithms.cxx:475
 TPainter3dAlgorithms.cxx:476
 TPainter3dAlgorithms.cxx:477
 TPainter3dAlgorithms.cxx:478
 TPainter3dAlgorithms.cxx:479
 TPainter3dAlgorithms.cxx:480
 TPainter3dAlgorithms.cxx:481
 TPainter3dAlgorithms.cxx:482
 TPainter3dAlgorithms.cxx:483
 TPainter3dAlgorithms.cxx:484
 TPainter3dAlgorithms.cxx:485
 TPainter3dAlgorithms.cxx:486
 TPainter3dAlgorithms.cxx:487
 TPainter3dAlgorithms.cxx:488
 TPainter3dAlgorithms.cxx:489
 TPainter3dAlgorithms.cxx:490
 TPainter3dAlgorithms.cxx:491
 TPainter3dAlgorithms.cxx:492
 TPainter3dAlgorithms.cxx:493
 TPainter3dAlgorithms.cxx:494
 TPainter3dAlgorithms.cxx:495
 TPainter3dAlgorithms.cxx:496
 TPainter3dAlgorithms.cxx:497
 TPainter3dAlgorithms.cxx:498
 TPainter3dAlgorithms.cxx:499
 TPainter3dAlgorithms.cxx:500
 TPainter3dAlgorithms.cxx:501
 TPainter3dAlgorithms.cxx:502
 TPainter3dAlgorithms.cxx:503
 TPainter3dAlgorithms.cxx:504
 TPainter3dAlgorithms.cxx:505
 TPainter3dAlgorithms.cxx:506
 TPainter3dAlgorithms.cxx:507
 TPainter3dAlgorithms.cxx:508
 TPainter3dAlgorithms.cxx:509
 TPainter3dAlgorithms.cxx:510
 TPainter3dAlgorithms.cxx:511
 TPainter3dAlgorithms.cxx:512
 TPainter3dAlgorithms.cxx:513
 TPainter3dAlgorithms.cxx:514
 TPainter3dAlgorithms.cxx:515
 TPainter3dAlgorithms.cxx:516
 TPainter3dAlgorithms.cxx:517
 TPainter3dAlgorithms.cxx:518
 TPainter3dAlgorithms.cxx:519
 TPainter3dAlgorithms.cxx:520
 TPainter3dAlgorithms.cxx:521
 TPainter3dAlgorithms.cxx:522
 TPainter3dAlgorithms.cxx:523
 TPainter3dAlgorithms.cxx:524
 TPainter3dAlgorithms.cxx:525
 TPainter3dAlgorithms.cxx:526
 TPainter3dAlgorithms.cxx:527
 TPainter3dAlgorithms.cxx:528
 TPainter3dAlgorithms.cxx:529
 TPainter3dAlgorithms.cxx:530
 TPainter3dAlgorithms.cxx:531
 TPainter3dAlgorithms.cxx:532
 TPainter3dAlgorithms.cxx:533
 TPainter3dAlgorithms.cxx:534
 TPainter3dAlgorithms.cxx:535
 TPainter3dAlgorithms.cxx:536
 TPainter3dAlgorithms.cxx:537
 TPainter3dAlgorithms.cxx:538
 TPainter3dAlgorithms.cxx:539
 TPainter3dAlgorithms.cxx:540
 TPainter3dAlgorithms.cxx:541
 TPainter3dAlgorithms.cxx:542
 TPainter3dAlgorithms.cxx:543
 TPainter3dAlgorithms.cxx:544
 TPainter3dAlgorithms.cxx:545
 TPainter3dAlgorithms.cxx:546
 TPainter3dAlgorithms.cxx:547
 TPainter3dAlgorithms.cxx:548
 TPainter3dAlgorithms.cxx:549
 TPainter3dAlgorithms.cxx:550
 TPainter3dAlgorithms.cxx:551
 TPainter3dAlgorithms.cxx:552
 TPainter3dAlgorithms.cxx:553
 TPainter3dAlgorithms.cxx:554
 TPainter3dAlgorithms.cxx:555
 TPainter3dAlgorithms.cxx:556
 TPainter3dAlgorithms.cxx:557
 TPainter3dAlgorithms.cxx:558
 TPainter3dAlgorithms.cxx:559
 TPainter3dAlgorithms.cxx:560
 TPainter3dAlgorithms.cxx:561
 TPainter3dAlgorithms.cxx:562
 TPainter3dAlgorithms.cxx:563
 TPainter3dAlgorithms.cxx:564
 TPainter3dAlgorithms.cxx:565
 TPainter3dAlgorithms.cxx:566
 TPainter3dAlgorithms.cxx:567
 TPainter3dAlgorithms.cxx:568
 TPainter3dAlgorithms.cxx:569
 TPainter3dAlgorithms.cxx:570
 TPainter3dAlgorithms.cxx:571
 TPainter3dAlgorithms.cxx:572
 TPainter3dAlgorithms.cxx:573
 TPainter3dAlgorithms.cxx:574
 TPainter3dAlgorithms.cxx:575
 TPainter3dAlgorithms.cxx:576
 TPainter3dAlgorithms.cxx:577
 TPainter3dAlgorithms.cxx:578
 TPainter3dAlgorithms.cxx:579
 TPainter3dAlgorithms.cxx:580
 TPainter3dAlgorithms.cxx:581
 TPainter3dAlgorithms.cxx:582
 TPainter3dAlgorithms.cxx:583
 TPainter3dAlgorithms.cxx:584
 TPainter3dAlgorithms.cxx:585
 TPainter3dAlgorithms.cxx:586
 TPainter3dAlgorithms.cxx:587
 TPainter3dAlgorithms.cxx:588
 TPainter3dAlgorithms.cxx:589
 TPainter3dAlgorithms.cxx:590
 TPainter3dAlgorithms.cxx:591
 TPainter3dAlgorithms.cxx:592
 TPainter3dAlgorithms.cxx:593
 TPainter3dAlgorithms.cxx:594
 TPainter3dAlgorithms.cxx:595
 TPainter3dAlgorithms.cxx:596
 TPainter3dAlgorithms.cxx:597
 TPainter3dAlgorithms.cxx:598
 TPainter3dAlgorithms.cxx:599
 TPainter3dAlgorithms.cxx:600
 TPainter3dAlgorithms.cxx:601
 TPainter3dAlgorithms.cxx:602
 TPainter3dAlgorithms.cxx:603
 TPainter3dAlgorithms.cxx:604
 TPainter3dAlgorithms.cxx:605
 TPainter3dAlgorithms.cxx:606
 TPainter3dAlgorithms.cxx:607
 TPainter3dAlgorithms.cxx:608
 TPainter3dAlgorithms.cxx:609
 TPainter3dAlgorithms.cxx:610
 TPainter3dAlgorithms.cxx:611
 TPainter3dAlgorithms.cxx:612
 TPainter3dAlgorithms.cxx:613
 TPainter3dAlgorithms.cxx:614
 TPainter3dAlgorithms.cxx:615
 TPainter3dAlgorithms.cxx:616
 TPainter3dAlgorithms.cxx:617
 TPainter3dAlgorithms.cxx:618
 TPainter3dAlgorithms.cxx:619
 TPainter3dAlgorithms.cxx:620
 TPainter3dAlgorithms.cxx:621
 TPainter3dAlgorithms.cxx:622
 TPainter3dAlgorithms.cxx:623
 TPainter3dAlgorithms.cxx:624
 TPainter3dAlgorithms.cxx:625
 TPainter3dAlgorithms.cxx:626
 TPainter3dAlgorithms.cxx:627
 TPainter3dAlgorithms.cxx:628
 TPainter3dAlgorithms.cxx:629
 TPainter3dAlgorithms.cxx:630
 TPainter3dAlgorithms.cxx:631
 TPainter3dAlgorithms.cxx:632
 TPainter3dAlgorithms.cxx:633
 TPainter3dAlgorithms.cxx:634
 TPainter3dAlgorithms.cxx:635
 TPainter3dAlgorithms.cxx:636
 TPainter3dAlgorithms.cxx:637
 TPainter3dAlgorithms.cxx:638
 TPainter3dAlgorithms.cxx:639
 TPainter3dAlgorithms.cxx:640
 TPainter3dAlgorithms.cxx:641
 TPainter3dAlgorithms.cxx:642
 TPainter3dAlgorithms.cxx:643
 TPainter3dAlgorithms.cxx:644
 TPainter3dAlgorithms.cxx:645
 TPainter3dAlgorithms.cxx:646
 TPainter3dAlgorithms.cxx:647
 TPainter3dAlgorithms.cxx:648
 TPainter3dAlgorithms.cxx:649
 TPainter3dAlgorithms.cxx:650
 TPainter3dAlgorithms.cxx:651
 TPainter3dAlgorithms.cxx:652
 TPainter3dAlgorithms.cxx:653
 TPainter3dAlgorithms.cxx:654
 TPainter3dAlgorithms.cxx:655
 TPainter3dAlgorithms.cxx:656
 TPainter3dAlgorithms.cxx:657
 TPainter3dAlgorithms.cxx:658
 TPainter3dAlgorithms.cxx:659
 TPainter3dAlgorithms.cxx:660
 TPainter3dAlgorithms.cxx:661
 TPainter3dAlgorithms.cxx:662
 TPainter3dAlgorithms.cxx:663
 TPainter3dAlgorithms.cxx:664
 TPainter3dAlgorithms.cxx:665
 TPainter3dAlgorithms.cxx:666
 TPainter3dAlgorithms.cxx:667
 TPainter3dAlgorithms.cxx:668
 TPainter3dAlgorithms.cxx:669
 TPainter3dAlgorithms.cxx:670
 TPainter3dAlgorithms.cxx:671
 TPainter3dAlgorithms.cxx:672
 TPainter3dAlgorithms.cxx:673
 TPainter3dAlgorithms.cxx:674
 TPainter3dAlgorithms.cxx:675
 TPainter3dAlgorithms.cxx:676
 TPainter3dAlgorithms.cxx:677
 TPainter3dAlgorithms.cxx:678
 TPainter3dAlgorithms.cxx:679
 TPainter3dAlgorithms.cxx:680
 TPainter3dAlgorithms.cxx:681
 TPainter3dAlgorithms.cxx:682
 TPainter3dAlgorithms.cxx:683
 TPainter3dAlgorithms.cxx:684
 TPainter3dAlgorithms.cxx:685
 TPainter3dAlgorithms.cxx:686
 TPainter3dAlgorithms.cxx:687
 TPainter3dAlgorithms.cxx:688
 TPainter3dAlgorithms.cxx:689
 TPainter3dAlgorithms.cxx:690
 TPainter3dAlgorithms.cxx:691
 TPainter3dAlgorithms.cxx:692
 TPainter3dAlgorithms.cxx:693
 TPainter3dAlgorithms.cxx:694
 TPainter3dAlgorithms.cxx:695
 TPainter3dAlgorithms.cxx:696
 TPainter3dAlgorithms.cxx:697
 TPainter3dAlgorithms.cxx:698
 TPainter3dAlgorithms.cxx:699
 TPainter3dAlgorithms.cxx:700
 TPainter3dAlgorithms.cxx:701
 TPainter3dAlgorithms.cxx:702
 TPainter3dAlgorithms.cxx:703
 TPainter3dAlgorithms.cxx:704
 TPainter3dAlgorithms.cxx:705
 TPainter3dAlgorithms.cxx:706
 TPainter3dAlgorithms.cxx:707
 TPainter3dAlgorithms.cxx:708
 TPainter3dAlgorithms.cxx:709
 TPainter3dAlgorithms.cxx:710
 TPainter3dAlgorithms.cxx:711
 TPainter3dAlgorithms.cxx:712
 TPainter3dAlgorithms.cxx:713
 TPainter3dAlgorithms.cxx:714
 TPainter3dAlgorithms.cxx:715
 TPainter3dAlgorithms.cxx:716
 TPainter3dAlgorithms.cxx:717
 TPainter3dAlgorithms.cxx:718
 TPainter3dAlgorithms.cxx:719
 TPainter3dAlgorithms.cxx:720
 TPainter3dAlgorithms.cxx:721
 TPainter3dAlgorithms.cxx:722
 TPainter3dAlgorithms.cxx:723
 TPainter3dAlgorithms.cxx:724
 TPainter3dAlgorithms.cxx:725
 TPainter3dAlgorithms.cxx:726
 TPainter3dAlgorithms.cxx:727
 TPainter3dAlgorithms.cxx:728
 TPainter3dAlgorithms.cxx:729
 TPainter3dAlgorithms.cxx:730
 TPainter3dAlgorithms.cxx:731
 TPainter3dAlgorithms.cxx:732
 TPainter3dAlgorithms.cxx:733
 TPainter3dAlgorithms.cxx:734
 TPainter3dAlgorithms.cxx:735
 TPainter3dAlgorithms.cxx:736
 TPainter3dAlgorithms.cxx:737
 TPainter3dAlgorithms.cxx:738
 TPainter3dAlgorithms.cxx:739
 TPainter3dAlgorithms.cxx:740
 TPainter3dAlgorithms.cxx:741
 TPainter3dAlgorithms.cxx:742
 TPainter3dAlgorithms.cxx:743
 TPainter3dAlgorithms.cxx:744
 TPainter3dAlgorithms.cxx:745
 TPainter3dAlgorithms.cxx:746
 TPainter3dAlgorithms.cxx:747
 TPainter3dAlgorithms.cxx:748
 TPainter3dAlgorithms.cxx:749
 TPainter3dAlgorithms.cxx:750
 TPainter3dAlgorithms.cxx:751
 TPainter3dAlgorithms.cxx:752
 TPainter3dAlgorithms.cxx:753
 TPainter3dAlgorithms.cxx:754
 TPainter3dAlgorithms.cxx:755
 TPainter3dAlgorithms.cxx:756
 TPainter3dAlgorithms.cxx:757
 TPainter3dAlgorithms.cxx:758
 TPainter3dAlgorithms.cxx:759
 TPainter3dAlgorithms.cxx:760
 TPainter3dAlgorithms.cxx:761
 TPainter3dAlgorithms.cxx:762
 TPainter3dAlgorithms.cxx:763
 TPainter3dAlgorithms.cxx:764
 TPainter3dAlgorithms.cxx:765
 TPainter3dAlgorithms.cxx:766
 TPainter3dAlgorithms.cxx:767
 TPainter3dAlgorithms.cxx:768
 TPainter3dAlgorithms.cxx:769
 TPainter3dAlgorithms.cxx:770
 TPainter3dAlgorithms.cxx:771
 TPainter3dAlgorithms.cxx:772
 TPainter3dAlgorithms.cxx:773
 TPainter3dAlgorithms.cxx:774
 TPainter3dAlgorithms.cxx:775
 TPainter3dAlgorithms.cxx:776
 TPainter3dAlgorithms.cxx:777
 TPainter3dAlgorithms.cxx:778
 TPainter3dAlgorithms.cxx:779
 TPainter3dAlgorithms.cxx:780
 TPainter3dAlgorithms.cxx:781
 TPainter3dAlgorithms.cxx:782
 TPainter3dAlgorithms.cxx:783
 TPainter3dAlgorithms.cxx:784
 TPainter3dAlgorithms.cxx:785
 TPainter3dAlgorithms.cxx:786
 TPainter3dAlgorithms.cxx:787
 TPainter3dAlgorithms.cxx:788
 TPainter3dAlgorithms.cxx:789
 TPainter3dAlgorithms.cxx:790
 TPainter3dAlgorithms.cxx:791
 TPainter3dAlgorithms.cxx:792
 TPainter3dAlgorithms.cxx:793
 TPainter3dAlgorithms.cxx:794
 TPainter3dAlgorithms.cxx:795
 TPainter3dAlgorithms.cxx:796
 TPainter3dAlgorithms.cxx:797
 TPainter3dAlgorithms.cxx:798
 TPainter3dAlgorithms.cxx:799
 TPainter3dAlgorithms.cxx:800
 TPainter3dAlgorithms.cxx:801
 TPainter3dAlgorithms.cxx:802
 TPainter3dAlgorithms.cxx:803
 TPainter3dAlgorithms.cxx:804
 TPainter3dAlgorithms.cxx:805
 TPainter3dAlgorithms.cxx:806
 TPainter3dAlgorithms.cxx:807
 TPainter3dAlgorithms.cxx:808
 TPainter3dAlgorithms.cxx:809
 TPainter3dAlgorithms.cxx:810
 TPainter3dAlgorithms.cxx:811
 TPainter3dAlgorithms.cxx:812
 TPainter3dAlgorithms.cxx:813
 TPainter3dAlgorithms.cxx:814
 TPainter3dAlgorithms.cxx:815
 TPainter3dAlgorithms.cxx:816
 TPainter3dAlgorithms.cxx:817
 TPainter3dAlgorithms.cxx:818
 TPainter3dAlgorithms.cxx:819
 TPainter3dAlgorithms.cxx:820
 TPainter3dAlgorithms.cxx:821
 TPainter3dAlgorithms.cxx:822
 TPainter3dAlgorithms.cxx:823
 TPainter3dAlgorithms.cxx:824
 TPainter3dAlgorithms.cxx:825
 TPainter3dAlgorithms.cxx:826
 TPainter3dAlgorithms.cxx:827
 TPainter3dAlgorithms.cxx:828
 TPainter3dAlgorithms.cxx:829
 TPainter3dAlgorithms.cxx:830
 TPainter3dAlgorithms.cxx:831
 TPainter3dAlgorithms.cxx:832
 TPainter3dAlgorithms.cxx:833
 TPainter3dAlgorithms.cxx:834
 TPainter3dAlgorithms.cxx:835
 TPainter3dAlgorithms.cxx:836
 TPainter3dAlgorithms.cxx:837
 TPainter3dAlgorithms.cxx:838
 TPainter3dAlgorithms.cxx:839
 TPainter3dAlgorithms.cxx:840
 TPainter3dAlgorithms.cxx:841
 TPainter3dAlgorithms.cxx:842
 TPainter3dAlgorithms.cxx:843
 TPainter3dAlgorithms.cxx:844
 TPainter3dAlgorithms.cxx:845
 TPainter3dAlgorithms.cxx:846
 TPainter3dAlgorithms.cxx:847
 TPainter3dAlgorithms.cxx:848
 TPainter3dAlgorithms.cxx:849
 TPainter3dAlgorithms.cxx:850
 TPainter3dAlgorithms.cxx:851
 TPainter3dAlgorithms.cxx:852
 TPainter3dAlgorithms.cxx:853
 TPainter3dAlgorithms.cxx:854
 TPainter3dAlgorithms.cxx:855
 TPainter3dAlgorithms.cxx:856
 TPainter3dAlgorithms.cxx:857
 TPainter3dAlgorithms.cxx:858
 TPainter3dAlgorithms.cxx:859
 TPainter3dAlgorithms.cxx:860
 TPainter3dAlgorithms.cxx:861
 TPainter3dAlgorithms.cxx:862
 TPainter3dAlgorithms.cxx:863
 TPainter3dAlgorithms.cxx:864
 TPainter3dAlgorithms.cxx:865
 TPainter3dAlgorithms.cxx:866
 TPainter3dAlgorithms.cxx:867
 TPainter3dAlgorithms.cxx:868
 TPainter3dAlgorithms.cxx:869
 TPainter3dAlgorithms.cxx:870
 TPainter3dAlgorithms.cxx:871
 TPainter3dAlgorithms.cxx:872
 TPainter3dAlgorithms.cxx:873
 TPainter3dAlgorithms.cxx:874
 TPainter3dAlgorithms.cxx:875
 TPainter3dAlgorithms.cxx:876
 TPainter3dAlgorithms.cxx:877
 TPainter3dAlgorithms.cxx:878
 TPainter3dAlgorithms.cxx:879
 TPainter3dAlgorithms.cxx:880
 TPainter3dAlgorithms.cxx:881
 TPainter3dAlgorithms.cxx:882
 TPainter3dAlgorithms.cxx:883
 TPainter3dAlgorithms.cxx:884
 TPainter3dAlgorithms.cxx:885
 TPainter3dAlgorithms.cxx:886
 TPainter3dAlgorithms.cxx:887
 TPainter3dAlgorithms.cxx:888
 TPainter3dAlgorithms.cxx:889
 TPainter3dAlgorithms.cxx:890
 TPainter3dAlgorithms.cxx:891
 TPainter3dAlgorithms.cxx:892
 TPainter3dAlgorithms.cxx:893
 TPainter3dAlgorithms.cxx:894
 TPainter3dAlgorithms.cxx:895
 TPainter3dAlgorithms.cxx:896
 TPainter3dAlgorithms.cxx:897
 TPainter3dAlgorithms.cxx:898
 TPainter3dAlgorithms.cxx:899
 TPainter3dAlgorithms.cxx:900
 TPainter3dAlgorithms.cxx:901
 TPainter3dAlgorithms.cxx:902
 TPainter3dAlgorithms.cxx:903
 TPainter3dAlgorithms.cxx:904
 TPainter3dAlgorithms.cxx:905
 TPainter3dAlgorithms.cxx:906
 TPainter3dAlgorithms.cxx:907
 TPainter3dAlgorithms.cxx:908
 TPainter3dAlgorithms.cxx:909
 TPainter3dAlgorithms.cxx:910
 TPainter3dAlgorithms.cxx:911
 TPainter3dAlgorithms.cxx:912
 TPainter3dAlgorithms.cxx:913
 TPainter3dAlgorithms.cxx:914
 TPainter3dAlgorithms.cxx:915
 TPainter3dAlgorithms.cxx:916
 TPainter3dAlgorithms.cxx:917
 TPainter3dAlgorithms.cxx:918
 TPainter3dAlgorithms.cxx:919
 TPainter3dAlgorithms.cxx:920
 TPainter3dAlgorithms.cxx:921
 TPainter3dAlgorithms.cxx:922
 TPainter3dAlgorithms.cxx:923
 TPainter3dAlgorithms.cxx:924
 TPainter3dAlgorithms.cxx:925
 TPainter3dAlgorithms.cxx:926
 TPainter3dAlgorithms.cxx:927
 TPainter3dAlgorithms.cxx:928
 TPainter3dAlgorithms.cxx:929
 TPainter3dAlgorithms.cxx:930
 TPainter3dAlgorithms.cxx:931
 TPainter3dAlgorithms.cxx:932
 TPainter3dAlgorithms.cxx:933
 TPainter3dAlgorithms.cxx:934
 TPainter3dAlgorithms.cxx:935
 TPainter3dAlgorithms.cxx:936
 TPainter3dAlgorithms.cxx:937
 TPainter3dAlgorithms.cxx:938
 TPainter3dAlgorithms.cxx:939
 TPainter3dAlgorithms.cxx:940
 TPainter3dAlgorithms.cxx:941
 TPainter3dAlgorithms.cxx:942
 TPainter3dAlgorithms.cxx:943
 TPainter3dAlgorithms.cxx:944
 TPainter3dAlgorithms.cxx:945
 TPainter3dAlgorithms.cxx:946
 TPainter3dAlgorithms.cxx:947
 TPainter3dAlgorithms.cxx:948
 TPainter3dAlgorithms.cxx:949
 TPainter3dAlgorithms.cxx:950
 TPainter3dAlgorithms.cxx:951
 TPainter3dAlgorithms.cxx:952
 TPainter3dAlgorithms.cxx:953
 TPainter3dAlgorithms.cxx:954
 TPainter3dAlgorithms.cxx:955
 TPainter3dAlgorithms.cxx:956
 TPainter3dAlgorithms.cxx:957
 TPainter3dAlgorithms.cxx:958
 TPainter3dAlgorithms.cxx:959
 TPainter3dAlgorithms.cxx:960
 TPainter3dAlgorithms.cxx:961
 TPainter3dAlgorithms.cxx:962
 TPainter3dAlgorithms.cxx:963
 TPainter3dAlgorithms.cxx:964
 TPainter3dAlgorithms.cxx:965
 TPainter3dAlgorithms.cxx:966
 TPainter3dAlgorithms.cxx:967
 TPainter3dAlgorithms.cxx:968
 TPainter3dAlgorithms.cxx:969
 TPainter3dAlgorithms.cxx:970
 TPainter3dAlgorithms.cxx:971
 TPainter3dAlgorithms.cxx:972
 TPainter3dAlgorithms.cxx:973
 TPainter3dAlgorithms.cxx:974
 TPainter3dAlgorithms.cxx:975
 TPainter3dAlgorithms.cxx:976
 TPainter3dAlgorithms.cxx:977
 TPainter3dAlgorithms.cxx:978
 TPainter3dAlgorithms.cxx:979
 TPainter3dAlgorithms.cxx:980
 TPainter3dAlgorithms.cxx:981
 TPainter3dAlgorithms.cxx:982
 TPainter3dAlgorithms.cxx:983
 TPainter3dAlgorithms.cxx:984
 TPainter3dAlgorithms.cxx:985
 TPainter3dAlgorithms.cxx:986
 TPainter3dAlgorithms.cxx:987
 TPainter3dAlgorithms.cxx:988
 TPainter3dAlgorithms.cxx:989
 TPainter3dAlgorithms.cxx:990
 TPainter3dAlgorithms.cxx:991
 TPainter3dAlgorithms.cxx:992
 TPainter3dAlgorithms.cxx:993
 TPainter3dAlgorithms.cxx:994
 TPainter3dAlgorithms.cxx:995
 TPainter3dAlgorithms.cxx:996
 TPainter3dAlgorithms.cxx:997
 TPainter3dAlgorithms.cxx:998
 TPainter3dAlgorithms.cxx:999
 TPainter3dAlgorithms.cxx:1000
 TPainter3dAlgorithms.cxx:1001
 TPainter3dAlgorithms.cxx:1002
 TPainter3dAlgorithms.cxx:1003
 TPainter3dAlgorithms.cxx:1004
 TPainter3dAlgorithms.cxx:1005
 TPainter3dAlgorithms.cxx:1006
 TPainter3dAlgorithms.cxx:1007
 TPainter3dAlgorithms.cxx:1008
 TPainter3dAlgorithms.cxx:1009
 TPainter3dAlgorithms.cxx:1010
 TPainter3dAlgorithms.cxx:1011
 TPainter3dAlgorithms.cxx:1012
 TPainter3dAlgorithms.cxx:1013
 TPainter3dAlgorithms.cxx:1014
 TPainter3dAlgorithms.cxx:1015
 TPainter3dAlgorithms.cxx:1016
 TPainter3dAlgorithms.cxx:1017
 TPainter3dAlgorithms.cxx:1018
 TPainter3dAlgorithms.cxx:1019
 TPainter3dAlgorithms.cxx:1020
 TPainter3dAlgorithms.cxx:1021
 TPainter3dAlgorithms.cxx:1022
 TPainter3dAlgorithms.cxx:1023
 TPainter3dAlgorithms.cxx:1024
 TPainter3dAlgorithms.cxx:1025
 TPainter3dAlgorithms.cxx:1026
 TPainter3dAlgorithms.cxx:1027
 TPainter3dAlgorithms.cxx:1028
 TPainter3dAlgorithms.cxx:1029
 TPainter3dAlgorithms.cxx:1030
 TPainter3dAlgorithms.cxx:1031
 TPainter3dAlgorithms.cxx:1032
 TPainter3dAlgorithms.cxx:1033
 TPainter3dAlgorithms.cxx:1034
 TPainter3dAlgorithms.cxx:1035
 TPainter3dAlgorithms.cxx:1036
 TPainter3dAlgorithms.cxx:1037
 TPainter3dAlgorithms.cxx:1038
 TPainter3dAlgorithms.cxx:1039
 TPainter3dAlgorithms.cxx:1040
 TPainter3dAlgorithms.cxx:1041
 TPainter3dAlgorithms.cxx:1042
 TPainter3dAlgorithms.cxx:1043
 TPainter3dAlgorithms.cxx:1044
 TPainter3dAlgorithms.cxx:1045
 TPainter3dAlgorithms.cxx:1046
 TPainter3dAlgorithms.cxx:1047
 TPainter3dAlgorithms.cxx:1048
 TPainter3dAlgorithms.cxx:1049
 TPainter3dAlgorithms.cxx:1050
 TPainter3dAlgorithms.cxx:1051
 TPainter3dAlgorithms.cxx:1052
 TPainter3dAlgorithms.cxx:1053
 TPainter3dAlgorithms.cxx:1054
 TPainter3dAlgorithms.cxx:1055
 TPainter3dAlgorithms.cxx:1056
 TPainter3dAlgorithms.cxx:1057
 TPainter3dAlgorithms.cxx:1058
 TPainter3dAlgorithms.cxx:1059
 TPainter3dAlgorithms.cxx:1060
 TPainter3dAlgorithms.cxx:1061
 TPainter3dAlgorithms.cxx:1062
 TPainter3dAlgorithms.cxx:1063
 TPainter3dAlgorithms.cxx:1064
 TPainter3dAlgorithms.cxx:1065
 TPainter3dAlgorithms.cxx:1066
 TPainter3dAlgorithms.cxx:1067
 TPainter3dAlgorithms.cxx:1068
 TPainter3dAlgorithms.cxx:1069
 TPainter3dAlgorithms.cxx:1070
 TPainter3dAlgorithms.cxx:1071
 TPainter3dAlgorithms.cxx:1072
 TPainter3dAlgorithms.cxx:1073
 TPainter3dAlgorithms.cxx:1074
 TPainter3dAlgorithms.cxx:1075
 TPainter3dAlgorithms.cxx:1076
 TPainter3dAlgorithms.cxx:1077
 TPainter3dAlgorithms.cxx:1078
 TPainter3dAlgorithms.cxx:1079
 TPainter3dAlgorithms.cxx:1080
 TPainter3dAlgorithms.cxx:1081
 TPainter3dAlgorithms.cxx:1082
 TPainter3dAlgorithms.cxx:1083
 TPainter3dAlgorithms.cxx:1084
 TPainter3dAlgorithms.cxx:1085
 TPainter3dAlgorithms.cxx:1086
 TPainter3dAlgorithms.cxx:1087
 TPainter3dAlgorithms.cxx:1088
 TPainter3dAlgorithms.cxx:1089
 TPainter3dAlgorithms.cxx:1090
 TPainter3dAlgorithms.cxx:1091
 TPainter3dAlgorithms.cxx:1092
 TPainter3dAlgorithms.cxx:1093
 TPainter3dAlgorithms.cxx:1094
 TPainter3dAlgorithms.cxx:1095
 TPainter3dAlgorithms.cxx:1096
 TPainter3dAlgorithms.cxx:1097
 TPainter3dAlgorithms.cxx:1098
 TPainter3dAlgorithms.cxx:1099
 TPainter3dAlgorithms.cxx:1100
 TPainter3dAlgorithms.cxx:1101
 TPainter3dAlgorithms.cxx:1102
 TPainter3dAlgorithms.cxx:1103
 TPainter3dAlgorithms.cxx:1104
 TPainter3dAlgorithms.cxx:1105
 TPainter3dAlgorithms.cxx:1106
 TPainter3dAlgorithms.cxx:1107
 TPainter3dAlgorithms.cxx:1108
 TPainter3dAlgorithms.cxx:1109
 TPainter3dAlgorithms.cxx:1110
 TPainter3dAlgorithms.cxx:1111
 TPainter3dAlgorithms.cxx:1112
 TPainter3dAlgorithms.cxx:1113
 TPainter3dAlgorithms.cxx:1114
 TPainter3dAlgorithms.cxx:1115
 TPainter3dAlgorithms.cxx:1116
 TPainter3dAlgorithms.cxx:1117
 TPainter3dAlgorithms.cxx:1118
 TPainter3dAlgorithms.cxx:1119
 TPainter3dAlgorithms.cxx:1120
 TPainter3dAlgorithms.cxx:1121
 TPainter3dAlgorithms.cxx:1122
 TPainter3dAlgorithms.cxx:1123
 TPainter3dAlgorithms.cxx:1124
 TPainter3dAlgorithms.cxx:1125
 TPainter3dAlgorithms.cxx:1126
 TPainter3dAlgorithms.cxx:1127
 TPainter3dAlgorithms.cxx:1128
 TPainter3dAlgorithms.cxx:1129
 TPainter3dAlgorithms.cxx:1130
 TPainter3dAlgorithms.cxx:1131
 TPainter3dAlgorithms.cxx:1132
 TPainter3dAlgorithms.cxx:1133
 TPainter3dAlgorithms.cxx:1134
 TPainter3dAlgorithms.cxx:1135
 TPainter3dAlgorithms.cxx:1136
 TPainter3dAlgorithms.cxx:1137
 TPainter3dAlgorithms.cxx:1138
 TPainter3dAlgorithms.cxx:1139
 TPainter3dAlgorithms.cxx:1140
 TPainter3dAlgorithms.cxx:1141
 TPainter3dAlgorithms.cxx:1142
 TPainter3dAlgorithms.cxx:1143
 TPainter3dAlgorithms.cxx:1144
 TPainter3dAlgorithms.cxx:1145
 TPainter3dAlgorithms.cxx:1146
 TPainter3dAlgorithms.cxx:1147
 TPainter3dAlgorithms.cxx:1148
 TPainter3dAlgorithms.cxx:1149
 TPainter3dAlgorithms.cxx:1150
 TPainter3dAlgorithms.cxx:1151
 TPainter3dAlgorithms.cxx:1152
 TPainter3dAlgorithms.cxx:1153
 TPainter3dAlgorithms.cxx:1154
 TPainter3dAlgorithms.cxx:1155
 TPainter3dAlgorithms.cxx:1156
 TPainter3dAlgorithms.cxx:1157
 TPainter3dAlgorithms.cxx:1158
 TPainter3dAlgorithms.cxx:1159
 TPainter3dAlgorithms.cxx:1160
 TPainter3dAlgorithms.cxx:1161
 TPainter3dAlgorithms.cxx:1162
 TPainter3dAlgorithms.cxx:1163
 TPainter3dAlgorithms.cxx:1164
 TPainter3dAlgorithms.cxx:1165
 TPainter3dAlgorithms.cxx:1166
 TPainter3dAlgorithms.cxx:1167
 TPainter3dAlgorithms.cxx:1168
 TPainter3dAlgorithms.cxx:1169
 TPainter3dAlgorithms.cxx:1170
 TPainter3dAlgorithms.cxx:1171
 TPainter3dAlgorithms.cxx:1172
 TPainter3dAlgorithms.cxx:1173
 TPainter3dAlgorithms.cxx:1174
 TPainter3dAlgorithms.cxx:1175
 TPainter3dAlgorithms.cxx:1176
 TPainter3dAlgorithms.cxx:1177
 TPainter3dAlgorithms.cxx:1178
 TPainter3dAlgorithms.cxx:1179
 TPainter3dAlgorithms.cxx:1180
 TPainter3dAlgorithms.cxx:1181
 TPainter3dAlgorithms.cxx:1182
 TPainter3dAlgorithms.cxx:1183
 TPainter3dAlgorithms.cxx:1184
 TPainter3dAlgorithms.cxx:1185
 TPainter3dAlgorithms.cxx:1186
 TPainter3dAlgorithms.cxx:1187
 TPainter3dAlgorithms.cxx:1188
 TPainter3dAlgorithms.cxx:1189
 TPainter3dAlgorithms.cxx:1190
 TPainter3dAlgorithms.cxx:1191
 TPainter3dAlgorithms.cxx:1192
 TPainter3dAlgorithms.cxx:1193
 TPainter3dAlgorithms.cxx:1194
 TPainter3dAlgorithms.cxx:1195
 TPainter3dAlgorithms.cxx:1196
 TPainter3dAlgorithms.cxx:1197
 TPainter3dAlgorithms.cxx:1198
 TPainter3dAlgorithms.cxx:1199
 TPainter3dAlgorithms.cxx:1200
 TPainter3dAlgorithms.cxx:1201
 TPainter3dAlgorithms.cxx:1202
 TPainter3dAlgorithms.cxx:1203
 TPainter3dAlgorithms.cxx:1204
 TPainter3dAlgorithms.cxx:1205
 TPainter3dAlgorithms.cxx:1206
 TPainter3dAlgorithms.cxx:1207
 TPainter3dAlgorithms.cxx:1208
 TPainter3dAlgorithms.cxx:1209
 TPainter3dAlgorithms.cxx:1210
 TPainter3dAlgorithms.cxx:1211
 TPainter3dAlgorithms.cxx:1212
 TPainter3dAlgorithms.cxx:1213
 TPainter3dAlgorithms.cxx:1214
 TPainter3dAlgorithms.cxx:1215
 TPainter3dAlgorithms.cxx:1216
 TPainter3dAlgorithms.cxx:1217
 TPainter3dAlgorithms.cxx:1218
 TPainter3dAlgorithms.cxx:1219
 TPainter3dAlgorithms.cxx:1220
 TPainter3dAlgorithms.cxx:1221
 TPainter3dAlgorithms.cxx:1222
 TPainter3dAlgorithms.cxx:1223
 TPainter3dAlgorithms.cxx:1224
 TPainter3dAlgorithms.cxx:1225
 TPainter3dAlgorithms.cxx:1226
 TPainter3dAlgorithms.cxx:1227
 TPainter3dAlgorithms.cxx:1228
 TPainter3dAlgorithms.cxx:1229
 TPainter3dAlgorithms.cxx:1230
 TPainter3dAlgorithms.cxx:1231
 TPainter3dAlgorithms.cxx:1232
 TPainter3dAlgorithms.cxx:1233
 TPainter3dAlgorithms.cxx:1234
 TPainter3dAlgorithms.cxx:1235
 TPainter3dAlgorithms.cxx:1236
 TPainter3dAlgorithms.cxx:1237
 TPainter3dAlgorithms.cxx:1238
 TPainter3dAlgorithms.cxx:1239
 TPainter3dAlgorithms.cxx:1240
 TPainter3dAlgorithms.cxx:1241
 TPainter3dAlgorithms.cxx:1242
 TPainter3dAlgorithms.cxx:1243
 TPainter3dAlgorithms.cxx:1244
 TPainter3dAlgorithms.cxx:1245
 TPainter3dAlgorithms.cxx:1246
 TPainter3dAlgorithms.cxx:1247
 TPainter3dAlgorithms.cxx:1248
 TPainter3dAlgorithms.cxx:1249
 TPainter3dAlgorithms.cxx:1250
 TPainter3dAlgorithms.cxx:1251
 TPainter3dAlgorithms.cxx:1252
 TPainter3dAlgorithms.cxx:1253
 TPainter3dAlgorithms.cxx:1254
 TPainter3dAlgorithms.cxx:1255
 TPainter3dAlgorithms.cxx:1256
 TPainter3dAlgorithms.cxx:1257
 TPainter3dAlgorithms.cxx:1258
 TPainter3dAlgorithms.cxx:1259
 TPainter3dAlgorithms.cxx:1260
 TPainter3dAlgorithms.cxx:1261
 TPainter3dAlgorithms.cxx:1262
 TPainter3dAlgorithms.cxx:1263
 TPainter3dAlgorithms.cxx:1264
 TPainter3dAlgorithms.cxx:1265
 TPainter3dAlgorithms.cxx:1266
 TPainter3dAlgorithms.cxx:1267
 TPainter3dAlgorithms.cxx:1268
 TPainter3dAlgorithms.cxx:1269
 TPainter3dAlgorithms.cxx:1270
 TPainter3dAlgorithms.cxx:1271
 TPainter3dAlgorithms.cxx:1272
 TPainter3dAlgorithms.cxx:1273
 TPainter3dAlgorithms.cxx:1274
 TPainter3dAlgorithms.cxx:1275
 TPainter3dAlgorithms.cxx:1276
 TPainter3dAlgorithms.cxx:1277
 TPainter3dAlgorithms.cxx:1278
 TPainter3dAlgorithms.cxx:1279
 TPainter3dAlgorithms.cxx:1280
 TPainter3dAlgorithms.cxx:1281
 TPainter3dAlgorithms.cxx:1282
 TPainter3dAlgorithms.cxx:1283
 TPainter3dAlgorithms.cxx:1284
 TPainter3dAlgorithms.cxx:1285
 TPainter3dAlgorithms.cxx:1286
 TPainter3dAlgorithms.cxx:1287
 TPainter3dAlgorithms.cxx:1288
 TPainter3dAlgorithms.cxx:1289
 TPainter3dAlgorithms.cxx:1290
 TPainter3dAlgorithms.cxx:1291
 TPainter3dAlgorithms.cxx:1292
 TPainter3dAlgorithms.cxx:1293
 TPainter3dAlgorithms.cxx:1294
 TPainter3dAlgorithms.cxx:1295
 TPainter3dAlgorithms.cxx:1296
 TPainter3dAlgorithms.cxx:1297
 TPainter3dAlgorithms.cxx:1298
 TPainter3dAlgorithms.cxx:1299
 TPainter3dAlgorithms.cxx:1300
 TPainter3dAlgorithms.cxx:1301
 TPainter3dAlgorithms.cxx:1302
 TPainter3dAlgorithms.cxx:1303
 TPainter3dAlgorithms.cxx:1304
 TPainter3dAlgorithms.cxx:1305
 TPainter3dAlgorithms.cxx:1306
 TPainter3dAlgorithms.cxx:1307
 TPainter3dAlgorithms.cxx:1308
 TPainter3dAlgorithms.cxx:1309
 TPainter3dAlgorithms.cxx:1310
 TPainter3dAlgorithms.cxx:1311
 TPainter3dAlgorithms.cxx:1312
 TPainter3dAlgorithms.cxx:1313
 TPainter3dAlgorithms.cxx:1314
 TPainter3dAlgorithms.cxx:1315
 TPainter3dAlgorithms.cxx:1316
 TPainter3dAlgorithms.cxx:1317
 TPainter3dAlgorithms.cxx:1318
 TPainter3dAlgorithms.cxx:1319
 TPainter3dAlgorithms.cxx:1320
 TPainter3dAlgorithms.cxx:1321
 TPainter3dAlgorithms.cxx:1322
 TPainter3dAlgorithms.cxx:1323
 TPainter3dAlgorithms.cxx:1324
 TPainter3dAlgorithms.cxx:1325
 TPainter3dAlgorithms.cxx:1326
 TPainter3dAlgorithms.cxx:1327
 TPainter3dAlgorithms.cxx:1328
 TPainter3dAlgorithms.cxx:1329
 TPainter3dAlgorithms.cxx:1330
 TPainter3dAlgorithms.cxx:1331
 TPainter3dAlgorithms.cxx:1332
 TPainter3dAlgorithms.cxx:1333
 TPainter3dAlgorithms.cxx:1334
 TPainter3dAlgorithms.cxx:1335
 TPainter3dAlgorithms.cxx:1336
 TPainter3dAlgorithms.cxx:1337
 TPainter3dAlgorithms.cxx:1338
 TPainter3dAlgorithms.cxx:1339
 TPainter3dAlgorithms.cxx:1340
 TPainter3dAlgorithms.cxx:1341
 TPainter3dAlgorithms.cxx:1342
 TPainter3dAlgorithms.cxx:1343
 TPainter3dAlgorithms.cxx:1344
 TPainter3dAlgorithms.cxx:1345
 TPainter3dAlgorithms.cxx:1346
 TPainter3dAlgorithms.cxx:1347
 TPainter3dAlgorithms.cxx:1348
 TPainter3dAlgorithms.cxx:1349
 TPainter3dAlgorithms.cxx:1350
 TPainter3dAlgorithms.cxx:1351
 TPainter3dAlgorithms.cxx:1352
 TPainter3dAlgorithms.cxx:1353
 TPainter3dAlgorithms.cxx:1354
 TPainter3dAlgorithms.cxx:1355
 TPainter3dAlgorithms.cxx:1356
 TPainter3dAlgorithms.cxx:1357
 TPainter3dAlgorithms.cxx:1358
 TPainter3dAlgorithms.cxx:1359
 TPainter3dAlgorithms.cxx:1360
 TPainter3dAlgorithms.cxx:1361
 TPainter3dAlgorithms.cxx:1362
 TPainter3dAlgorithms.cxx:1363
 TPainter3dAlgorithms.cxx:1364
 TPainter3dAlgorithms.cxx:1365
 TPainter3dAlgorithms.cxx:1366
 TPainter3dAlgorithms.cxx:1367
 TPainter3dAlgorithms.cxx:1368
 TPainter3dAlgorithms.cxx:1369
 TPainter3dAlgorithms.cxx:1370
 TPainter3dAlgorithms.cxx:1371
 TPainter3dAlgorithms.cxx:1372
 TPainter3dAlgorithms.cxx:1373
 TPainter3dAlgorithms.cxx:1374
 TPainter3dAlgorithms.cxx:1375
 TPainter3dAlgorithms.cxx:1376
 TPainter3dAlgorithms.cxx:1377
 TPainter3dAlgorithms.cxx:1378
 TPainter3dAlgorithms.cxx:1379
 TPainter3dAlgorithms.cxx:1380
 TPainter3dAlgorithms.cxx:1381
 TPainter3dAlgorithms.cxx:1382
 TPainter3dAlgorithms.cxx:1383
 TPainter3dAlgorithms.cxx:1384
 TPainter3dAlgorithms.cxx:1385
 TPainter3dAlgorithms.cxx:1386
 TPainter3dAlgorithms.cxx:1387
 TPainter3dAlgorithms.cxx:1388
 TPainter3dAlgorithms.cxx:1389
 TPainter3dAlgorithms.cxx:1390
 TPainter3dAlgorithms.cxx:1391
 TPainter3dAlgorithms.cxx:1392
 TPainter3dAlgorithms.cxx:1393
 TPainter3dAlgorithms.cxx:1394
 TPainter3dAlgorithms.cxx:1395
 TPainter3dAlgorithms.cxx:1396
 TPainter3dAlgorithms.cxx:1397
 TPainter3dAlgorithms.cxx:1398
 TPainter3dAlgorithms.cxx:1399
 TPainter3dAlgorithms.cxx:1400
 TPainter3dAlgorithms.cxx:1401
 TPainter3dAlgorithms.cxx:1402
 TPainter3dAlgorithms.cxx:1403
 TPainter3dAlgorithms.cxx:1404
 TPainter3dAlgorithms.cxx:1405
 TPainter3dAlgorithms.cxx:1406
 TPainter3dAlgorithms.cxx:1407
 TPainter3dAlgorithms.cxx:1408
 TPainter3dAlgorithms.cxx:1409
 TPainter3dAlgorithms.cxx:1410
 TPainter3dAlgorithms.cxx:1411
 TPainter3dAlgorithms.cxx:1412
 TPainter3dAlgorithms.cxx:1413
 TPainter3dAlgorithms.cxx:1414
 TPainter3dAlgorithms.cxx:1415
 TPainter3dAlgorithms.cxx:1416
 TPainter3dAlgorithms.cxx:1417
 TPainter3dAlgorithms.cxx:1418
 TPainter3dAlgorithms.cxx:1419
 TPainter3dAlgorithms.cxx:1420
 TPainter3dAlgorithms.cxx:1421
 TPainter3dAlgorithms.cxx:1422
 TPainter3dAlgorithms.cxx:1423
 TPainter3dAlgorithms.cxx:1424
 TPainter3dAlgorithms.cxx:1425
 TPainter3dAlgorithms.cxx:1426
 TPainter3dAlgorithms.cxx:1427
 TPainter3dAlgorithms.cxx:1428
 TPainter3dAlgorithms.cxx:1429
 TPainter3dAlgorithms.cxx:1430
 TPainter3dAlgorithms.cxx:1431
 TPainter3dAlgorithms.cxx:1432
 TPainter3dAlgorithms.cxx:1433
 TPainter3dAlgorithms.cxx:1434
 TPainter3dAlgorithms.cxx:1435
 TPainter3dAlgorithms.cxx:1436
 TPainter3dAlgorithms.cxx:1437
 TPainter3dAlgorithms.cxx:1438
 TPainter3dAlgorithms.cxx:1439
 TPainter3dAlgorithms.cxx:1440
 TPainter3dAlgorithms.cxx:1441
 TPainter3dAlgorithms.cxx:1442
 TPainter3dAlgorithms.cxx:1443
 TPainter3dAlgorithms.cxx:1444
 TPainter3dAlgorithms.cxx:1445
 TPainter3dAlgorithms.cxx:1446
 TPainter3dAlgorithms.cxx:1447
 TPainter3dAlgorithms.cxx:1448
 TPainter3dAlgorithms.cxx:1449
 TPainter3dAlgorithms.cxx:1450
 TPainter3dAlgorithms.cxx:1451
 TPainter3dAlgorithms.cxx:1452
 TPainter3dAlgorithms.cxx:1453
 TPainter3dAlgorithms.cxx:1454
 TPainter3dAlgorithms.cxx:1455
 TPainter3dAlgorithms.cxx:1456
 TPainter3dAlgorithms.cxx:1457
 TPainter3dAlgorithms.cxx:1458
 TPainter3dAlgorithms.cxx:1459
 TPainter3dAlgorithms.cxx:1460
 TPainter3dAlgorithms.cxx:1461
 TPainter3dAlgorithms.cxx:1462
 TPainter3dAlgorithms.cxx:1463
 TPainter3dAlgorithms.cxx:1464
 TPainter3dAlgorithms.cxx:1465
 TPainter3dAlgorithms.cxx:1466
 TPainter3dAlgorithms.cxx:1467
 TPainter3dAlgorithms.cxx:1468
 TPainter3dAlgorithms.cxx:1469
 TPainter3dAlgorithms.cxx:1470
 TPainter3dAlgorithms.cxx:1471
 TPainter3dAlgorithms.cxx:1472
 TPainter3dAlgorithms.cxx:1473
 TPainter3dAlgorithms.cxx:1474
 TPainter3dAlgorithms.cxx:1475
 TPainter3dAlgorithms.cxx:1476
 TPainter3dAlgorithms.cxx:1477
 TPainter3dAlgorithms.cxx:1478
 TPainter3dAlgorithms.cxx:1479
 TPainter3dAlgorithms.cxx:1480
 TPainter3dAlgorithms.cxx:1481
 TPainter3dAlgorithms.cxx:1482
 TPainter3dAlgorithms.cxx:1483
 TPainter3dAlgorithms.cxx:1484
 TPainter3dAlgorithms.cxx:1485
 TPainter3dAlgorithms.cxx:1486
 TPainter3dAlgorithms.cxx:1487
 TPainter3dAlgorithms.cxx:1488
 TPainter3dAlgorithms.cxx:1489
 TPainter3dAlgorithms.cxx:1490
 TPainter3dAlgorithms.cxx:1491
 TPainter3dAlgorithms.cxx:1492
 TPainter3dAlgorithms.cxx:1493
 TPainter3dAlgorithms.cxx:1494
 TPainter3dAlgorithms.cxx:1495
 TPainter3dAlgorithms.cxx:1496
 TPainter3dAlgorithms.cxx:1497
 TPainter3dAlgorithms.cxx:1498
 TPainter3dAlgorithms.cxx:1499
 TPainter3dAlgorithms.cxx:1500
 TPainter3dAlgorithms.cxx:1501
 TPainter3dAlgorithms.cxx:1502
 TPainter3dAlgorithms.cxx:1503
 TPainter3dAlgorithms.cxx:1504
 TPainter3dAlgorithms.cxx:1505
 TPainter3dAlgorithms.cxx:1506
 TPainter3dAlgorithms.cxx:1507
 TPainter3dAlgorithms.cxx:1508
 TPainter3dAlgorithms.cxx:1509
 TPainter3dAlgorithms.cxx:1510
 TPainter3dAlgorithms.cxx:1511
 TPainter3dAlgorithms.cxx:1512
 TPainter3dAlgorithms.cxx:1513
 TPainter3dAlgorithms.cxx:1514
 TPainter3dAlgorithms.cxx:1515
 TPainter3dAlgorithms.cxx:1516
 TPainter3dAlgorithms.cxx:1517
 TPainter3dAlgorithms.cxx:1518
 TPainter3dAlgorithms.cxx:1519
 TPainter3dAlgorithms.cxx:1520
 TPainter3dAlgorithms.cxx:1521
 TPainter3dAlgorithms.cxx:1522
 TPainter3dAlgorithms.cxx:1523
 TPainter3dAlgorithms.cxx:1524
 TPainter3dAlgorithms.cxx:1525
 TPainter3dAlgorithms.cxx:1526
 TPainter3dAlgorithms.cxx:1527
 TPainter3dAlgorithms.cxx:1528
 TPainter3dAlgorithms.cxx:1529
 TPainter3dAlgorithms.cxx:1530
 TPainter3dAlgorithms.cxx:1531
 TPainter3dAlgorithms.cxx:1532
 TPainter3dAlgorithms.cxx:1533
 TPainter3dAlgorithms.cxx:1534
 TPainter3dAlgorithms.cxx:1535
 TPainter3dAlgorithms.cxx:1536
 TPainter3dAlgorithms.cxx:1537
 TPainter3dAlgorithms.cxx:1538
 TPainter3dAlgorithms.cxx:1539
 TPainter3dAlgorithms.cxx:1540
 TPainter3dAlgorithms.cxx:1541
 TPainter3dAlgorithms.cxx:1542
 TPainter3dAlgorithms.cxx:1543
 TPainter3dAlgorithms.cxx:1544
 TPainter3dAlgorithms.cxx:1545
 TPainter3dAlgorithms.cxx:1546
 TPainter3dAlgorithms.cxx:1547
 TPainter3dAlgorithms.cxx:1548
 TPainter3dAlgorithms.cxx:1549
 TPainter3dAlgorithms.cxx:1550
 TPainter3dAlgorithms.cxx:1551
 TPainter3dAlgorithms.cxx:1552
 TPainter3dAlgorithms.cxx:1553
 TPainter3dAlgorithms.cxx:1554
 TPainter3dAlgorithms.cxx:1555
 TPainter3dAlgorithms.cxx:1556
 TPainter3dAlgorithms.cxx:1557
 TPainter3dAlgorithms.cxx:1558
 TPainter3dAlgorithms.cxx:1559
 TPainter3dAlgorithms.cxx:1560
 TPainter3dAlgorithms.cxx:1561
 TPainter3dAlgorithms.cxx:1562
 TPainter3dAlgorithms.cxx:1563
 TPainter3dAlgorithms.cxx:1564
 TPainter3dAlgorithms.cxx:1565
 TPainter3dAlgorithms.cxx:1566
 TPainter3dAlgorithms.cxx:1567
 TPainter3dAlgorithms.cxx:1568
 TPainter3dAlgorithms.cxx:1569
 TPainter3dAlgorithms.cxx:1570
 TPainter3dAlgorithms.cxx:1571
 TPainter3dAlgorithms.cxx:1572
 TPainter3dAlgorithms.cxx:1573
 TPainter3dAlgorithms.cxx:1574
 TPainter3dAlgorithms.cxx:1575
 TPainter3dAlgorithms.cxx:1576
 TPainter3dAlgorithms.cxx:1577
 TPainter3dAlgorithms.cxx:1578
 TPainter3dAlgorithms.cxx:1579
 TPainter3dAlgorithms.cxx:1580
 TPainter3dAlgorithms.cxx:1581
 TPainter3dAlgorithms.cxx:1582
 TPainter3dAlgorithms.cxx:1583
 TPainter3dAlgorithms.cxx:1584
 TPainter3dAlgorithms.cxx:1585
 TPainter3dAlgorithms.cxx:1586
 TPainter3dAlgorithms.cxx:1587
 TPainter3dAlgorithms.cxx:1588
 TPainter3dAlgorithms.cxx:1589
 TPainter3dAlgorithms.cxx:1590
 TPainter3dAlgorithms.cxx:1591
 TPainter3dAlgorithms.cxx:1592
 TPainter3dAlgorithms.cxx:1593
 TPainter3dAlgorithms.cxx:1594
 TPainter3dAlgorithms.cxx:1595
 TPainter3dAlgorithms.cxx:1596
 TPainter3dAlgorithms.cxx:1597
 TPainter3dAlgorithms.cxx:1598
 TPainter3dAlgorithms.cxx:1599
 TPainter3dAlgorithms.cxx:1600
 TPainter3dAlgorithms.cxx:1601
 TPainter3dAlgorithms.cxx:1602
 TPainter3dAlgorithms.cxx:1603
 TPainter3dAlgorithms.cxx:1604
 TPainter3dAlgorithms.cxx:1605
 TPainter3dAlgorithms.cxx:1606
 TPainter3dAlgorithms.cxx:1607
 TPainter3dAlgorithms.cxx:1608
 TPainter3dAlgorithms.cxx:1609
 TPainter3dAlgorithms.cxx:1610
 TPainter3dAlgorithms.cxx:1611
 TPainter3dAlgorithms.cxx:1612
 TPainter3dAlgorithms.cxx:1613
 TPainter3dAlgorithms.cxx:1614
 TPainter3dAlgorithms.cxx:1615
 TPainter3dAlgorithms.cxx:1616
 TPainter3dAlgorithms.cxx:1617
 TPainter3dAlgorithms.cxx:1618
 TPainter3dAlgorithms.cxx:1619
 TPainter3dAlgorithms.cxx:1620
 TPainter3dAlgorithms.cxx:1621
 TPainter3dAlgorithms.cxx:1622
 TPainter3dAlgorithms.cxx:1623
 TPainter3dAlgorithms.cxx:1624
 TPainter3dAlgorithms.cxx:1625
 TPainter3dAlgorithms.cxx:1626
 TPainter3dAlgorithms.cxx:1627
 TPainter3dAlgorithms.cxx:1628
 TPainter3dAlgorithms.cxx:1629
 TPainter3dAlgorithms.cxx:1630
 TPainter3dAlgorithms.cxx:1631
 TPainter3dAlgorithms.cxx:1632
 TPainter3dAlgorithms.cxx:1633
 TPainter3dAlgorithms.cxx:1634
 TPainter3dAlgorithms.cxx:1635
 TPainter3dAlgorithms.cxx:1636
 TPainter3dAlgorithms.cxx:1637
 TPainter3dAlgorithms.cxx:1638
 TPainter3dAlgorithms.cxx:1639
 TPainter3dAlgorithms.cxx:1640
 TPainter3dAlgorithms.cxx:1641
 TPainter3dAlgorithms.cxx:1642
 TPainter3dAlgorithms.cxx:1643
 TPainter3dAlgorithms.cxx:1644
 TPainter3dAlgorithms.cxx:1645
 TPainter3dAlgorithms.cxx:1646
 TPainter3dAlgorithms.cxx:1647
 TPainter3dAlgorithms.cxx:1648
 TPainter3dAlgorithms.cxx:1649
 TPainter3dAlgorithms.cxx:1650
 TPainter3dAlgorithms.cxx:1651
 TPainter3dAlgorithms.cxx:1652
 TPainter3dAlgorithms.cxx:1653
 TPainter3dAlgorithms.cxx:1654
 TPainter3dAlgorithms.cxx:1655
 TPainter3dAlgorithms.cxx:1656
 TPainter3dAlgorithms.cxx:1657
 TPainter3dAlgorithms.cxx:1658
 TPainter3dAlgorithms.cxx:1659
 TPainter3dAlgorithms.cxx:1660
 TPainter3dAlgorithms.cxx:1661
 TPainter3dAlgorithms.cxx:1662
 TPainter3dAlgorithms.cxx:1663
 TPainter3dAlgorithms.cxx:1664
 TPainter3dAlgorithms.cxx:1665
 TPainter3dAlgorithms.cxx:1666
 TPainter3dAlgorithms.cxx:1667
 TPainter3dAlgorithms.cxx:1668
 TPainter3dAlgorithms.cxx:1669
 TPainter3dAlgorithms.cxx:1670
 TPainter3dAlgorithms.cxx:1671
 TPainter3dAlgorithms.cxx:1672
 TPainter3dAlgorithms.cxx:1673
 TPainter3dAlgorithms.cxx:1674
 TPainter3dAlgorithms.cxx:1675
 TPainter3dAlgorithms.cxx:1676
 TPainter3dAlgorithms.cxx:1677
 TPainter3dAlgorithms.cxx:1678
 TPainter3dAlgorithms.cxx:1679
 TPainter3dAlgorithms.cxx:1680
 TPainter3dAlgorithms.cxx:1681
 TPainter3dAlgorithms.cxx:1682
 TPainter3dAlgorithms.cxx:1683
 TPainter3dAlgorithms.cxx:1684
 TPainter3dAlgorithms.cxx:1685
 TPainter3dAlgorithms.cxx:1686
 TPainter3dAlgorithms.cxx:1687
 TPainter3dAlgorithms.cxx:1688
 TPainter3dAlgorithms.cxx:1689
 TPainter3dAlgorithms.cxx:1690
 TPainter3dAlgorithms.cxx:1691
 TPainter3dAlgorithms.cxx:1692
 TPainter3dAlgorithms.cxx:1693
 TPainter3dAlgorithms.cxx:1694
 TPainter3dAlgorithms.cxx:1695
 TPainter3dAlgorithms.cxx:1696
 TPainter3dAlgorithms.cxx:1697
 TPainter3dAlgorithms.cxx:1698
 TPainter3dAlgorithms.cxx:1699
 TPainter3dAlgorithms.cxx:1700
 TPainter3dAlgorithms.cxx:1701
 TPainter3dAlgorithms.cxx:1702
 TPainter3dAlgorithms.cxx:1703
 TPainter3dAlgorithms.cxx:1704
 TPainter3dAlgorithms.cxx:1705
 TPainter3dAlgorithms.cxx:1706
 TPainter3dAlgorithms.cxx:1707
 TPainter3dAlgorithms.cxx:1708
 TPainter3dAlgorithms.cxx:1709
 TPainter3dAlgorithms.cxx:1710
 TPainter3dAlgorithms.cxx:1711
 TPainter3dAlgorithms.cxx:1712
 TPainter3dAlgorithms.cxx:1713
 TPainter3dAlgorithms.cxx:1714
 TPainter3dAlgorithms.cxx:1715
 TPainter3dAlgorithms.cxx:1716
 TPainter3dAlgorithms.cxx:1717
 TPainter3dAlgorithms.cxx:1718
 TPainter3dAlgorithms.cxx:1719
 TPainter3dAlgorithms.cxx:1720
 TPainter3dAlgorithms.cxx:1721
 TPainter3dAlgorithms.cxx:1722
 TPainter3dAlgorithms.cxx:1723
 TPainter3dAlgorithms.cxx:1724
 TPainter3dAlgorithms.cxx:1725
 TPainter3dAlgorithms.cxx:1726
 TPainter3dAlgorithms.cxx:1727
 TPainter3dAlgorithms.cxx:1728
 TPainter3dAlgorithms.cxx:1729
 TPainter3dAlgorithms.cxx:1730
 TPainter3dAlgorithms.cxx:1731
 TPainter3dAlgorithms.cxx:1732
 TPainter3dAlgorithms.cxx:1733
 TPainter3dAlgorithms.cxx:1734
 TPainter3dAlgorithms.cxx:1735
 TPainter3dAlgorithms.cxx:1736
 TPainter3dAlgorithms.cxx:1737
 TPainter3dAlgorithms.cxx:1738
 TPainter3dAlgorithms.cxx:1739
 TPainter3dAlgorithms.cxx:1740
 TPainter3dAlgorithms.cxx:1741
 TPainter3dAlgorithms.cxx:1742
 TPainter3dAlgorithms.cxx:1743
 TPainter3dAlgorithms.cxx:1744
 TPainter3dAlgorithms.cxx:1745
 TPainter3dAlgorithms.cxx:1746
 TPainter3dAlgorithms.cxx:1747
 TPainter3dAlgorithms.cxx:1748
 TPainter3dAlgorithms.cxx:1749
 TPainter3dAlgorithms.cxx:1750
 TPainter3dAlgorithms.cxx:1751
 TPainter3dAlgorithms.cxx:1752
 TPainter3dAlgorithms.cxx:1753
 TPainter3dAlgorithms.cxx:1754
 TPainter3dAlgorithms.cxx:1755
 TPainter3dAlgorithms.cxx:1756
 TPainter3dAlgorithms.cxx:1757
 TPainter3dAlgorithms.cxx:1758
 TPainter3dAlgorithms.cxx:1759
 TPainter3dAlgorithms.cxx:1760
 TPainter3dAlgorithms.cxx:1761
 TPainter3dAlgorithms.cxx:1762
 TPainter3dAlgorithms.cxx:1763
 TPainter3dAlgorithms.cxx:1764
 TPainter3dAlgorithms.cxx:1765
 TPainter3dAlgorithms.cxx:1766
 TPainter3dAlgorithms.cxx:1767
 TPainter3dAlgorithms.cxx:1768
 TPainter3dAlgorithms.cxx:1769
 TPainter3dAlgorithms.cxx:1770
 TPainter3dAlgorithms.cxx:1771
 TPainter3dAlgorithms.cxx:1772
 TPainter3dAlgorithms.cxx:1773
 TPainter3dAlgorithms.cxx:1774
 TPainter3dAlgorithms.cxx:1775
 TPainter3dAlgorithms.cxx:1776
 TPainter3dAlgorithms.cxx:1777
 TPainter3dAlgorithms.cxx:1778
 TPainter3dAlgorithms.cxx:1779
 TPainter3dAlgorithms.cxx:1780
 TPainter3dAlgorithms.cxx:1781
 TPainter3dAlgorithms.cxx:1782
 TPainter3dAlgorithms.cxx:1783
 TPainter3dAlgorithms.cxx:1784
 TPainter3dAlgorithms.cxx:1785
 TPainter3dAlgorithms.cxx:1786
 TPainter3dAlgorithms.cxx:1787
 TPainter3dAlgorithms.cxx:1788
 TPainter3dAlgorithms.cxx:1789
 TPainter3dAlgorithms.cxx:1790
 TPainter3dAlgorithms.cxx:1791
 TPainter3dAlgorithms.cxx:1792
 TPainter3dAlgorithms.cxx:1793
 TPainter3dAlgorithms.cxx:1794
 TPainter3dAlgorithms.cxx:1795
 TPainter3dAlgorithms.cxx:1796
 TPainter3dAlgorithms.cxx:1797
 TPainter3dAlgorithms.cxx:1798
 TPainter3dAlgorithms.cxx:1799
 TPainter3dAlgorithms.cxx:1800
 TPainter3dAlgorithms.cxx:1801
 TPainter3dAlgorithms.cxx:1802
 TPainter3dAlgorithms.cxx:1803
 TPainter3dAlgorithms.cxx:1804
 TPainter3dAlgorithms.cxx:1805
 TPainter3dAlgorithms.cxx:1806
 TPainter3dAlgorithms.cxx:1807
 TPainter3dAlgorithms.cxx:1808
 TPainter3dAlgorithms.cxx:1809
 TPainter3dAlgorithms.cxx:1810
 TPainter3dAlgorithms.cxx:1811
 TPainter3dAlgorithms.cxx:1812
 TPainter3dAlgorithms.cxx:1813
 TPainter3dAlgorithms.cxx:1814
 TPainter3dAlgorithms.cxx:1815
 TPainter3dAlgorithms.cxx:1816
 TPainter3dAlgorithms.cxx:1817
 TPainter3dAlgorithms.cxx:1818
 TPainter3dAlgorithms.cxx:1819
 TPainter3dAlgorithms.cxx:1820
 TPainter3dAlgorithms.cxx:1821
 TPainter3dAlgorithms.cxx:1822
 TPainter3dAlgorithms.cxx:1823
 TPainter3dAlgorithms.cxx:1824
 TPainter3dAlgorithms.cxx:1825
 TPainter3dAlgorithms.cxx:1826
 TPainter3dAlgorithms.cxx:1827
 TPainter3dAlgorithms.cxx:1828
 TPainter3dAlgorithms.cxx:1829
 TPainter3dAlgorithms.cxx:1830
 TPainter3dAlgorithms.cxx:1831
 TPainter3dAlgorithms.cxx:1832
 TPainter3dAlgorithms.cxx:1833
 TPainter3dAlgorithms.cxx:1834
 TPainter3dAlgorithms.cxx:1835
 TPainter3dAlgorithms.cxx:1836
 TPainter3dAlgorithms.cxx:1837
 TPainter3dAlgorithms.cxx:1838
 TPainter3dAlgorithms.cxx:1839
 TPainter3dAlgorithms.cxx:1840
 TPainter3dAlgorithms.cxx:1841
 TPainter3dAlgorithms.cxx:1842
 TPainter3dAlgorithms.cxx:1843
 TPainter3dAlgorithms.cxx:1844
 TPainter3dAlgorithms.cxx:1845
 TPainter3dAlgorithms.cxx:1846
 TPainter3dAlgorithms.cxx:1847
 TPainter3dAlgorithms.cxx:1848
 TPainter3dAlgorithms.cxx:1849
 TPainter3dAlgorithms.cxx:1850
 TPainter3dAlgorithms.cxx:1851
 TPainter3dAlgorithms.cxx:1852
 TPainter3dAlgorithms.cxx:1853
 TPainter3dAlgorithms.cxx:1854
 TPainter3dAlgorithms.cxx:1855
 TPainter3dAlgorithms.cxx:1856
 TPainter3dAlgorithms.cxx:1857
 TPainter3dAlgorithms.cxx:1858
 TPainter3dAlgorithms.cxx:1859
 TPainter3dAlgorithms.cxx:1860
 TPainter3dAlgorithms.cxx:1861
 TPainter3dAlgorithms.cxx:1862
 TPainter3dAlgorithms.cxx:1863
 TPainter3dAlgorithms.cxx:1864
 TPainter3dAlgorithms.cxx:1865
 TPainter3dAlgorithms.cxx:1866
 TPainter3dAlgorithms.cxx:1867
 TPainter3dAlgorithms.cxx:1868
 TPainter3dAlgorithms.cxx:1869
 TPainter3dAlgorithms.cxx:1870
 TPainter3dAlgorithms.cxx:1871
 TPainter3dAlgorithms.cxx:1872
 TPainter3dAlgorithms.cxx:1873
 TPainter3dAlgorithms.cxx:1874
 TPainter3dAlgorithms.cxx:1875
 TPainter3dAlgorithms.cxx:1876
 TPainter3dAlgorithms.cxx:1877
 TPainter3dAlgorithms.cxx:1878
 TPainter3dAlgorithms.cxx:1879
 TPainter3dAlgorithms.cxx:1880
 TPainter3dAlgorithms.cxx:1881
 TPainter3dAlgorithms.cxx:1882
 TPainter3dAlgorithms.cxx:1883
 TPainter3dAlgorithms.cxx:1884
 TPainter3dAlgorithms.cxx:1885
 TPainter3dAlgorithms.cxx:1886
 TPainter3dAlgorithms.cxx:1887
 TPainter3dAlgorithms.cxx:1888
 TPainter3dAlgorithms.cxx:1889
 TPainter3dAlgorithms.cxx:1890
 TPainter3dAlgorithms.cxx:1891
 TPainter3dAlgorithms.cxx:1892
 TPainter3dAlgorithms.cxx:1893
 TPainter3dAlgorithms.cxx:1894
 TPainter3dAlgorithms.cxx:1895
 TPainter3dAlgorithms.cxx:1896
 TPainter3dAlgorithms.cxx:1897
 TPainter3dAlgorithms.cxx:1898
 TPainter3dAlgorithms.cxx:1899
 TPainter3dAlgorithms.cxx:1900
 TPainter3dAlgorithms.cxx:1901
 TPainter3dAlgorithms.cxx:1902
 TPainter3dAlgorithms.cxx:1903
 TPainter3dAlgorithms.cxx:1904
 TPainter3dAlgorithms.cxx:1905
 TPainter3dAlgorithms.cxx:1906
 TPainter3dAlgorithms.cxx:1907
 TPainter3dAlgorithms.cxx:1908
 TPainter3dAlgorithms.cxx:1909
 TPainter3dAlgorithms.cxx:1910
 TPainter3dAlgorithms.cxx:1911
 TPainter3dAlgorithms.cxx:1912
 TPainter3dAlgorithms.cxx:1913
 TPainter3dAlgorithms.cxx:1914
 TPainter3dAlgorithms.cxx:1915
 TPainter3dAlgorithms.cxx:1916
 TPainter3dAlgorithms.cxx:1917
 TPainter3dAlgorithms.cxx:1918
 TPainter3dAlgorithms.cxx:1919
 TPainter3dAlgorithms.cxx:1920
 TPainter3dAlgorithms.cxx:1921
 TPainter3dAlgorithms.cxx:1922
 TPainter3dAlgorithms.cxx:1923
 TPainter3dAlgorithms.cxx:1924
 TPainter3dAlgorithms.cxx:1925
 TPainter3dAlgorithms.cxx:1926
 TPainter3dAlgorithms.cxx:1927
 TPainter3dAlgorithms.cxx:1928
 TPainter3dAlgorithms.cxx:1929
 TPainter3dAlgorithms.cxx:1930
 TPainter3dAlgorithms.cxx:1931
 TPainter3dAlgorithms.cxx:1932
 TPainter3dAlgorithms.cxx:1933
 TPainter3dAlgorithms.cxx:1934
 TPainter3dAlgorithms.cxx:1935
 TPainter3dAlgorithms.cxx:1936
 TPainter3dAlgorithms.cxx:1937
 TPainter3dAlgorithms.cxx:1938
 TPainter3dAlgorithms.cxx:1939
 TPainter3dAlgorithms.cxx:1940
 TPainter3dAlgorithms.cxx:1941
 TPainter3dAlgorithms.cxx:1942
 TPainter3dAlgorithms.cxx:1943
 TPainter3dAlgorithms.cxx:1944
 TPainter3dAlgorithms.cxx:1945
 TPainter3dAlgorithms.cxx:1946
 TPainter3dAlgorithms.cxx:1947
 TPainter3dAlgorithms.cxx:1948
 TPainter3dAlgorithms.cxx:1949
 TPainter3dAlgorithms.cxx:1950
 TPainter3dAlgorithms.cxx:1951
 TPainter3dAlgorithms.cxx:1952
 TPainter3dAlgorithms.cxx:1953
 TPainter3dAlgorithms.cxx:1954
 TPainter3dAlgorithms.cxx:1955
 TPainter3dAlgorithms.cxx:1956
 TPainter3dAlgorithms.cxx:1957
 TPainter3dAlgorithms.cxx:1958
 TPainter3dAlgorithms.cxx:1959
 TPainter3dAlgorithms.cxx:1960
 TPainter3dAlgorithms.cxx:1961
 TPainter3dAlgorithms.cxx:1962
 TPainter3dAlgorithms.cxx:1963
 TPainter3dAlgorithms.cxx:1964
 TPainter3dAlgorithms.cxx:1965
 TPainter3dAlgorithms.cxx:1966
 TPainter3dAlgorithms.cxx:1967
 TPainter3dAlgorithms.cxx:1968
 TPainter3dAlgorithms.cxx:1969
 TPainter3dAlgorithms.cxx:1970
 TPainter3dAlgorithms.cxx:1971
 TPainter3dAlgorithms.cxx:1972
 TPainter3dAlgorithms.cxx:1973
 TPainter3dAlgorithms.cxx:1974
 TPainter3dAlgorithms.cxx:1975
 TPainter3dAlgorithms.cxx:1976
 TPainter3dAlgorithms.cxx:1977
 TPainter3dAlgorithms.cxx:1978
 TPainter3dAlgorithms.cxx:1979
 TPainter3dAlgorithms.cxx:1980
 TPainter3dAlgorithms.cxx:1981
 TPainter3dAlgorithms.cxx:1982
 TPainter3dAlgorithms.cxx:1983
 TPainter3dAlgorithms.cxx:1984
 TPainter3dAlgorithms.cxx:1985
 TPainter3dAlgorithms.cxx:1986
 TPainter3dAlgorithms.cxx:1987
 TPainter3dAlgorithms.cxx:1988
 TPainter3dAlgorithms.cxx:1989
 TPainter3dAlgorithms.cxx:1990
 TPainter3dAlgorithms.cxx:1991
 TPainter3dAlgorithms.cxx:1992
 TPainter3dAlgorithms.cxx:1993
 TPainter3dAlgorithms.cxx:1994
 TPainter3dAlgorithms.cxx:1995
 TPainter3dAlgorithms.cxx:1996
 TPainter3dAlgorithms.cxx:1997
 TPainter3dAlgorithms.cxx:1998
 TPainter3dAlgorithms.cxx:1999
 TPainter3dAlgorithms.cxx:2000
 TPainter3dAlgorithms.cxx:2001
 TPainter3dAlgorithms.cxx:2002
 TPainter3dAlgorithms.cxx:2003
 TPainter3dAlgorithms.cxx:2004
 TPainter3dAlgorithms.cxx:2005
 TPainter3dAlgorithms.cxx:2006
 TPainter3dAlgorithms.cxx:2007
 TPainter3dAlgorithms.cxx:2008
 TPainter3dAlgorithms.cxx:2009
 TPainter3dAlgorithms.cxx:2010
 TPainter3dAlgorithms.cxx:2011
 TPainter3dAlgorithms.cxx:2012
 TPainter3dAlgorithms.cxx:2013
 TPainter3dAlgorithms.cxx:2014
 TPainter3dAlgorithms.cxx:2015
 TPainter3dAlgorithms.cxx:2016
 TPainter3dAlgorithms.cxx:2017
 TPainter3dAlgorithms.cxx:2018
 TPainter3dAlgorithms.cxx:2019
 TPainter3dAlgorithms.cxx:2020
 TPainter3dAlgorithms.cxx:2021
 TPainter3dAlgorithms.cxx:2022
 TPainter3dAlgorithms.cxx:2023
 TPainter3dAlgorithms.cxx:2024
 TPainter3dAlgorithms.cxx:2025
 TPainter3dAlgorithms.cxx:2026
 TPainter3dAlgorithms.cxx:2027
 TPainter3dAlgorithms.cxx:2028
 TPainter3dAlgorithms.cxx:2029
 TPainter3dAlgorithms.cxx:2030
 TPainter3dAlgorithms.cxx:2031
 TPainter3dAlgorithms.cxx:2032
 TPainter3dAlgorithms.cxx:2033
 TPainter3dAlgorithms.cxx:2034
 TPainter3dAlgorithms.cxx:2035
 TPainter3dAlgorithms.cxx:2036
 TPainter3dAlgorithms.cxx:2037
 TPainter3dAlgorithms.cxx:2038
 TPainter3dAlgorithms.cxx:2039
 TPainter3dAlgorithms.cxx:2040
 TPainter3dAlgorithms.cxx:2041
 TPainter3dAlgorithms.cxx:2042
 TPainter3dAlgorithms.cxx:2043
 TPainter3dAlgorithms.cxx:2044
 TPainter3dAlgorithms.cxx:2045
 TPainter3dAlgorithms.cxx:2046
 TPainter3dAlgorithms.cxx:2047
 TPainter3dAlgorithms.cxx:2048
 TPainter3dAlgorithms.cxx:2049
 TPainter3dAlgorithms.cxx:2050
 TPainter3dAlgorithms.cxx:2051
 TPainter3dAlgorithms.cxx:2052
 TPainter3dAlgorithms.cxx:2053
 TPainter3dAlgorithms.cxx:2054
 TPainter3dAlgorithms.cxx:2055
 TPainter3dAlgorithms.cxx:2056
 TPainter3dAlgorithms.cxx:2057
 TPainter3dAlgorithms.cxx:2058
 TPainter3dAlgorithms.cxx:2059
 TPainter3dAlgorithms.cxx:2060
 TPainter3dAlgorithms.cxx:2061
 TPainter3dAlgorithms.cxx:2062
 TPainter3dAlgorithms.cxx:2063
 TPainter3dAlgorithms.cxx:2064
 TPainter3dAlgorithms.cxx:2065
 TPainter3dAlgorithms.cxx:2066
 TPainter3dAlgorithms.cxx:2067
 TPainter3dAlgorithms.cxx:2068
 TPainter3dAlgorithms.cxx:2069
 TPainter3dAlgorithms.cxx:2070
 TPainter3dAlgorithms.cxx:2071
 TPainter3dAlgorithms.cxx:2072
 TPainter3dAlgorithms.cxx:2073
 TPainter3dAlgorithms.cxx:2074
 TPainter3dAlgorithms.cxx:2075
 TPainter3dAlgorithms.cxx:2076
 TPainter3dAlgorithms.cxx:2077
 TPainter3dAlgorithms.cxx:2078
 TPainter3dAlgorithms.cxx:2079
 TPainter3dAlgorithms.cxx:2080
 TPainter3dAlgorithms.cxx:2081
 TPainter3dAlgorithms.cxx:2082
 TPainter3dAlgorithms.cxx:2083
 TPainter3dAlgorithms.cxx:2084
 TPainter3dAlgorithms.cxx:2085
 TPainter3dAlgorithms.cxx:2086
 TPainter3dAlgorithms.cxx:2087
 TPainter3dAlgorithms.cxx:2088
 TPainter3dAlgorithms.cxx:2089
 TPainter3dAlgorithms.cxx:2090
 TPainter3dAlgorithms.cxx:2091
 TPainter3dAlgorithms.cxx:2092
 TPainter3dAlgorithms.cxx:2093
 TPainter3dAlgorithms.cxx:2094
 TPainter3dAlgorithms.cxx:2095
 TPainter3dAlgorithms.cxx:2096
 TPainter3dAlgorithms.cxx:2097
 TPainter3dAlgorithms.cxx:2098
 TPainter3dAlgorithms.cxx:2099
 TPainter3dAlgorithms.cxx:2100
 TPainter3dAlgorithms.cxx:2101
 TPainter3dAlgorithms.cxx:2102
 TPainter3dAlgorithms.cxx:2103
 TPainter3dAlgorithms.cxx:2104
 TPainter3dAlgorithms.cxx:2105
 TPainter3dAlgorithms.cxx:2106
 TPainter3dAlgorithms.cxx:2107
 TPainter3dAlgorithms.cxx:2108
 TPainter3dAlgorithms.cxx:2109
 TPainter3dAlgorithms.cxx:2110
 TPainter3dAlgorithms.cxx:2111
 TPainter3dAlgorithms.cxx:2112
 TPainter3dAlgorithms.cxx:2113
 TPainter3dAlgorithms.cxx:2114
 TPainter3dAlgorithms.cxx:2115
 TPainter3dAlgorithms.cxx:2116
 TPainter3dAlgorithms.cxx:2117
 TPainter3dAlgorithms.cxx:2118
 TPainter3dAlgorithms.cxx:2119
 TPainter3dAlgorithms.cxx:2120
 TPainter3dAlgorithms.cxx:2121
 TPainter3dAlgorithms.cxx:2122
 TPainter3dAlgorithms.cxx:2123
 TPainter3dAlgorithms.cxx:2124
 TPainter3dAlgorithms.cxx:2125
 TPainter3dAlgorithms.cxx:2126
 TPainter3dAlgorithms.cxx:2127
 TPainter3dAlgorithms.cxx:2128
 TPainter3dAlgorithms.cxx:2129
 TPainter3dAlgorithms.cxx:2130
 TPainter3dAlgorithms.cxx:2131
 TPainter3dAlgorithms.cxx:2132
 TPainter3dAlgorithms.cxx:2133
 TPainter3dAlgorithms.cxx:2134
 TPainter3dAlgorithms.cxx:2135
 TPainter3dAlgorithms.cxx:2136
 TPainter3dAlgorithms.cxx:2137
 TPainter3dAlgorithms.cxx:2138
 TPainter3dAlgorithms.cxx:2139
 TPainter3dAlgorithms.cxx:2140
 TPainter3dAlgorithms.cxx:2141
 TPainter3dAlgorithms.cxx:2142
 TPainter3dAlgorithms.cxx:2143
 TPainter3dAlgorithms.cxx:2144
 TPainter3dAlgorithms.cxx:2145
 TPainter3dAlgorithms.cxx:2146
 TPainter3dAlgorithms.cxx:2147
 TPainter3dAlgorithms.cxx:2148
 TPainter3dAlgorithms.cxx:2149
 TPainter3dAlgorithms.cxx:2150
 TPainter3dAlgorithms.cxx:2151
 TPainter3dAlgorithms.cxx:2152
 TPainter3dAlgorithms.cxx:2153
 TPainter3dAlgorithms.cxx:2154
 TPainter3dAlgorithms.cxx:2155
 TPainter3dAlgorithms.cxx:2156
 TPainter3dAlgorithms.cxx:2157
 TPainter3dAlgorithms.cxx:2158
 TPainter3dAlgorithms.cxx:2159
 TPainter3dAlgorithms.cxx:2160
 TPainter3dAlgorithms.cxx:2161
 TPainter3dAlgorithms.cxx:2162
 TPainter3dAlgorithms.cxx:2163
 TPainter3dAlgorithms.cxx:2164
 TPainter3dAlgorithms.cxx:2165
 TPainter3dAlgorithms.cxx:2166
 TPainter3dAlgorithms.cxx:2167
 TPainter3dAlgorithms.cxx:2168
 TPainter3dAlgorithms.cxx:2169
 TPainter3dAlgorithms.cxx:2170
 TPainter3dAlgorithms.cxx:2171
 TPainter3dAlgorithms.cxx:2172
 TPainter3dAlgorithms.cxx:2173
 TPainter3dAlgorithms.cxx:2174
 TPainter3dAlgorithms.cxx:2175
 TPainter3dAlgorithms.cxx:2176
 TPainter3dAlgorithms.cxx:2177
 TPainter3dAlgorithms.cxx:2178
 TPainter3dAlgorithms.cxx:2179
 TPainter3dAlgorithms.cxx:2180
 TPainter3dAlgorithms.cxx:2181
 TPainter3dAlgorithms.cxx:2182
 TPainter3dAlgorithms.cxx:2183
 TPainter3dAlgorithms.cxx:2184
 TPainter3dAlgorithms.cxx:2185
 TPainter3dAlgorithms.cxx:2186
 TPainter3dAlgorithms.cxx:2187
 TPainter3dAlgorithms.cxx:2188
 TPainter3dAlgorithms.cxx:2189
 TPainter3dAlgorithms.cxx:2190
 TPainter3dAlgorithms.cxx:2191
 TPainter3dAlgorithms.cxx:2192
 TPainter3dAlgorithms.cxx:2193
 TPainter3dAlgorithms.cxx:2194
 TPainter3dAlgorithms.cxx:2195
 TPainter3dAlgorithms.cxx:2196
 TPainter3dAlgorithms.cxx:2197
 TPainter3dAlgorithms.cxx:2198
 TPainter3dAlgorithms.cxx:2199
 TPainter3dAlgorithms.cxx:2200
 TPainter3dAlgorithms.cxx:2201
 TPainter3dAlgorithms.cxx:2202
 TPainter3dAlgorithms.cxx:2203
 TPainter3dAlgorithms.cxx:2204
 TPainter3dAlgorithms.cxx:2205
 TPainter3dAlgorithms.cxx:2206
 TPainter3dAlgorithms.cxx:2207
 TPainter3dAlgorithms.cxx:2208
 TPainter3dAlgorithms.cxx:2209
 TPainter3dAlgorithms.cxx:2210
 TPainter3dAlgorithms.cxx:2211
 TPainter3dAlgorithms.cxx:2212
 TPainter3dAlgorithms.cxx:2213
 TPainter3dAlgorithms.cxx:2214
 TPainter3dAlgorithms.cxx:2215
 TPainter3dAlgorithms.cxx:2216
 TPainter3dAlgorithms.cxx:2217
 TPainter3dAlgorithms.cxx:2218
 TPainter3dAlgorithms.cxx:2219
 TPainter3dAlgorithms.cxx:2220
 TPainter3dAlgorithms.cxx:2221
 TPainter3dAlgorithms.cxx:2222
 TPainter3dAlgorithms.cxx:2223
 TPainter3dAlgorithms.cxx:2224
 TPainter3dAlgorithms.cxx:2225
 TPainter3dAlgorithms.cxx:2226
 TPainter3dAlgorithms.cxx:2227
 TPainter3dAlgorithms.cxx:2228
 TPainter3dAlgorithms.cxx:2229
 TPainter3dAlgorithms.cxx:2230
 TPainter3dAlgorithms.cxx:2231
 TPainter3dAlgorithms.cxx:2232
 TPainter3dAlgorithms.cxx:2233
 TPainter3dAlgorithms.cxx:2234
 TPainter3dAlgorithms.cxx:2235
 TPainter3dAlgorithms.cxx:2236
 TPainter3dAlgorithms.cxx:2237
 TPainter3dAlgorithms.cxx:2238
 TPainter3dAlgorithms.cxx:2239
 TPainter3dAlgorithms.cxx:2240
 TPainter3dAlgorithms.cxx:2241
 TPainter3dAlgorithms.cxx:2242
 TPainter3dAlgorithms.cxx:2243
 TPainter3dAlgorithms.cxx:2244
 TPainter3dAlgorithms.cxx:2245
 TPainter3dAlgorithms.cxx:2246
 TPainter3dAlgorithms.cxx:2247
 TPainter3dAlgorithms.cxx:2248
 TPainter3dAlgorithms.cxx:2249
 TPainter3dAlgorithms.cxx:2250
 TPainter3dAlgorithms.cxx:2251
 TPainter3dAlgorithms.cxx:2252
 TPainter3dAlgorithms.cxx:2253
 TPainter3dAlgorithms.cxx:2254
 TPainter3dAlgorithms.cxx:2255
 TPainter3dAlgorithms.cxx:2256
 TPainter3dAlgorithms.cxx:2257
 TPainter3dAlgorithms.cxx:2258
 TPainter3dAlgorithms.cxx:2259
 TPainter3dAlgorithms.cxx:2260
 TPainter3dAlgorithms.cxx:2261
 TPainter3dAlgorithms.cxx:2262
 TPainter3dAlgorithms.cxx:2263
 TPainter3dAlgorithms.cxx:2264
 TPainter3dAlgorithms.cxx:2265
 TPainter3dAlgorithms.cxx:2266
 TPainter3dAlgorithms.cxx:2267
 TPainter3dAlgorithms.cxx:2268
 TPainter3dAlgorithms.cxx:2269
 TPainter3dAlgorithms.cxx:2270
 TPainter3dAlgorithms.cxx:2271
 TPainter3dAlgorithms.cxx:2272
 TPainter3dAlgorithms.cxx:2273
 TPainter3dAlgorithms.cxx:2274
 TPainter3dAlgorithms.cxx:2275
 TPainter3dAlgorithms.cxx:2276
 TPainter3dAlgorithms.cxx:2277
 TPainter3dAlgorithms.cxx:2278
 TPainter3dAlgorithms.cxx:2279
 TPainter3dAlgorithms.cxx:2280
 TPainter3dAlgorithms.cxx:2281
 TPainter3dAlgorithms.cxx:2282
 TPainter3dAlgorithms.cxx:2283
 TPainter3dAlgorithms.cxx:2284
 TPainter3dAlgorithms.cxx:2285
 TPainter3dAlgorithms.cxx:2286
 TPainter3dAlgorithms.cxx:2287
 TPainter3dAlgorithms.cxx:2288
 TPainter3dAlgorithms.cxx:2289
 TPainter3dAlgorithms.cxx:2290
 TPainter3dAlgorithms.cxx:2291
 TPainter3dAlgorithms.cxx:2292
 TPainter3dAlgorithms.cxx:2293
 TPainter3dAlgorithms.cxx:2294
 TPainter3dAlgorithms.cxx:2295
 TPainter3dAlgorithms.cxx:2296
 TPainter3dAlgorithms.cxx:2297
 TPainter3dAlgorithms.cxx:2298
 TPainter3dAlgorithms.cxx:2299
 TPainter3dAlgorithms.cxx:2300
 TPainter3dAlgorithms.cxx:2301
 TPainter3dAlgorithms.cxx:2302
 TPainter3dAlgorithms.cxx:2303
 TPainter3dAlgorithms.cxx:2304
 TPainter3dAlgorithms.cxx:2305
 TPainter3dAlgorithms.cxx:2306
 TPainter3dAlgorithms.cxx:2307
 TPainter3dAlgorithms.cxx:2308
 TPainter3dAlgorithms.cxx:2309
 TPainter3dAlgorithms.cxx:2310
 TPainter3dAlgorithms.cxx:2311
 TPainter3dAlgorithms.cxx:2312
 TPainter3dAlgorithms.cxx:2313
 TPainter3dAlgorithms.cxx:2314
 TPainter3dAlgorithms.cxx:2315
 TPainter3dAlgorithms.cxx:2316
 TPainter3dAlgorithms.cxx:2317
 TPainter3dAlgorithms.cxx:2318
 TPainter3dAlgorithms.cxx:2319
 TPainter3dAlgorithms.cxx:2320
 TPainter3dAlgorithms.cxx:2321
 TPainter3dAlgorithms.cxx:2322
 TPainter3dAlgorithms.cxx:2323
 TPainter3dAlgorithms.cxx:2324
 TPainter3dAlgorithms.cxx:2325
 TPainter3dAlgorithms.cxx:2326
 TPainter3dAlgorithms.cxx:2327
 TPainter3dAlgorithms.cxx:2328
 TPainter3dAlgorithms.cxx:2329
 TPainter3dAlgorithms.cxx:2330
 TPainter3dAlgorithms.cxx:2331
 TPainter3dAlgorithms.cxx:2332
 TPainter3dAlgorithms.cxx:2333
 TPainter3dAlgorithms.cxx:2334
 TPainter3dAlgorithms.cxx:2335
 TPainter3dAlgorithms.cxx:2336
 TPainter3dAlgorithms.cxx:2337
 TPainter3dAlgorithms.cxx:2338
 TPainter3dAlgorithms.cxx:2339
 TPainter3dAlgorithms.cxx:2340
 TPainter3dAlgorithms.cxx:2341
 TPainter3dAlgorithms.cxx:2342
 TPainter3dAlgorithms.cxx:2343
 TPainter3dAlgorithms.cxx:2344
 TPainter3dAlgorithms.cxx:2345
 TPainter3dAlgorithms.cxx:2346
 TPainter3dAlgorithms.cxx:2347
 TPainter3dAlgorithms.cxx:2348
 TPainter3dAlgorithms.cxx:2349
 TPainter3dAlgorithms.cxx:2350
 TPainter3dAlgorithms.cxx:2351
 TPainter3dAlgorithms.cxx:2352
 TPainter3dAlgorithms.cxx:2353
 TPainter3dAlgorithms.cxx:2354
 TPainter3dAlgorithms.cxx:2355
 TPainter3dAlgorithms.cxx:2356
 TPainter3dAlgorithms.cxx:2357
 TPainter3dAlgorithms.cxx:2358
 TPainter3dAlgorithms.cxx:2359
 TPainter3dAlgorithms.cxx:2360
 TPainter3dAlgorithms.cxx:2361
 TPainter3dAlgorithms.cxx:2362
 TPainter3dAlgorithms.cxx:2363
 TPainter3dAlgorithms.cxx:2364
 TPainter3dAlgorithms.cxx:2365
 TPainter3dAlgorithms.cxx:2366
 TPainter3dAlgorithms.cxx:2367
 TPainter3dAlgorithms.cxx:2368
 TPainter3dAlgorithms.cxx:2369
 TPainter3dAlgorithms.cxx:2370
 TPainter3dAlgorithms.cxx:2371
 TPainter3dAlgorithms.cxx:2372
 TPainter3dAlgorithms.cxx:2373
 TPainter3dAlgorithms.cxx:2374
 TPainter3dAlgorithms.cxx:2375
 TPainter3dAlgorithms.cxx:2376
 TPainter3dAlgorithms.cxx:2377
 TPainter3dAlgorithms.cxx:2378
 TPainter3dAlgorithms.cxx:2379
 TPainter3dAlgorithms.cxx:2380
 TPainter3dAlgorithms.cxx:2381
 TPainter3dAlgorithms.cxx:2382
 TPainter3dAlgorithms.cxx:2383
 TPainter3dAlgorithms.cxx:2384
 TPainter3dAlgorithms.cxx:2385
 TPainter3dAlgorithms.cxx:2386
 TPainter3dAlgorithms.cxx:2387
 TPainter3dAlgorithms.cxx:2388
 TPainter3dAlgorithms.cxx:2389
 TPainter3dAlgorithms.cxx:2390
 TPainter3dAlgorithms.cxx:2391
 TPainter3dAlgorithms.cxx:2392
 TPainter3dAlgorithms.cxx:2393
 TPainter3dAlgorithms.cxx:2394
 TPainter3dAlgorithms.cxx:2395
 TPainter3dAlgorithms.cxx:2396
 TPainter3dAlgorithms.cxx:2397
 TPainter3dAlgorithms.cxx:2398
 TPainter3dAlgorithms.cxx:2399
 TPainter3dAlgorithms.cxx:2400
 TPainter3dAlgorithms.cxx:2401
 TPainter3dAlgorithms.cxx:2402
 TPainter3dAlgorithms.cxx:2403
 TPainter3dAlgorithms.cxx:2404
 TPainter3dAlgorithms.cxx:2405
 TPainter3dAlgorithms.cxx:2406
 TPainter3dAlgorithms.cxx:2407
 TPainter3dAlgorithms.cxx:2408
 TPainter3dAlgorithms.cxx:2409
 TPainter3dAlgorithms.cxx:2410
 TPainter3dAlgorithms.cxx:2411
 TPainter3dAlgorithms.cxx:2412
 TPainter3dAlgorithms.cxx:2413
 TPainter3dAlgorithms.cxx:2414
 TPainter3dAlgorithms.cxx:2415
 TPainter3dAlgorithms.cxx:2416
 TPainter3dAlgorithms.cxx:2417
 TPainter3dAlgorithms.cxx:2418
 TPainter3dAlgorithms.cxx:2419
 TPainter3dAlgorithms.cxx:2420
 TPainter3dAlgorithms.cxx:2421
 TPainter3dAlgorithms.cxx:2422
 TPainter3dAlgorithms.cxx:2423
 TPainter3dAlgorithms.cxx:2424
 TPainter3dAlgorithms.cxx:2425
 TPainter3dAlgorithms.cxx:2426
 TPainter3dAlgorithms.cxx:2427
 TPainter3dAlgorithms.cxx:2428
 TPainter3dAlgorithms.cxx:2429
 TPainter3dAlgorithms.cxx:2430
 TPainter3dAlgorithms.cxx:2431
 TPainter3dAlgorithms.cxx:2432
 TPainter3dAlgorithms.cxx:2433
 TPainter3dAlgorithms.cxx:2434
 TPainter3dAlgorithms.cxx:2435
 TPainter3dAlgorithms.cxx:2436
 TPainter3dAlgorithms.cxx:2437
 TPainter3dAlgorithms.cxx:2438
 TPainter3dAlgorithms.cxx:2439
 TPainter3dAlgorithms.cxx:2440
 TPainter3dAlgorithms.cxx:2441
 TPainter3dAlgorithms.cxx:2442
 TPainter3dAlgorithms.cxx:2443
 TPainter3dAlgorithms.cxx:2444
 TPainter3dAlgorithms.cxx:2445
 TPainter3dAlgorithms.cxx:2446
 TPainter3dAlgorithms.cxx:2447
 TPainter3dAlgorithms.cxx:2448
 TPainter3dAlgorithms.cxx:2449
 TPainter3dAlgorithms.cxx:2450
 TPainter3dAlgorithms.cxx:2451
 TPainter3dAlgorithms.cxx:2452
 TPainter3dAlgorithms.cxx:2453
 TPainter3dAlgorithms.cxx:2454
 TPainter3dAlgorithms.cxx:2455
 TPainter3dAlgorithms.cxx:2456
 TPainter3dAlgorithms.cxx:2457
 TPainter3dAlgorithms.cxx:2458
 TPainter3dAlgorithms.cxx:2459
 TPainter3dAlgorithms.cxx:2460
 TPainter3dAlgorithms.cxx:2461
 TPainter3dAlgorithms.cxx:2462
 TPainter3dAlgorithms.cxx:2463
 TPainter3dAlgorithms.cxx:2464
 TPainter3dAlgorithms.cxx:2465
 TPainter3dAlgorithms.cxx:2466
 TPainter3dAlgorithms.cxx:2467
 TPainter3dAlgorithms.cxx:2468
 TPainter3dAlgorithms.cxx:2469
 TPainter3dAlgorithms.cxx:2470
 TPainter3dAlgorithms.cxx:2471
 TPainter3dAlgorithms.cxx:2472
 TPainter3dAlgorithms.cxx:2473
 TPainter3dAlgorithms.cxx:2474
 TPainter3dAlgorithms.cxx:2475
 TPainter3dAlgorithms.cxx:2476
 TPainter3dAlgorithms.cxx:2477
 TPainter3dAlgorithms.cxx:2478
 TPainter3dAlgorithms.cxx:2479
 TPainter3dAlgorithms.cxx:2480
 TPainter3dAlgorithms.cxx:2481
 TPainter3dAlgorithms.cxx:2482
 TPainter3dAlgorithms.cxx:2483
 TPainter3dAlgorithms.cxx:2484
 TPainter3dAlgorithms.cxx:2485
 TPainter3dAlgorithms.cxx:2486
 TPainter3dAlgorithms.cxx:2487
 TPainter3dAlgorithms.cxx:2488
 TPainter3dAlgorithms.cxx:2489
 TPainter3dAlgorithms.cxx:2490
 TPainter3dAlgorithms.cxx:2491
 TPainter3dAlgorithms.cxx:2492
 TPainter3dAlgorithms.cxx:2493
 TPainter3dAlgorithms.cxx:2494
 TPainter3dAlgorithms.cxx:2495
 TPainter3dAlgorithms.cxx:2496
 TPainter3dAlgorithms.cxx:2497
 TPainter3dAlgorithms.cxx:2498
 TPainter3dAlgorithms.cxx:2499
 TPainter3dAlgorithms.cxx:2500
 TPainter3dAlgorithms.cxx:2501
 TPainter3dAlgorithms.cxx:2502
 TPainter3dAlgorithms.cxx:2503
 TPainter3dAlgorithms.cxx:2504
 TPainter3dAlgorithms.cxx:2505
 TPainter3dAlgorithms.cxx:2506
 TPainter3dAlgorithms.cxx:2507
 TPainter3dAlgorithms.cxx:2508
 TPainter3dAlgorithms.cxx:2509
 TPainter3dAlgorithms.cxx:2510
 TPainter3dAlgorithms.cxx:2511
 TPainter3dAlgorithms.cxx:2512
 TPainter3dAlgorithms.cxx:2513
 TPainter3dAlgorithms.cxx:2514
 TPainter3dAlgorithms.cxx:2515
 TPainter3dAlgorithms.cxx:2516
 TPainter3dAlgorithms.cxx:2517
 TPainter3dAlgorithms.cxx:2518
 TPainter3dAlgorithms.cxx:2519
 TPainter3dAlgorithms.cxx:2520
 TPainter3dAlgorithms.cxx:2521
 TPainter3dAlgorithms.cxx:2522
 TPainter3dAlgorithms.cxx:2523
 TPainter3dAlgorithms.cxx:2524
 TPainter3dAlgorithms.cxx:2525
 TPainter3dAlgorithms.cxx:2526
 TPainter3dAlgorithms.cxx:2527
 TPainter3dAlgorithms.cxx:2528
 TPainter3dAlgorithms.cxx:2529
 TPainter3dAlgorithms.cxx:2530
 TPainter3dAlgorithms.cxx:2531
 TPainter3dAlgorithms.cxx:2532
 TPainter3dAlgorithms.cxx:2533
 TPainter3dAlgorithms.cxx:2534
 TPainter3dAlgorithms.cxx:2535
 TPainter3dAlgorithms.cxx:2536
 TPainter3dAlgorithms.cxx:2537
 TPainter3dAlgorithms.cxx:2538
 TPainter3dAlgorithms.cxx:2539
 TPainter3dAlgorithms.cxx:2540
 TPainter3dAlgorithms.cxx:2541
 TPainter3dAlgorithms.cxx:2542
 TPainter3dAlgorithms.cxx:2543
 TPainter3dAlgorithms.cxx:2544
 TPainter3dAlgorithms.cxx:2545
 TPainter3dAlgorithms.cxx:2546
 TPainter3dAlgorithms.cxx:2547
 TPainter3dAlgorithms.cxx:2548
 TPainter3dAlgorithms.cxx:2549
 TPainter3dAlgorithms.cxx:2550
 TPainter3dAlgorithms.cxx:2551
 TPainter3dAlgorithms.cxx:2552
 TPainter3dAlgorithms.cxx:2553
 TPainter3dAlgorithms.cxx:2554
 TPainter3dAlgorithms.cxx:2555
 TPainter3dAlgorithms.cxx:2556
 TPainter3dAlgorithms.cxx:2557
 TPainter3dAlgorithms.cxx:2558
 TPainter3dAlgorithms.cxx:2559
 TPainter3dAlgorithms.cxx:2560
 TPainter3dAlgorithms.cxx:2561
 TPainter3dAlgorithms.cxx:2562
 TPainter3dAlgorithms.cxx:2563
 TPainter3dAlgorithms.cxx:2564
 TPainter3dAlgorithms.cxx:2565
 TPainter3dAlgorithms.cxx:2566
 TPainter3dAlgorithms.cxx:2567
 TPainter3dAlgorithms.cxx:2568
 TPainter3dAlgorithms.cxx:2569
 TPainter3dAlgorithms.cxx:2570
 TPainter3dAlgorithms.cxx:2571
 TPainter3dAlgorithms.cxx:2572
 TPainter3dAlgorithms.cxx:2573
 TPainter3dAlgorithms.cxx:2574
 TPainter3dAlgorithms.cxx:2575
 TPainter3dAlgorithms.cxx:2576
 TPainter3dAlgorithms.cxx:2577
 TPainter3dAlgorithms.cxx:2578
 TPainter3dAlgorithms.cxx:2579
 TPainter3dAlgorithms.cxx:2580
 TPainter3dAlgorithms.cxx:2581
 TPainter3dAlgorithms.cxx:2582
 TPainter3dAlgorithms.cxx:2583
 TPainter3dAlgorithms.cxx:2584
 TPainter3dAlgorithms.cxx:2585
 TPainter3dAlgorithms.cxx:2586
 TPainter3dAlgorithms.cxx:2587
 TPainter3dAlgorithms.cxx:2588
 TPainter3dAlgorithms.cxx:2589
 TPainter3dAlgorithms.cxx:2590
 TPainter3dAlgorithms.cxx:2591
 TPainter3dAlgorithms.cxx:2592
 TPainter3dAlgorithms.cxx:2593
 TPainter3dAlgorithms.cxx:2594
 TPainter3dAlgorithms.cxx:2595
 TPainter3dAlgorithms.cxx:2596
 TPainter3dAlgorithms.cxx:2597
 TPainter3dAlgorithms.cxx:2598
 TPainter3dAlgorithms.cxx:2599
 TPainter3dAlgorithms.cxx:2600
 TPainter3dAlgorithms.cxx:2601
 TPainter3dAlgorithms.cxx:2602
 TPainter3dAlgorithms.cxx:2603
 TPainter3dAlgorithms.cxx:2604
 TPainter3dAlgorithms.cxx:2605
 TPainter3dAlgorithms.cxx:2606
 TPainter3dAlgorithms.cxx:2607
 TPainter3dAlgorithms.cxx:2608
 TPainter3dAlgorithms.cxx:2609
 TPainter3dAlgorithms.cxx:2610
 TPainter3dAlgorithms.cxx:2611
 TPainter3dAlgorithms.cxx:2612
 TPainter3dAlgorithms.cxx:2613
 TPainter3dAlgorithms.cxx:2614
 TPainter3dAlgorithms.cxx:2615
 TPainter3dAlgorithms.cxx:2616
 TPainter3dAlgorithms.cxx:2617
 TPainter3dAlgorithms.cxx:2618
 TPainter3dAlgorithms.cxx:2619
 TPainter3dAlgorithms.cxx:2620
 TPainter3dAlgorithms.cxx:2621
 TPainter3dAlgorithms.cxx:2622
 TPainter3dAlgorithms.cxx:2623
 TPainter3dAlgorithms.cxx:2624
 TPainter3dAlgorithms.cxx:2625
 TPainter3dAlgorithms.cxx:2626
 TPainter3dAlgorithms.cxx:2627
 TPainter3dAlgorithms.cxx:2628
 TPainter3dAlgorithms.cxx:2629
 TPainter3dAlgorithms.cxx:2630
 TPainter3dAlgorithms.cxx:2631
 TPainter3dAlgorithms.cxx:2632
 TPainter3dAlgorithms.cxx:2633
 TPainter3dAlgorithms.cxx:2634
 TPainter3dAlgorithms.cxx:2635
 TPainter3dAlgorithms.cxx:2636
 TPainter3dAlgorithms.cxx:2637
 TPainter3dAlgorithms.cxx:2638
 TPainter3dAlgorithms.cxx:2639
 TPainter3dAlgorithms.cxx:2640
 TPainter3dAlgorithms.cxx:2641
 TPainter3dAlgorithms.cxx:2642
 TPainter3dAlgorithms.cxx:2643
 TPainter3dAlgorithms.cxx:2644
 TPainter3dAlgorithms.cxx:2645
 TPainter3dAlgorithms.cxx:2646
 TPainter3dAlgorithms.cxx:2647
 TPainter3dAlgorithms.cxx:2648
 TPainter3dAlgorithms.cxx:2649
 TPainter3dAlgorithms.cxx:2650
 TPainter3dAlgorithms.cxx:2651
 TPainter3dAlgorithms.cxx:2652
 TPainter3dAlgorithms.cxx:2653
 TPainter3dAlgorithms.cxx:2654
 TPainter3dAlgorithms.cxx:2655
 TPainter3dAlgorithms.cxx:2656
 TPainter3dAlgorithms.cxx:2657
 TPainter3dAlgorithms.cxx:2658
 TPainter3dAlgorithms.cxx:2659
 TPainter3dAlgorithms.cxx:2660
 TPainter3dAlgorithms.cxx:2661
 TPainter3dAlgorithms.cxx:2662
 TPainter3dAlgorithms.cxx:2663
 TPainter3dAlgorithms.cxx:2664
 TPainter3dAlgorithms.cxx:2665
 TPainter3dAlgorithms.cxx:2666
 TPainter3dAlgorithms.cxx:2667
 TPainter3dAlgorithms.cxx:2668
 TPainter3dAlgorithms.cxx:2669
 TPainter3dAlgorithms.cxx:2670
 TPainter3dAlgorithms.cxx:2671
 TPainter3dAlgorithms.cxx:2672
 TPainter3dAlgorithms.cxx:2673
 TPainter3dAlgorithms.cxx:2674
 TPainter3dAlgorithms.cxx:2675
 TPainter3dAlgorithms.cxx:2676
 TPainter3dAlgorithms.cxx:2677
 TPainter3dAlgorithms.cxx:2678
 TPainter3dAlgorithms.cxx:2679
 TPainter3dAlgorithms.cxx:2680
 TPainter3dAlgorithms.cxx:2681
 TPainter3dAlgorithms.cxx:2682
 TPainter3dAlgorithms.cxx:2683
 TPainter3dAlgorithms.cxx:2684
 TPainter3dAlgorithms.cxx:2685
 TPainter3dAlgorithms.cxx:2686
 TPainter3dAlgorithms.cxx:2687
 TPainter3dAlgorithms.cxx:2688
 TPainter3dAlgorithms.cxx:2689
 TPainter3dAlgorithms.cxx:2690
 TPainter3dAlgorithms.cxx:2691
 TPainter3dAlgorithms.cxx:2692
 TPainter3dAlgorithms.cxx:2693
 TPainter3dAlgorithms.cxx:2694
 TPainter3dAlgorithms.cxx:2695
 TPainter3dAlgorithms.cxx:2696
 TPainter3dAlgorithms.cxx:2697
 TPainter3dAlgorithms.cxx:2698
 TPainter3dAlgorithms.cxx:2699
 TPainter3dAlgorithms.cxx:2700
 TPainter3dAlgorithms.cxx:2701
 TPainter3dAlgorithms.cxx:2702
 TPainter3dAlgorithms.cxx:2703
 TPainter3dAlgorithms.cxx:2704
 TPainter3dAlgorithms.cxx:2705
 TPainter3dAlgorithms.cxx:2706
 TPainter3dAlgorithms.cxx:2707
 TPainter3dAlgorithms.cxx:2708
 TPainter3dAlgorithms.cxx:2709
 TPainter3dAlgorithms.cxx:2710
 TPainter3dAlgorithms.cxx:2711
 TPainter3dAlgorithms.cxx:2712
 TPainter3dAlgorithms.cxx:2713
 TPainter3dAlgorithms.cxx:2714
 TPainter3dAlgorithms.cxx:2715
 TPainter3dAlgorithms.cxx:2716
 TPainter3dAlgorithms.cxx:2717
 TPainter3dAlgorithms.cxx:2718
 TPainter3dAlgorithms.cxx:2719
 TPainter3dAlgorithms.cxx:2720
 TPainter3dAlgorithms.cxx:2721
 TPainter3dAlgorithms.cxx:2722
 TPainter3dAlgorithms.cxx:2723
 TPainter3dAlgorithms.cxx:2724
 TPainter3dAlgorithms.cxx:2725
 TPainter3dAlgorithms.cxx:2726
 TPainter3dAlgorithms.cxx:2727
 TPainter3dAlgorithms.cxx:2728
 TPainter3dAlgorithms.cxx:2729
 TPainter3dAlgorithms.cxx:2730
 TPainter3dAlgorithms.cxx:2731
 TPainter3dAlgorithms.cxx:2732
 TPainter3dAlgorithms.cxx:2733
 TPainter3dAlgorithms.cxx:2734
 TPainter3dAlgorithms.cxx:2735
 TPainter3dAlgorithms.cxx:2736
 TPainter3dAlgorithms.cxx:2737
 TPainter3dAlgorithms.cxx:2738
 TPainter3dAlgorithms.cxx:2739
 TPainter3dAlgorithms.cxx:2740
 TPainter3dAlgorithms.cxx:2741
 TPainter3dAlgorithms.cxx:2742
 TPainter3dAlgorithms.cxx:2743
 TPainter3dAlgorithms.cxx:2744
 TPainter3dAlgorithms.cxx:2745
 TPainter3dAlgorithms.cxx:2746
 TPainter3dAlgorithms.cxx:2747
 TPainter3dAlgorithms.cxx:2748
 TPainter3dAlgorithms.cxx:2749
 TPainter3dAlgorithms.cxx:2750
 TPainter3dAlgorithms.cxx:2751
 TPainter3dAlgorithms.cxx:2752
 TPainter3dAlgorithms.cxx:2753
 TPainter3dAlgorithms.cxx:2754
 TPainter3dAlgorithms.cxx:2755
 TPainter3dAlgorithms.cxx:2756
 TPainter3dAlgorithms.cxx:2757
 TPainter3dAlgorithms.cxx:2758
 TPainter3dAlgorithms.cxx:2759
 TPainter3dAlgorithms.cxx:2760
 TPainter3dAlgorithms.cxx:2761
 TPainter3dAlgorithms.cxx:2762
 TPainter3dAlgorithms.cxx:2763
 TPainter3dAlgorithms.cxx:2764
 TPainter3dAlgorithms.cxx:2765
 TPainter3dAlgorithms.cxx:2766
 TPainter3dAlgorithms.cxx:2767
 TPainter3dAlgorithms.cxx:2768
 TPainter3dAlgorithms.cxx:2769
 TPainter3dAlgorithms.cxx:2770
 TPainter3dAlgorithms.cxx:2771
 TPainter3dAlgorithms.cxx:2772
 TPainter3dAlgorithms.cxx:2773
 TPainter3dAlgorithms.cxx:2774
 TPainter3dAlgorithms.cxx:2775
 TPainter3dAlgorithms.cxx:2776
 TPainter3dAlgorithms.cxx:2777
 TPainter3dAlgorithms.cxx:2778
 TPainter3dAlgorithms.cxx:2779
 TPainter3dAlgorithms.cxx:2780
 TPainter3dAlgorithms.cxx:2781
 TPainter3dAlgorithms.cxx:2782
 TPainter3dAlgorithms.cxx:2783
 TPainter3dAlgorithms.cxx:2784
 TPainter3dAlgorithms.cxx:2785
 TPainter3dAlgorithms.cxx:2786
 TPainter3dAlgorithms.cxx:2787
 TPainter3dAlgorithms.cxx:2788
 TPainter3dAlgorithms.cxx:2789
 TPainter3dAlgorithms.cxx:2790
 TPainter3dAlgorithms.cxx:2791
 TPainter3dAlgorithms.cxx:2792
 TPainter3dAlgorithms.cxx:2793
 TPainter3dAlgorithms.cxx:2794
 TPainter3dAlgorithms.cxx:2795
 TPainter3dAlgorithms.cxx:2796
 TPainter3dAlgorithms.cxx:2797
 TPainter3dAlgorithms.cxx:2798
 TPainter3dAlgorithms.cxx:2799
 TPainter3dAlgorithms.cxx:2800
 TPainter3dAlgorithms.cxx:2801
 TPainter3dAlgorithms.cxx:2802
 TPainter3dAlgorithms.cxx:2803
 TPainter3dAlgorithms.cxx:2804
 TPainter3dAlgorithms.cxx:2805
 TPainter3dAlgorithms.cxx:2806
 TPainter3dAlgorithms.cxx:2807
 TPainter3dAlgorithms.cxx:2808
 TPainter3dAlgorithms.cxx:2809
 TPainter3dAlgorithms.cxx:2810
 TPainter3dAlgorithms.cxx:2811
 TPainter3dAlgorithms.cxx:2812
 TPainter3dAlgorithms.cxx:2813
 TPainter3dAlgorithms.cxx:2814
 TPainter3dAlgorithms.cxx:2815
 TPainter3dAlgorithms.cxx:2816
 TPainter3dAlgorithms.cxx:2817
 TPainter3dAlgorithms.cxx:2818
 TPainter3dAlgorithms.cxx:2819
 TPainter3dAlgorithms.cxx:2820
 TPainter3dAlgorithms.cxx:2821
 TPainter3dAlgorithms.cxx:2822
 TPainter3dAlgorithms.cxx:2823
 TPainter3dAlgorithms.cxx:2824
 TPainter3dAlgorithms.cxx:2825
 TPainter3dAlgorithms.cxx:2826
 TPainter3dAlgorithms.cxx:2827
 TPainter3dAlgorithms.cxx:2828
 TPainter3dAlgorithms.cxx:2829
 TPainter3dAlgorithms.cxx:2830
 TPainter3dAlgorithms.cxx:2831
 TPainter3dAlgorithms.cxx:2832
 TPainter3dAlgorithms.cxx:2833
 TPainter3dAlgorithms.cxx:2834
 TPainter3dAlgorithms.cxx:2835
 TPainter3dAlgorithms.cxx:2836
 TPainter3dAlgorithms.cxx:2837
 TPainter3dAlgorithms.cxx:2838
 TPainter3dAlgorithms.cxx:2839
 TPainter3dAlgorithms.cxx:2840
 TPainter3dAlgorithms.cxx:2841
 TPainter3dAlgorithms.cxx:2842
 TPainter3dAlgorithms.cxx:2843
 TPainter3dAlgorithms.cxx:2844
 TPainter3dAlgorithms.cxx:2845
 TPainter3dAlgorithms.cxx:2846
 TPainter3dAlgorithms.cxx:2847
 TPainter3dAlgorithms.cxx:2848
 TPainter3dAlgorithms.cxx:2849
 TPainter3dAlgorithms.cxx:2850
 TPainter3dAlgorithms.cxx:2851
 TPainter3dAlgorithms.cxx:2852
 TPainter3dAlgorithms.cxx:2853
 TPainter3dAlgorithms.cxx:2854
 TPainter3dAlgorithms.cxx:2855
 TPainter3dAlgorithms.cxx:2856
 TPainter3dAlgorithms.cxx:2857
 TPainter3dAlgorithms.cxx:2858
 TPainter3dAlgorithms.cxx:2859
 TPainter3dAlgorithms.cxx:2860
 TPainter3dAlgorithms.cxx:2861
 TPainter3dAlgorithms.cxx:2862
 TPainter3dAlgorithms.cxx:2863
 TPainter3dAlgorithms.cxx:2864
 TPainter3dAlgorithms.cxx:2865
 TPainter3dAlgorithms.cxx:2866
 TPainter3dAlgorithms.cxx:2867
 TPainter3dAlgorithms.cxx:2868
 TPainter3dAlgorithms.cxx:2869
 TPainter3dAlgorithms.cxx:2870
 TPainter3dAlgorithms.cxx:2871
 TPainter3dAlgorithms.cxx:2872
 TPainter3dAlgorithms.cxx:2873
 TPainter3dAlgorithms.cxx:2874
 TPainter3dAlgorithms.cxx:2875
 TPainter3dAlgorithms.cxx:2876
 TPainter3dAlgorithms.cxx:2877
 TPainter3dAlgorithms.cxx:2878
 TPainter3dAlgorithms.cxx:2879
 TPainter3dAlgorithms.cxx:2880
 TPainter3dAlgorithms.cxx:2881
 TPainter3dAlgorithms.cxx:2882
 TPainter3dAlgorithms.cxx:2883
 TPainter3dAlgorithms.cxx:2884
 TPainter3dAlgorithms.cxx:2885
 TPainter3dAlgorithms.cxx:2886
 TPainter3dAlgorithms.cxx:2887
 TPainter3dAlgorithms.cxx:2888
 TPainter3dAlgorithms.cxx:2889
 TPainter3dAlgorithms.cxx:2890
 TPainter3dAlgorithms.cxx:2891
 TPainter3dAlgorithms.cxx:2892
 TPainter3dAlgorithms.cxx:2893
 TPainter3dAlgorithms.cxx:2894
 TPainter3dAlgorithms.cxx:2895
 TPainter3dAlgorithms.cxx:2896
 TPainter3dAlgorithms.cxx:2897
 TPainter3dAlgorithms.cxx:2898
 TPainter3dAlgorithms.cxx:2899
 TPainter3dAlgorithms.cxx:2900
 TPainter3dAlgorithms.cxx:2901
 TPainter3dAlgorithms.cxx:2902
 TPainter3dAlgorithms.cxx:2903
 TPainter3dAlgorithms.cxx:2904
 TPainter3dAlgorithms.cxx:2905
 TPainter3dAlgorithms.cxx:2906
 TPainter3dAlgorithms.cxx:2907
 TPainter3dAlgorithms.cxx:2908
 TPainter3dAlgorithms.cxx:2909
 TPainter3dAlgorithms.cxx:2910
 TPainter3dAlgorithms.cxx:2911
 TPainter3dAlgorithms.cxx:2912
 TPainter3dAlgorithms.cxx:2913
 TPainter3dAlgorithms.cxx:2914
 TPainter3dAlgorithms.cxx:2915
 TPainter3dAlgorithms.cxx:2916
 TPainter3dAlgorithms.cxx:2917
 TPainter3dAlgorithms.cxx:2918
 TPainter3dAlgorithms.cxx:2919
 TPainter3dAlgorithms.cxx:2920
 TPainter3dAlgorithms.cxx:2921
 TPainter3dAlgorithms.cxx:2922
 TPainter3dAlgorithms.cxx:2923
 TPainter3dAlgorithms.cxx:2924
 TPainter3dAlgorithms.cxx:2925
 TPainter3dAlgorithms.cxx:2926
 TPainter3dAlgorithms.cxx:2927
 TPainter3dAlgorithms.cxx:2928
 TPainter3dAlgorithms.cxx:2929
 TPainter3dAlgorithms.cxx:2930
 TPainter3dAlgorithms.cxx:2931
 TPainter3dAlgorithms.cxx:2932
 TPainter3dAlgorithms.cxx:2933
 TPainter3dAlgorithms.cxx:2934
 TPainter3dAlgorithms.cxx:2935
 TPainter3dAlgorithms.cxx:2936
 TPainter3dAlgorithms.cxx:2937
 TPainter3dAlgorithms.cxx:2938
 TPainter3dAlgorithms.cxx:2939
 TPainter3dAlgorithms.cxx:2940
 TPainter3dAlgorithms.cxx:2941
 TPainter3dAlgorithms.cxx:2942
 TPainter3dAlgorithms.cxx:2943
 TPainter3dAlgorithms.cxx:2944
 TPainter3dAlgorithms.cxx:2945
 TPainter3dAlgorithms.cxx:2946
 TPainter3dAlgorithms.cxx:2947
 TPainter3dAlgorithms.cxx:2948
 TPainter3dAlgorithms.cxx:2949
 TPainter3dAlgorithms.cxx:2950
 TPainter3dAlgorithms.cxx:2951
 TPainter3dAlgorithms.cxx:2952
 TPainter3dAlgorithms.cxx:2953
 TPainter3dAlgorithms.cxx:2954
 TPainter3dAlgorithms.cxx:2955
 TPainter3dAlgorithms.cxx:2956
 TPainter3dAlgorithms.cxx:2957
 TPainter3dAlgorithms.cxx:2958
 TPainter3dAlgorithms.cxx:2959
 TPainter3dAlgorithms.cxx:2960
 TPainter3dAlgorithms.cxx:2961
 TPainter3dAlgorithms.cxx:2962
 TPainter3dAlgorithms.cxx:2963
 TPainter3dAlgorithms.cxx:2964
 TPainter3dAlgorithms.cxx:2965
 TPainter3dAlgorithms.cxx:2966
 TPainter3dAlgorithms.cxx:2967
 TPainter3dAlgorithms.cxx:2968
 TPainter3dAlgorithms.cxx:2969
 TPainter3dAlgorithms.cxx:2970
 TPainter3dAlgorithms.cxx:2971
 TPainter3dAlgorithms.cxx:2972
 TPainter3dAlgorithms.cxx:2973
 TPainter3dAlgorithms.cxx:2974
 TPainter3dAlgorithms.cxx:2975
 TPainter3dAlgorithms.cxx:2976
 TPainter3dAlgorithms.cxx:2977
 TPainter3dAlgorithms.cxx:2978
 TPainter3dAlgorithms.cxx:2979
 TPainter3dAlgorithms.cxx:2980
 TPainter3dAlgorithms.cxx:2981
 TPainter3dAlgorithms.cxx:2982
 TPainter3dAlgorithms.cxx:2983
 TPainter3dAlgorithms.cxx:2984
 TPainter3dAlgorithms.cxx:2985
 TPainter3dAlgorithms.cxx:2986
 TPainter3dAlgorithms.cxx:2987
 TPainter3dAlgorithms.cxx:2988
 TPainter3dAlgorithms.cxx:2989
 TPainter3dAlgorithms.cxx:2990
 TPainter3dAlgorithms.cxx:2991
 TPainter3dAlgorithms.cxx:2992
 TPainter3dAlgorithms.cxx:2993
 TPainter3dAlgorithms.cxx:2994
 TPainter3dAlgorithms.cxx:2995
 TPainter3dAlgorithms.cxx:2996
 TPainter3dAlgorithms.cxx:2997
 TPainter3dAlgorithms.cxx:2998
 TPainter3dAlgorithms.cxx:2999
 TPainter3dAlgorithms.cxx:3000
 TPainter3dAlgorithms.cxx:3001
 TPainter3dAlgorithms.cxx:3002
 TPainter3dAlgorithms.cxx:3003
 TPainter3dAlgorithms.cxx:3004
 TPainter3dAlgorithms.cxx:3005
 TPainter3dAlgorithms.cxx:3006
 TPainter3dAlgorithms.cxx:3007
 TPainter3dAlgorithms.cxx:3008
 TPainter3dAlgorithms.cxx:3009
 TPainter3dAlgorithms.cxx:3010
 TPainter3dAlgorithms.cxx:3011
 TPainter3dAlgorithms.cxx:3012
 TPainter3dAlgorithms.cxx:3013
 TPainter3dAlgorithms.cxx:3014
 TPainter3dAlgorithms.cxx:3015
 TPainter3dAlgorithms.cxx:3016
 TPainter3dAlgorithms.cxx:3017
 TPainter3dAlgorithms.cxx:3018
 TPainter3dAlgorithms.cxx:3019
 TPainter3dAlgorithms.cxx:3020
 TPainter3dAlgorithms.cxx:3021
 TPainter3dAlgorithms.cxx:3022
 TPainter3dAlgorithms.cxx:3023
 TPainter3dAlgorithms.cxx:3024
 TPainter3dAlgorithms.cxx:3025
 TPainter3dAlgorithms.cxx:3026
 TPainter3dAlgorithms.cxx:3027
 TPainter3dAlgorithms.cxx:3028
 TPainter3dAlgorithms.cxx:3029
 TPainter3dAlgorithms.cxx:3030
 TPainter3dAlgorithms.cxx:3031
 TPainter3dAlgorithms.cxx:3032
 TPainter3dAlgorithms.cxx:3033
 TPainter3dAlgorithms.cxx:3034
 TPainter3dAlgorithms.cxx:3035
 TPainter3dAlgorithms.cxx:3036
 TPainter3dAlgorithms.cxx:3037
 TPainter3dAlgorithms.cxx:3038
 TPainter3dAlgorithms.cxx:3039
 TPainter3dAlgorithms.cxx:3040
 TPainter3dAlgorithms.cxx:3041
 TPainter3dAlgorithms.cxx:3042
 TPainter3dAlgorithms.cxx:3043
 TPainter3dAlgorithms.cxx:3044
 TPainter3dAlgorithms.cxx:3045
 TPainter3dAlgorithms.cxx:3046
 TPainter3dAlgorithms.cxx:3047
 TPainter3dAlgorithms.cxx:3048
 TPainter3dAlgorithms.cxx:3049
 TPainter3dAlgorithms.cxx:3050
 TPainter3dAlgorithms.cxx:3051
 TPainter3dAlgorithms.cxx:3052
 TPainter3dAlgorithms.cxx:3053
 TPainter3dAlgorithms.cxx:3054
 TPainter3dAlgorithms.cxx:3055
 TPainter3dAlgorithms.cxx:3056
 TPainter3dAlgorithms.cxx:3057
 TPainter3dAlgorithms.cxx:3058
 TPainter3dAlgorithms.cxx:3059
 TPainter3dAlgorithms.cxx:3060
 TPainter3dAlgorithms.cxx:3061
 TPainter3dAlgorithms.cxx:3062
 TPainter3dAlgorithms.cxx:3063
 TPainter3dAlgorithms.cxx:3064
 TPainter3dAlgorithms.cxx:3065
 TPainter3dAlgorithms.cxx:3066
 TPainter3dAlgorithms.cxx:3067
 TPainter3dAlgorithms.cxx:3068
 TPainter3dAlgorithms.cxx:3069
 TPainter3dAlgorithms.cxx:3070
 TPainter3dAlgorithms.cxx:3071
 TPainter3dAlgorithms.cxx:3072
 TPainter3dAlgorithms.cxx:3073
 TPainter3dAlgorithms.cxx:3074
 TPainter3dAlgorithms.cxx:3075
 TPainter3dAlgorithms.cxx:3076
 TPainter3dAlgorithms.cxx:3077
 TPainter3dAlgorithms.cxx:3078
 TPainter3dAlgorithms.cxx:3079
 TPainter3dAlgorithms.cxx:3080
 TPainter3dAlgorithms.cxx:3081
 TPainter3dAlgorithms.cxx:3082
 TPainter3dAlgorithms.cxx:3083
 TPainter3dAlgorithms.cxx:3084
 TPainter3dAlgorithms.cxx:3085
 TPainter3dAlgorithms.cxx:3086
 TPainter3dAlgorithms.cxx:3087
 TPainter3dAlgorithms.cxx:3088
 TPainter3dAlgorithms.cxx:3089
 TPainter3dAlgorithms.cxx:3090
 TPainter3dAlgorithms.cxx:3091
 TPainter3dAlgorithms.cxx:3092
 TPainter3dAlgorithms.cxx:3093
 TPainter3dAlgorithms.cxx:3094
 TPainter3dAlgorithms.cxx:3095
 TPainter3dAlgorithms.cxx:3096
 TPainter3dAlgorithms.cxx:3097
 TPainter3dAlgorithms.cxx:3098
 TPainter3dAlgorithms.cxx:3099
 TPainter3dAlgorithms.cxx:3100
 TPainter3dAlgorithms.cxx:3101
 TPainter3dAlgorithms.cxx:3102
 TPainter3dAlgorithms.cxx:3103
 TPainter3dAlgorithms.cxx:3104
 TPainter3dAlgorithms.cxx:3105
 TPainter3dAlgorithms.cxx:3106
 TPainter3dAlgorithms.cxx:3107
 TPainter3dAlgorithms.cxx:3108
 TPainter3dAlgorithms.cxx:3109
 TPainter3dAlgorithms.cxx:3110
 TPainter3dAlgorithms.cxx:3111
 TPainter3dAlgorithms.cxx:3112
 TPainter3dAlgorithms.cxx:3113
 TPainter3dAlgorithms.cxx:3114
 TPainter3dAlgorithms.cxx:3115
 TPainter3dAlgorithms.cxx:3116
 TPainter3dAlgorithms.cxx:3117
 TPainter3dAlgorithms.cxx:3118
 TPainter3dAlgorithms.cxx:3119
 TPainter3dAlgorithms.cxx:3120
 TPainter3dAlgorithms.cxx:3121
 TPainter3dAlgorithms.cxx:3122
 TPainter3dAlgorithms.cxx:3123
 TPainter3dAlgorithms.cxx:3124
 TPainter3dAlgorithms.cxx:3125
 TPainter3dAlgorithms.cxx:3126
 TPainter3dAlgorithms.cxx:3127
 TPainter3dAlgorithms.cxx:3128
 TPainter3dAlgorithms.cxx:3129
 TPainter3dAlgorithms.cxx:3130
 TPainter3dAlgorithms.cxx:3131
 TPainter3dAlgorithms.cxx:3132
 TPainter3dAlgorithms.cxx:3133
 TPainter3dAlgorithms.cxx:3134
 TPainter3dAlgorithms.cxx:3135
 TPainter3dAlgorithms.cxx:3136
 TPainter3dAlgorithms.cxx:3137
 TPainter3dAlgorithms.cxx:3138
 TPainter3dAlgorithms.cxx:3139
 TPainter3dAlgorithms.cxx:3140
 TPainter3dAlgorithms.cxx:3141
 TPainter3dAlgorithms.cxx:3142
 TPainter3dAlgorithms.cxx:3143
 TPainter3dAlgorithms.cxx:3144
 TPainter3dAlgorithms.cxx:3145
 TPainter3dAlgorithms.cxx:3146
 TPainter3dAlgorithms.cxx:3147
 TPainter3dAlgorithms.cxx:3148
 TPainter3dAlgorithms.cxx:3149
 TPainter3dAlgorithms.cxx:3150
 TPainter3dAlgorithms.cxx:3151
 TPainter3dAlgorithms.cxx:3152
 TPainter3dAlgorithms.cxx:3153
 TPainter3dAlgorithms.cxx:3154
 TPainter3dAlgorithms.cxx:3155
 TPainter3dAlgorithms.cxx:3156
 TPainter3dAlgorithms.cxx:3157
 TPainter3dAlgorithms.cxx:3158
 TPainter3dAlgorithms.cxx:3159
 TPainter3dAlgorithms.cxx:3160
 TPainter3dAlgorithms.cxx:3161
 TPainter3dAlgorithms.cxx:3162
 TPainter3dAlgorithms.cxx:3163
 TPainter3dAlgorithms.cxx:3164
 TPainter3dAlgorithms.cxx:3165
 TPainter3dAlgorithms.cxx:3166
 TPainter3dAlgorithms.cxx:3167
 TPainter3dAlgorithms.cxx:3168
 TPainter3dAlgorithms.cxx:3169
 TPainter3dAlgorithms.cxx:3170
 TPainter3dAlgorithms.cxx:3171
 TPainter3dAlgorithms.cxx:3172
 TPainter3dAlgorithms.cxx:3173
 TPainter3dAlgorithms.cxx:3174
 TPainter3dAlgorithms.cxx:3175
 TPainter3dAlgorithms.cxx:3176
 TPainter3dAlgorithms.cxx:3177
 TPainter3dAlgorithms.cxx:3178
 TPainter3dAlgorithms.cxx:3179
 TPainter3dAlgorithms.cxx:3180
 TPainter3dAlgorithms.cxx:3181
 TPainter3dAlgorithms.cxx:3182
 TPainter3dAlgorithms.cxx:3183
 TPainter3dAlgorithms.cxx:3184
 TPainter3dAlgorithms.cxx:3185
 TPainter3dAlgorithms.cxx:3186
 TPainter3dAlgorithms.cxx:3187
 TPainter3dAlgorithms.cxx:3188
 TPainter3dAlgorithms.cxx:3189
 TPainter3dAlgorithms.cxx:3190
 TPainter3dAlgorithms.cxx:3191
 TPainter3dAlgorithms.cxx:3192
 TPainter3dAlgorithms.cxx:3193
 TPainter3dAlgorithms.cxx:3194
 TPainter3dAlgorithms.cxx:3195
 TPainter3dAlgorithms.cxx:3196
 TPainter3dAlgorithms.cxx:3197
 TPainter3dAlgorithms.cxx:3198
 TPainter3dAlgorithms.cxx:3199
 TPainter3dAlgorithms.cxx:3200
 TPainter3dAlgorithms.cxx:3201
 TPainter3dAlgorithms.cxx:3202
 TPainter3dAlgorithms.cxx:3203
 TPainter3dAlgorithms.cxx:3204
 TPainter3dAlgorithms.cxx:3205
 TPainter3dAlgorithms.cxx:3206
 TPainter3dAlgorithms.cxx:3207
 TPainter3dAlgorithms.cxx:3208
 TPainter3dAlgorithms.cxx:3209
 TPainter3dAlgorithms.cxx:3210
 TPainter3dAlgorithms.cxx:3211
 TPainter3dAlgorithms.cxx:3212
 TPainter3dAlgorithms.cxx:3213
 TPainter3dAlgorithms.cxx:3214
 TPainter3dAlgorithms.cxx:3215
 TPainter3dAlgorithms.cxx:3216
 TPainter3dAlgorithms.cxx:3217
 TPainter3dAlgorithms.cxx:3218
 TPainter3dAlgorithms.cxx:3219
 TPainter3dAlgorithms.cxx:3220
 TPainter3dAlgorithms.cxx:3221
 TPainter3dAlgorithms.cxx:3222
 TPainter3dAlgorithms.cxx:3223
 TPainter3dAlgorithms.cxx:3224
 TPainter3dAlgorithms.cxx:3225
 TPainter3dAlgorithms.cxx:3226
 TPainter3dAlgorithms.cxx:3227
 TPainter3dAlgorithms.cxx:3228
 TPainter3dAlgorithms.cxx:3229
 TPainter3dAlgorithms.cxx:3230
 TPainter3dAlgorithms.cxx:3231
 TPainter3dAlgorithms.cxx:3232
 TPainter3dAlgorithms.cxx:3233
 TPainter3dAlgorithms.cxx:3234
 TPainter3dAlgorithms.cxx:3235
 TPainter3dAlgorithms.cxx:3236
 TPainter3dAlgorithms.cxx:3237
 TPainter3dAlgorithms.cxx:3238
 TPainter3dAlgorithms.cxx:3239
 TPainter3dAlgorithms.cxx:3240
 TPainter3dAlgorithms.cxx:3241
 TPainter3dAlgorithms.cxx:3242
 TPainter3dAlgorithms.cxx:3243
 TPainter3dAlgorithms.cxx:3244
 TPainter3dAlgorithms.cxx:3245
 TPainter3dAlgorithms.cxx:3246
 TPainter3dAlgorithms.cxx:3247
 TPainter3dAlgorithms.cxx:3248
 TPainter3dAlgorithms.cxx:3249
 TPainter3dAlgorithms.cxx:3250
 TPainter3dAlgorithms.cxx:3251
 TPainter3dAlgorithms.cxx:3252
 TPainter3dAlgorithms.cxx:3253
 TPainter3dAlgorithms.cxx:3254
 TPainter3dAlgorithms.cxx:3255
 TPainter3dAlgorithms.cxx:3256
 TPainter3dAlgorithms.cxx:3257
 TPainter3dAlgorithms.cxx:3258
 TPainter3dAlgorithms.cxx:3259
 TPainter3dAlgorithms.cxx:3260
 TPainter3dAlgorithms.cxx:3261
 TPainter3dAlgorithms.cxx:3262
 TPainter3dAlgorithms.cxx:3263
 TPainter3dAlgorithms.cxx:3264
 TPainter3dAlgorithms.cxx:3265
 TPainter3dAlgorithms.cxx:3266
 TPainter3dAlgorithms.cxx:3267
 TPainter3dAlgorithms.cxx:3268
 TPainter3dAlgorithms.cxx:3269
 TPainter3dAlgorithms.cxx:3270
 TPainter3dAlgorithms.cxx:3271
 TPainter3dAlgorithms.cxx:3272
 TPainter3dAlgorithms.cxx:3273
 TPainter3dAlgorithms.cxx:3274
 TPainter3dAlgorithms.cxx:3275
 TPainter3dAlgorithms.cxx:3276
 TPainter3dAlgorithms.cxx:3277
 TPainter3dAlgorithms.cxx:3278
 TPainter3dAlgorithms.cxx:3279
 TPainter3dAlgorithms.cxx:3280
 TPainter3dAlgorithms.cxx:3281
 TPainter3dAlgorithms.cxx:3282
 TPainter3dAlgorithms.cxx:3283
 TPainter3dAlgorithms.cxx:3284
 TPainter3dAlgorithms.cxx:3285
 TPainter3dAlgorithms.cxx:3286
 TPainter3dAlgorithms.cxx:3287
 TPainter3dAlgorithms.cxx:3288
 TPainter3dAlgorithms.cxx:3289
 TPainter3dAlgorithms.cxx:3290
 TPainter3dAlgorithms.cxx:3291
 TPainter3dAlgorithms.cxx:3292
 TPainter3dAlgorithms.cxx:3293
 TPainter3dAlgorithms.cxx:3294
 TPainter3dAlgorithms.cxx:3295
 TPainter3dAlgorithms.cxx:3296
 TPainter3dAlgorithms.cxx:3297
 TPainter3dAlgorithms.cxx:3298
 TPainter3dAlgorithms.cxx:3299
 TPainter3dAlgorithms.cxx:3300
 TPainter3dAlgorithms.cxx:3301
 TPainter3dAlgorithms.cxx:3302
 TPainter3dAlgorithms.cxx:3303
 TPainter3dAlgorithms.cxx:3304
 TPainter3dAlgorithms.cxx:3305
 TPainter3dAlgorithms.cxx:3306
 TPainter3dAlgorithms.cxx:3307
 TPainter3dAlgorithms.cxx:3308
 TPainter3dAlgorithms.cxx:3309
 TPainter3dAlgorithms.cxx:3310
 TPainter3dAlgorithms.cxx:3311
 TPainter3dAlgorithms.cxx:3312
 TPainter3dAlgorithms.cxx:3313
 TPainter3dAlgorithms.cxx:3314
 TPainter3dAlgorithms.cxx:3315
 TPainter3dAlgorithms.cxx:3316
 TPainter3dAlgorithms.cxx:3317
 TPainter3dAlgorithms.cxx:3318
 TPainter3dAlgorithms.cxx:3319
 TPainter3dAlgorithms.cxx:3320
 TPainter3dAlgorithms.cxx:3321
 TPainter3dAlgorithms.cxx:3322
 TPainter3dAlgorithms.cxx:3323
 TPainter3dAlgorithms.cxx:3324
 TPainter3dAlgorithms.cxx:3325
 TPainter3dAlgorithms.cxx:3326
 TPainter3dAlgorithms.cxx:3327
 TPainter3dAlgorithms.cxx:3328
 TPainter3dAlgorithms.cxx:3329
 TPainter3dAlgorithms.cxx:3330
 TPainter3dAlgorithms.cxx:3331
 TPainter3dAlgorithms.cxx:3332
 TPainter3dAlgorithms.cxx:3333
 TPainter3dAlgorithms.cxx:3334
 TPainter3dAlgorithms.cxx:3335
 TPainter3dAlgorithms.cxx:3336
 TPainter3dAlgorithms.cxx:3337
 TPainter3dAlgorithms.cxx:3338
 TPainter3dAlgorithms.cxx:3339
 TPainter3dAlgorithms.cxx:3340
 TPainter3dAlgorithms.cxx:3341
 TPainter3dAlgorithms.cxx:3342
 TPainter3dAlgorithms.cxx:3343
 TPainter3dAlgorithms.cxx:3344
 TPainter3dAlgorithms.cxx:3345
 TPainter3dAlgorithms.cxx:3346
 TPainter3dAlgorithms.cxx:3347
 TPainter3dAlgorithms.cxx:3348
 TPainter3dAlgorithms.cxx:3349
 TPainter3dAlgorithms.cxx:3350
 TPainter3dAlgorithms.cxx:3351
 TPainter3dAlgorithms.cxx:3352
 TPainter3dAlgorithms.cxx:3353
 TPainter3dAlgorithms.cxx:3354
 TPainter3dAlgorithms.cxx:3355
 TPainter3dAlgorithms.cxx:3356
 TPainter3dAlgorithms.cxx:3357
 TPainter3dAlgorithms.cxx:3358
 TPainter3dAlgorithms.cxx:3359
 TPainter3dAlgorithms.cxx:3360
 TPainter3dAlgorithms.cxx:3361
 TPainter3dAlgorithms.cxx:3362
 TPainter3dAlgorithms.cxx:3363
 TPainter3dAlgorithms.cxx:3364
 TPainter3dAlgorithms.cxx:3365
 TPainter3dAlgorithms.cxx:3366
 TPainter3dAlgorithms.cxx:3367
 TPainter3dAlgorithms.cxx:3368
 TPainter3dAlgorithms.cxx:3369
 TPainter3dAlgorithms.cxx:3370
 TPainter3dAlgorithms.cxx:3371
 TPainter3dAlgorithms.cxx:3372
 TPainter3dAlgorithms.cxx:3373
 TPainter3dAlgorithms.cxx:3374
 TPainter3dAlgorithms.cxx:3375
 TPainter3dAlgorithms.cxx:3376
 TPainter3dAlgorithms.cxx:3377
 TPainter3dAlgorithms.cxx:3378
 TPainter3dAlgorithms.cxx:3379
 TPainter3dAlgorithms.cxx:3380
 TPainter3dAlgorithms.cxx:3381
 TPainter3dAlgorithms.cxx:3382
 TPainter3dAlgorithms.cxx:3383
 TPainter3dAlgorithms.cxx:3384
 TPainter3dAlgorithms.cxx:3385
 TPainter3dAlgorithms.cxx:3386
 TPainter3dAlgorithms.cxx:3387
 TPainter3dAlgorithms.cxx:3388
 TPainter3dAlgorithms.cxx:3389
 TPainter3dAlgorithms.cxx:3390
 TPainter3dAlgorithms.cxx:3391
 TPainter3dAlgorithms.cxx:3392
 TPainter3dAlgorithms.cxx:3393
 TPainter3dAlgorithms.cxx:3394
 TPainter3dAlgorithms.cxx:3395
 TPainter3dAlgorithms.cxx:3396
 TPainter3dAlgorithms.cxx:3397
 TPainter3dAlgorithms.cxx:3398
 TPainter3dAlgorithms.cxx:3399
 TPainter3dAlgorithms.cxx:3400
 TPainter3dAlgorithms.cxx:3401
 TPainter3dAlgorithms.cxx:3402
 TPainter3dAlgorithms.cxx:3403
 TPainter3dAlgorithms.cxx:3404
 TPainter3dAlgorithms.cxx:3405
 TPainter3dAlgorithms.cxx:3406
 TPainter3dAlgorithms.cxx:3407
 TPainter3dAlgorithms.cxx:3408
 TPainter3dAlgorithms.cxx:3409
 TPainter3dAlgorithms.cxx:3410
 TPainter3dAlgorithms.cxx:3411
 TPainter3dAlgorithms.cxx:3412
 TPainter3dAlgorithms.cxx:3413
 TPainter3dAlgorithms.cxx:3414
 TPainter3dAlgorithms.cxx:3415
 TPainter3dAlgorithms.cxx:3416
 TPainter3dAlgorithms.cxx:3417
 TPainter3dAlgorithms.cxx:3418
 TPainter3dAlgorithms.cxx:3419
 TPainter3dAlgorithms.cxx:3420
 TPainter3dAlgorithms.cxx:3421
 TPainter3dAlgorithms.cxx:3422
 TPainter3dAlgorithms.cxx:3423
 TPainter3dAlgorithms.cxx:3424
 TPainter3dAlgorithms.cxx:3425
 TPainter3dAlgorithms.cxx:3426
 TPainter3dAlgorithms.cxx:3427
 TPainter3dAlgorithms.cxx:3428
 TPainter3dAlgorithms.cxx:3429
 TPainter3dAlgorithms.cxx:3430
 TPainter3dAlgorithms.cxx:3431
 TPainter3dAlgorithms.cxx:3432
 TPainter3dAlgorithms.cxx:3433
 TPainter3dAlgorithms.cxx:3434
 TPainter3dAlgorithms.cxx:3435
 TPainter3dAlgorithms.cxx:3436
 TPainter3dAlgorithms.cxx:3437
 TPainter3dAlgorithms.cxx:3438
 TPainter3dAlgorithms.cxx:3439
 TPainter3dAlgorithms.cxx:3440
 TPainter3dAlgorithms.cxx:3441
 TPainter3dAlgorithms.cxx:3442
 TPainter3dAlgorithms.cxx:3443
 TPainter3dAlgorithms.cxx:3444
 TPainter3dAlgorithms.cxx:3445
 TPainter3dAlgorithms.cxx:3446
 TPainter3dAlgorithms.cxx:3447
 TPainter3dAlgorithms.cxx:3448
 TPainter3dAlgorithms.cxx:3449
 TPainter3dAlgorithms.cxx:3450
 TPainter3dAlgorithms.cxx:3451
 TPainter3dAlgorithms.cxx:3452
 TPainter3dAlgorithms.cxx:3453
 TPainter3dAlgorithms.cxx:3454
 TPainter3dAlgorithms.cxx:3455
 TPainter3dAlgorithms.cxx:3456
 TPainter3dAlgorithms.cxx:3457
 TPainter3dAlgorithms.cxx:3458
 TPainter3dAlgorithms.cxx:3459
 TPainter3dAlgorithms.cxx:3460
 TPainter3dAlgorithms.cxx:3461
 TPainter3dAlgorithms.cxx:3462
 TPainter3dAlgorithms.cxx:3463
 TPainter3dAlgorithms.cxx:3464
 TPainter3dAlgorithms.cxx:3465
 TPainter3dAlgorithms.cxx:3466
 TPainter3dAlgorithms.cxx:3467
 TPainter3dAlgorithms.cxx:3468
 TPainter3dAlgorithms.cxx:3469
 TPainter3dAlgorithms.cxx:3470
 TPainter3dAlgorithms.cxx:3471
 TPainter3dAlgorithms.cxx:3472
 TPainter3dAlgorithms.cxx:3473
 TPainter3dAlgorithms.cxx:3474
 TPainter3dAlgorithms.cxx:3475
 TPainter3dAlgorithms.cxx:3476
 TPainter3dAlgorithms.cxx:3477
 TPainter3dAlgorithms.cxx:3478
 TPainter3dAlgorithms.cxx:3479
 TPainter3dAlgorithms.cxx:3480
 TPainter3dAlgorithms.cxx:3481
 TPainter3dAlgorithms.cxx:3482
 TPainter3dAlgorithms.cxx:3483
 TPainter3dAlgorithms.cxx:3484
 TPainter3dAlgorithms.cxx:3485
 TPainter3dAlgorithms.cxx:3486
 TPainter3dAlgorithms.cxx:3487
 TPainter3dAlgorithms.cxx:3488
 TPainter3dAlgorithms.cxx:3489
 TPainter3dAlgorithms.cxx:3490
 TPainter3dAlgorithms.cxx:3491
 TPainter3dAlgorithms.cxx:3492
 TPainter3dAlgorithms.cxx:3493
 TPainter3dAlgorithms.cxx:3494
 TPainter3dAlgorithms.cxx:3495
 TPainter3dAlgorithms.cxx:3496
 TPainter3dAlgorithms.cxx:3497
 TPainter3dAlgorithms.cxx:3498
 TPainter3dAlgorithms.cxx:3499
 TPainter3dAlgorithms.cxx:3500
 TPainter3dAlgorithms.cxx:3501
 TPainter3dAlgorithms.cxx:3502
 TPainter3dAlgorithms.cxx:3503
 TPainter3dAlgorithms.cxx:3504
 TPainter3dAlgorithms.cxx:3505
 TPainter3dAlgorithms.cxx:3506
 TPainter3dAlgorithms.cxx:3507
 TPainter3dAlgorithms.cxx:3508
 TPainter3dAlgorithms.cxx:3509
 TPainter3dAlgorithms.cxx:3510
 TPainter3dAlgorithms.cxx:3511
 TPainter3dAlgorithms.cxx:3512
 TPainter3dAlgorithms.cxx:3513
 TPainter3dAlgorithms.cxx:3514
 TPainter3dAlgorithms.cxx:3515
 TPainter3dAlgorithms.cxx:3516
 TPainter3dAlgorithms.cxx:3517
 TPainter3dAlgorithms.cxx:3518
 TPainter3dAlgorithms.cxx:3519
 TPainter3dAlgorithms.cxx:3520
 TPainter3dAlgorithms.cxx:3521
 TPainter3dAlgorithms.cxx:3522
 TPainter3dAlgorithms.cxx:3523
 TPainter3dAlgorithms.cxx:3524
 TPainter3dAlgorithms.cxx:3525
 TPainter3dAlgorithms.cxx:3526
 TPainter3dAlgorithms.cxx:3527
 TPainter3dAlgorithms.cxx:3528
 TPainter3dAlgorithms.cxx:3529
 TPainter3dAlgorithms.cxx:3530
 TPainter3dAlgorithms.cxx:3531
 TPainter3dAlgorithms.cxx:3532
 TPainter3dAlgorithms.cxx:3533
 TPainter3dAlgorithms.cxx:3534
 TPainter3dAlgorithms.cxx:3535
 TPainter3dAlgorithms.cxx:3536
 TPainter3dAlgorithms.cxx:3537
 TPainter3dAlgorithms.cxx:3538
 TPainter3dAlgorithms.cxx:3539
 TPainter3dAlgorithms.cxx:3540
 TPainter3dAlgorithms.cxx:3541
 TPainter3dAlgorithms.cxx:3542
 TPainter3dAlgorithms.cxx:3543
 TPainter3dAlgorithms.cxx:3544
 TPainter3dAlgorithms.cxx:3545
 TPainter3dAlgorithms.cxx:3546
 TPainter3dAlgorithms.cxx:3547
 TPainter3dAlgorithms.cxx:3548
 TPainter3dAlgorithms.cxx:3549
 TPainter3dAlgorithms.cxx:3550
 TPainter3dAlgorithms.cxx:3551
 TPainter3dAlgorithms.cxx:3552
 TPainter3dAlgorithms.cxx:3553
 TPainter3dAlgorithms.cxx:3554
 TPainter3dAlgorithms.cxx:3555
 TPainter3dAlgorithms.cxx:3556
 TPainter3dAlgorithms.cxx:3557
 TPainter3dAlgorithms.cxx:3558
 TPainter3dAlgorithms.cxx:3559
 TPainter3dAlgorithms.cxx:3560
 TPainter3dAlgorithms.cxx:3561
 TPainter3dAlgorithms.cxx:3562
 TPainter3dAlgorithms.cxx:3563
 TPainter3dAlgorithms.cxx:3564
 TPainter3dAlgorithms.cxx:3565
 TPainter3dAlgorithms.cxx:3566
 TPainter3dAlgorithms.cxx:3567
 TPainter3dAlgorithms.cxx:3568
 TPainter3dAlgorithms.cxx:3569
 TPainter3dAlgorithms.cxx:3570
 TPainter3dAlgorithms.cxx:3571
 TPainter3dAlgorithms.cxx:3572
 TPainter3dAlgorithms.cxx:3573
 TPainter3dAlgorithms.cxx:3574
 TPainter3dAlgorithms.cxx:3575
 TPainter3dAlgorithms.cxx:3576
 TPainter3dAlgorithms.cxx:3577
 TPainter3dAlgorithms.cxx:3578
 TPainter3dAlgorithms.cxx:3579
 TPainter3dAlgorithms.cxx:3580
 TPainter3dAlgorithms.cxx:3581
 TPainter3dAlgorithms.cxx:3582
 TPainter3dAlgorithms.cxx:3583
 TPainter3dAlgorithms.cxx:3584
 TPainter3dAlgorithms.cxx:3585
 TPainter3dAlgorithms.cxx:3586
 TPainter3dAlgorithms.cxx:3587
 TPainter3dAlgorithms.cxx:3588
 TPainter3dAlgorithms.cxx:3589
 TPainter3dAlgorithms.cxx:3590
 TPainter3dAlgorithms.cxx:3591
 TPainter3dAlgorithms.cxx:3592
 TPainter3dAlgorithms.cxx:3593
 TPainter3dAlgorithms.cxx:3594
 TPainter3dAlgorithms.cxx:3595
 TPainter3dAlgorithms.cxx:3596
 TPainter3dAlgorithms.cxx:3597
 TPainter3dAlgorithms.cxx:3598
 TPainter3dAlgorithms.cxx:3599
 TPainter3dAlgorithms.cxx:3600
 TPainter3dAlgorithms.cxx:3601
 TPainter3dAlgorithms.cxx:3602
 TPainter3dAlgorithms.cxx:3603
 TPainter3dAlgorithms.cxx:3604
 TPainter3dAlgorithms.cxx:3605
 TPainter3dAlgorithms.cxx:3606
 TPainter3dAlgorithms.cxx:3607
 TPainter3dAlgorithms.cxx:3608
 TPainter3dAlgorithms.cxx:3609
 TPainter3dAlgorithms.cxx:3610
 TPainter3dAlgorithms.cxx:3611
 TPainter3dAlgorithms.cxx:3612
 TPainter3dAlgorithms.cxx:3613
 TPainter3dAlgorithms.cxx:3614
 TPainter3dAlgorithms.cxx:3615
 TPainter3dAlgorithms.cxx:3616
 TPainter3dAlgorithms.cxx:3617
 TPainter3dAlgorithms.cxx:3618
 TPainter3dAlgorithms.cxx:3619
 TPainter3dAlgorithms.cxx:3620
 TPainter3dAlgorithms.cxx:3621
 TPainter3dAlgorithms.cxx:3622
 TPainter3dAlgorithms.cxx:3623
 TPainter3dAlgorithms.cxx:3624
 TPainter3dAlgorithms.cxx:3625
 TPainter3dAlgorithms.cxx:3626
 TPainter3dAlgorithms.cxx:3627
 TPainter3dAlgorithms.cxx:3628
 TPainter3dAlgorithms.cxx:3629
 TPainter3dAlgorithms.cxx:3630
 TPainter3dAlgorithms.cxx:3631
 TPainter3dAlgorithms.cxx:3632
 TPainter3dAlgorithms.cxx:3633
 TPainter3dAlgorithms.cxx:3634
 TPainter3dAlgorithms.cxx:3635
 TPainter3dAlgorithms.cxx:3636
 TPainter3dAlgorithms.cxx:3637
 TPainter3dAlgorithms.cxx:3638
 TPainter3dAlgorithms.cxx:3639
 TPainter3dAlgorithms.cxx:3640
 TPainter3dAlgorithms.cxx:3641
 TPainter3dAlgorithms.cxx:3642
 TPainter3dAlgorithms.cxx:3643
 TPainter3dAlgorithms.cxx:3644
 TPainter3dAlgorithms.cxx:3645
 TPainter3dAlgorithms.cxx:3646
 TPainter3dAlgorithms.cxx:3647
 TPainter3dAlgorithms.cxx:3648
 TPainter3dAlgorithms.cxx:3649
 TPainter3dAlgorithms.cxx:3650
 TPainter3dAlgorithms.cxx:3651
 TPainter3dAlgorithms.cxx:3652
 TPainter3dAlgorithms.cxx:3653
 TPainter3dAlgorithms.cxx:3654
 TPainter3dAlgorithms.cxx:3655
 TPainter3dAlgorithms.cxx:3656
 TPainter3dAlgorithms.cxx:3657
 TPainter3dAlgorithms.cxx:3658
 TPainter3dAlgorithms.cxx:3659
 TPainter3dAlgorithms.cxx:3660
 TPainter3dAlgorithms.cxx:3661
 TPainter3dAlgorithms.cxx:3662
 TPainter3dAlgorithms.cxx:3663
 TPainter3dAlgorithms.cxx:3664
 TPainter3dAlgorithms.cxx:3665
 TPainter3dAlgorithms.cxx:3666
 TPainter3dAlgorithms.cxx:3667
 TPainter3dAlgorithms.cxx:3668
 TPainter3dAlgorithms.cxx:3669
 TPainter3dAlgorithms.cxx:3670
 TPainter3dAlgorithms.cxx:3671
 TPainter3dAlgorithms.cxx:3672
 TPainter3dAlgorithms.cxx:3673
 TPainter3dAlgorithms.cxx:3674
 TPainter3dAlgorithms.cxx:3675
 TPainter3dAlgorithms.cxx:3676
 TPainter3dAlgorithms.cxx:3677
 TPainter3dAlgorithms.cxx:3678
 TPainter3dAlgorithms.cxx:3679
 TPainter3dAlgorithms.cxx:3680
 TPainter3dAlgorithms.cxx:3681
 TPainter3dAlgorithms.cxx:3682
 TPainter3dAlgorithms.cxx:3683
 TPainter3dAlgorithms.cxx:3684
 TPainter3dAlgorithms.cxx:3685
 TPainter3dAlgorithms.cxx:3686
 TPainter3dAlgorithms.cxx:3687
 TPainter3dAlgorithms.cxx:3688
 TPainter3dAlgorithms.cxx:3689
 TPainter3dAlgorithms.cxx:3690
 TPainter3dAlgorithms.cxx:3691
 TPainter3dAlgorithms.cxx:3692
 TPainter3dAlgorithms.cxx:3693
 TPainter3dAlgorithms.cxx:3694
 TPainter3dAlgorithms.cxx:3695
 TPainter3dAlgorithms.cxx:3696
 TPainter3dAlgorithms.cxx:3697
 TPainter3dAlgorithms.cxx:3698
 TPainter3dAlgorithms.cxx:3699
 TPainter3dAlgorithms.cxx:3700
 TPainter3dAlgorithms.cxx:3701
 TPainter3dAlgorithms.cxx:3702
 TPainter3dAlgorithms.cxx:3703
 TPainter3dAlgorithms.cxx:3704
 TPainter3dAlgorithms.cxx:3705
 TPainter3dAlgorithms.cxx:3706
 TPainter3dAlgorithms.cxx:3707
 TPainter3dAlgorithms.cxx:3708
 TPainter3dAlgorithms.cxx:3709
 TPainter3dAlgorithms.cxx:3710
 TPainter3dAlgorithms.cxx:3711
 TPainter3dAlgorithms.cxx:3712
 TPainter3dAlgorithms.cxx:3713
 TPainter3dAlgorithms.cxx:3714
 TPainter3dAlgorithms.cxx:3715
 TPainter3dAlgorithms.cxx:3716
 TPainter3dAlgorithms.cxx:3717
 TPainter3dAlgorithms.cxx:3718
 TPainter3dAlgorithms.cxx:3719
 TPainter3dAlgorithms.cxx:3720
 TPainter3dAlgorithms.cxx:3721
 TPainter3dAlgorithms.cxx:3722
 TPainter3dAlgorithms.cxx:3723
 TPainter3dAlgorithms.cxx:3724
 TPainter3dAlgorithms.cxx:3725
 TPainter3dAlgorithms.cxx:3726
 TPainter3dAlgorithms.cxx:3727
 TPainter3dAlgorithms.cxx:3728
 TPainter3dAlgorithms.cxx:3729
 TPainter3dAlgorithms.cxx:3730
 TPainter3dAlgorithms.cxx:3731
 TPainter3dAlgorithms.cxx:3732
 TPainter3dAlgorithms.cxx:3733
 TPainter3dAlgorithms.cxx:3734
 TPainter3dAlgorithms.cxx:3735
 TPainter3dAlgorithms.cxx:3736
 TPainter3dAlgorithms.cxx:3737
 TPainter3dAlgorithms.cxx:3738
 TPainter3dAlgorithms.cxx:3739
 TPainter3dAlgorithms.cxx:3740
 TPainter3dAlgorithms.cxx:3741
 TPainter3dAlgorithms.cxx:3742
 TPainter3dAlgorithms.cxx:3743
 TPainter3dAlgorithms.cxx:3744
 TPainter3dAlgorithms.cxx:3745
 TPainter3dAlgorithms.cxx:3746
 TPainter3dAlgorithms.cxx:3747
 TPainter3dAlgorithms.cxx:3748
 TPainter3dAlgorithms.cxx:3749
 TPainter3dAlgorithms.cxx:3750
 TPainter3dAlgorithms.cxx:3751
 TPainter3dAlgorithms.cxx:3752
 TPainter3dAlgorithms.cxx:3753
 TPainter3dAlgorithms.cxx:3754
 TPainter3dAlgorithms.cxx:3755
 TPainter3dAlgorithms.cxx:3756
 TPainter3dAlgorithms.cxx:3757
 TPainter3dAlgorithms.cxx:3758
 TPainter3dAlgorithms.cxx:3759
 TPainter3dAlgorithms.cxx:3760
 TPainter3dAlgorithms.cxx:3761
 TPainter3dAlgorithms.cxx:3762
 TPainter3dAlgorithms.cxx:3763
 TPainter3dAlgorithms.cxx:3764
 TPainter3dAlgorithms.cxx:3765
 TPainter3dAlgorithms.cxx:3766
 TPainter3dAlgorithms.cxx:3767
 TPainter3dAlgorithms.cxx:3768
 TPainter3dAlgorithms.cxx:3769
 TPainter3dAlgorithms.cxx:3770
 TPainter3dAlgorithms.cxx:3771
 TPainter3dAlgorithms.cxx:3772
 TPainter3dAlgorithms.cxx:3773
 TPainter3dAlgorithms.cxx:3774
 TPainter3dAlgorithms.cxx:3775
 TPainter3dAlgorithms.cxx:3776
 TPainter3dAlgorithms.cxx:3777
 TPainter3dAlgorithms.cxx:3778
 TPainter3dAlgorithms.cxx:3779
 TPainter3dAlgorithms.cxx:3780
 TPainter3dAlgorithms.cxx:3781
 TPainter3dAlgorithms.cxx:3782
 TPainter3dAlgorithms.cxx:3783
 TPainter3dAlgorithms.cxx:3784
 TPainter3dAlgorithms.cxx:3785
 TPainter3dAlgorithms.cxx:3786
 TPainter3dAlgorithms.cxx:3787
 TPainter3dAlgorithms.cxx:3788
 TPainter3dAlgorithms.cxx:3789
 TPainter3dAlgorithms.cxx:3790
 TPainter3dAlgorithms.cxx:3791
 TPainter3dAlgorithms.cxx:3792
 TPainter3dAlgorithms.cxx:3793
 TPainter3dAlgorithms.cxx:3794
 TPainter3dAlgorithms.cxx:3795
 TPainter3dAlgorithms.cxx:3796
 TPainter3dAlgorithms.cxx:3797
 TPainter3dAlgorithms.cxx:3798
 TPainter3dAlgorithms.cxx:3799
 TPainter3dAlgorithms.cxx:3800
 TPainter3dAlgorithms.cxx:3801
 TPainter3dAlgorithms.cxx:3802
 TPainter3dAlgorithms.cxx:3803
 TPainter3dAlgorithms.cxx:3804
 TPainter3dAlgorithms.cxx:3805
 TPainter3dAlgorithms.cxx:3806
 TPainter3dAlgorithms.cxx:3807
 TPainter3dAlgorithms.cxx:3808
 TPainter3dAlgorithms.cxx:3809
 TPainter3dAlgorithms.cxx:3810
 TPainter3dAlgorithms.cxx:3811
 TPainter3dAlgorithms.cxx:3812
 TPainter3dAlgorithms.cxx:3813
 TPainter3dAlgorithms.cxx:3814
 TPainter3dAlgorithms.cxx:3815
 TPainter3dAlgorithms.cxx:3816
 TPainter3dAlgorithms.cxx:3817
 TPainter3dAlgorithms.cxx:3818
 TPainter3dAlgorithms.cxx:3819
 TPainter3dAlgorithms.cxx:3820
 TPainter3dAlgorithms.cxx:3821
 TPainter3dAlgorithms.cxx:3822
 TPainter3dAlgorithms.cxx:3823
 TPainter3dAlgorithms.cxx:3824
 TPainter3dAlgorithms.cxx:3825
 TPainter3dAlgorithms.cxx:3826
 TPainter3dAlgorithms.cxx:3827
 TPainter3dAlgorithms.cxx:3828
 TPainter3dAlgorithms.cxx:3829
 TPainter3dAlgorithms.cxx:3830
 TPainter3dAlgorithms.cxx:3831
 TPainter3dAlgorithms.cxx:3832
 TPainter3dAlgorithms.cxx:3833
 TPainter3dAlgorithms.cxx:3834
 TPainter3dAlgorithms.cxx:3835
 TPainter3dAlgorithms.cxx:3836
 TPainter3dAlgorithms.cxx:3837
 TPainter3dAlgorithms.cxx:3838
 TPainter3dAlgorithms.cxx:3839
 TPainter3dAlgorithms.cxx:3840
 TPainter3dAlgorithms.cxx:3841
 TPainter3dAlgorithms.cxx:3842
 TPainter3dAlgorithms.cxx:3843
 TPainter3dAlgorithms.cxx:3844
 TPainter3dAlgorithms.cxx:3845
 TPainter3dAlgorithms.cxx:3846
 TPainter3dAlgorithms.cxx:3847
 TPainter3dAlgorithms.cxx:3848
 TPainter3dAlgorithms.cxx:3849
 TPainter3dAlgorithms.cxx:3850
 TPainter3dAlgorithms.cxx:3851
 TPainter3dAlgorithms.cxx:3852
 TPainter3dAlgorithms.cxx:3853
 TPainter3dAlgorithms.cxx:3854
 TPainter3dAlgorithms.cxx:3855
 TPainter3dAlgorithms.cxx:3856
 TPainter3dAlgorithms.cxx:3857
 TPainter3dAlgorithms.cxx:3858
 TPainter3dAlgorithms.cxx:3859
 TPainter3dAlgorithms.cxx:3860
 TPainter3dAlgorithms.cxx:3861
 TPainter3dAlgorithms.cxx:3862
 TPainter3dAlgorithms.cxx:3863
 TPainter3dAlgorithms.cxx:3864
 TPainter3dAlgorithms.cxx:3865
 TPainter3dAlgorithms.cxx:3866
 TPainter3dAlgorithms.cxx:3867
 TPainter3dAlgorithms.cxx:3868
 TPainter3dAlgorithms.cxx:3869
 TPainter3dAlgorithms.cxx:3870
 TPainter3dAlgorithms.cxx:3871
 TPainter3dAlgorithms.cxx:3872
 TPainter3dAlgorithms.cxx:3873
 TPainter3dAlgorithms.cxx:3874
 TPainter3dAlgorithms.cxx:3875
 TPainter3dAlgorithms.cxx:3876
 TPainter3dAlgorithms.cxx:3877
 TPainter3dAlgorithms.cxx:3878
 TPainter3dAlgorithms.cxx:3879
 TPainter3dAlgorithms.cxx:3880
 TPainter3dAlgorithms.cxx:3881
 TPainter3dAlgorithms.cxx:3882
 TPainter3dAlgorithms.cxx:3883
 TPainter3dAlgorithms.cxx:3884
 TPainter3dAlgorithms.cxx:3885
 TPainter3dAlgorithms.cxx:3886
 TPainter3dAlgorithms.cxx:3887
 TPainter3dAlgorithms.cxx:3888
 TPainter3dAlgorithms.cxx:3889
 TPainter3dAlgorithms.cxx:3890
 TPainter3dAlgorithms.cxx:3891
 TPainter3dAlgorithms.cxx:3892
 TPainter3dAlgorithms.cxx:3893
 TPainter3dAlgorithms.cxx:3894
 TPainter3dAlgorithms.cxx:3895
 TPainter3dAlgorithms.cxx:3896
 TPainter3dAlgorithms.cxx:3897
 TPainter3dAlgorithms.cxx:3898
 TPainter3dAlgorithms.cxx:3899
 TPainter3dAlgorithms.cxx:3900
 TPainter3dAlgorithms.cxx:3901
 TPainter3dAlgorithms.cxx:3902
 TPainter3dAlgorithms.cxx:3903
 TPainter3dAlgorithms.cxx:3904
 TPainter3dAlgorithms.cxx:3905
 TPainter3dAlgorithms.cxx:3906
 TPainter3dAlgorithms.cxx:3907
 TPainter3dAlgorithms.cxx:3908
 TPainter3dAlgorithms.cxx:3909
 TPainter3dAlgorithms.cxx:3910
 TPainter3dAlgorithms.cxx:3911
 TPainter3dAlgorithms.cxx:3912
 TPainter3dAlgorithms.cxx:3913
 TPainter3dAlgorithms.cxx:3914
 TPainter3dAlgorithms.cxx:3915
 TPainter3dAlgorithms.cxx:3916
 TPainter3dAlgorithms.cxx:3917
 TPainter3dAlgorithms.cxx:3918
 TPainter3dAlgorithms.cxx:3919
 TPainter3dAlgorithms.cxx:3920
 TPainter3dAlgorithms.cxx:3921
 TPainter3dAlgorithms.cxx:3922
 TPainter3dAlgorithms.cxx:3923
 TPainter3dAlgorithms.cxx:3924
 TPainter3dAlgorithms.cxx:3925
 TPainter3dAlgorithms.cxx:3926
 TPainter3dAlgorithms.cxx:3927
 TPainter3dAlgorithms.cxx:3928
 TPainter3dAlgorithms.cxx:3929
 TPainter3dAlgorithms.cxx:3930
 TPainter3dAlgorithms.cxx:3931
 TPainter3dAlgorithms.cxx:3932
 TPainter3dAlgorithms.cxx:3933
 TPainter3dAlgorithms.cxx:3934
 TPainter3dAlgorithms.cxx:3935
 TPainter3dAlgorithms.cxx:3936
 TPainter3dAlgorithms.cxx:3937
 TPainter3dAlgorithms.cxx:3938
 TPainter3dAlgorithms.cxx:3939
 TPainter3dAlgorithms.cxx:3940
 TPainter3dAlgorithms.cxx:3941
 TPainter3dAlgorithms.cxx:3942
 TPainter3dAlgorithms.cxx:3943
 TPainter3dAlgorithms.cxx:3944
 TPainter3dAlgorithms.cxx:3945
 TPainter3dAlgorithms.cxx:3946
 TPainter3dAlgorithms.cxx:3947
 TPainter3dAlgorithms.cxx:3948
 TPainter3dAlgorithms.cxx:3949
 TPainter3dAlgorithms.cxx:3950
 TPainter3dAlgorithms.cxx:3951
 TPainter3dAlgorithms.cxx:3952
 TPainter3dAlgorithms.cxx:3953
 TPainter3dAlgorithms.cxx:3954
 TPainter3dAlgorithms.cxx:3955
 TPainter3dAlgorithms.cxx:3956
 TPainter3dAlgorithms.cxx:3957
 TPainter3dAlgorithms.cxx:3958
 TPainter3dAlgorithms.cxx:3959
 TPainter3dAlgorithms.cxx:3960
 TPainter3dAlgorithms.cxx:3961
 TPainter3dAlgorithms.cxx:3962
 TPainter3dAlgorithms.cxx:3963
 TPainter3dAlgorithms.cxx:3964
 TPainter3dAlgorithms.cxx:3965
 TPainter3dAlgorithms.cxx:3966
 TPainter3dAlgorithms.cxx:3967
 TPainter3dAlgorithms.cxx:3968
 TPainter3dAlgorithms.cxx:3969
 TPainter3dAlgorithms.cxx:3970
 TPainter3dAlgorithms.cxx:3971
 TPainter3dAlgorithms.cxx:3972
 TPainter3dAlgorithms.cxx:3973
 TPainter3dAlgorithms.cxx:3974
 TPainter3dAlgorithms.cxx:3975
 TPainter3dAlgorithms.cxx:3976
 TPainter3dAlgorithms.cxx:3977
 TPainter3dAlgorithms.cxx:3978
 TPainter3dAlgorithms.cxx:3979
 TPainter3dAlgorithms.cxx:3980
 TPainter3dAlgorithms.cxx:3981
 TPainter3dAlgorithms.cxx:3982
 TPainter3dAlgorithms.cxx:3983
 TPainter3dAlgorithms.cxx:3984
 TPainter3dAlgorithms.cxx:3985
 TPainter3dAlgorithms.cxx:3986
 TPainter3dAlgorithms.cxx:3987
 TPainter3dAlgorithms.cxx:3988
 TPainter3dAlgorithms.cxx:3989
 TPainter3dAlgorithms.cxx:3990
 TPainter3dAlgorithms.cxx:3991
 TPainter3dAlgorithms.cxx:3992
 TPainter3dAlgorithms.cxx:3993
 TPainter3dAlgorithms.cxx:3994
 TPainter3dAlgorithms.cxx:3995
 TPainter3dAlgorithms.cxx:3996
 TPainter3dAlgorithms.cxx:3997
 TPainter3dAlgorithms.cxx:3998
 TPainter3dAlgorithms.cxx:3999
 TPainter3dAlgorithms.cxx:4000
 TPainter3dAlgorithms.cxx:4001
 TPainter3dAlgorithms.cxx:4002
 TPainter3dAlgorithms.cxx:4003
 TPainter3dAlgorithms.cxx:4004
 TPainter3dAlgorithms.cxx:4005
 TPainter3dAlgorithms.cxx:4006
 TPainter3dAlgorithms.cxx:4007
 TPainter3dAlgorithms.cxx:4008
 TPainter3dAlgorithms.cxx:4009
 TPainter3dAlgorithms.cxx:4010
 TPainter3dAlgorithms.cxx:4011
 TPainter3dAlgorithms.cxx:4012
 TPainter3dAlgorithms.cxx:4013
 TPainter3dAlgorithms.cxx:4014
 TPainter3dAlgorithms.cxx:4015
 TPainter3dAlgorithms.cxx:4016
 TPainter3dAlgorithms.cxx:4017
 TPainter3dAlgorithms.cxx:4018
 TPainter3dAlgorithms.cxx:4019
 TPainter3dAlgorithms.cxx:4020
 TPainter3dAlgorithms.cxx:4021
 TPainter3dAlgorithms.cxx:4022
 TPainter3dAlgorithms.cxx:4023
 TPainter3dAlgorithms.cxx:4024
 TPainter3dAlgorithms.cxx:4025
 TPainter3dAlgorithms.cxx:4026
 TPainter3dAlgorithms.cxx:4027
 TPainter3dAlgorithms.cxx:4028
 TPainter3dAlgorithms.cxx:4029
 TPainter3dAlgorithms.cxx:4030
 TPainter3dAlgorithms.cxx:4031
 TPainter3dAlgorithms.cxx:4032
 TPainter3dAlgorithms.cxx:4033
 TPainter3dAlgorithms.cxx:4034
 TPainter3dAlgorithms.cxx:4035
 TPainter3dAlgorithms.cxx:4036
 TPainter3dAlgorithms.cxx:4037
 TPainter3dAlgorithms.cxx:4038
 TPainter3dAlgorithms.cxx:4039
 TPainter3dAlgorithms.cxx:4040
 TPainter3dAlgorithms.cxx:4041
 TPainter3dAlgorithms.cxx:4042
 TPainter3dAlgorithms.cxx:4043
 TPainter3dAlgorithms.cxx:4044
 TPainter3dAlgorithms.cxx:4045
 TPainter3dAlgorithms.cxx:4046
 TPainter3dAlgorithms.cxx:4047
 TPainter3dAlgorithms.cxx:4048
 TPainter3dAlgorithms.cxx:4049
 TPainter3dAlgorithms.cxx:4050
 TPainter3dAlgorithms.cxx:4051
 TPainter3dAlgorithms.cxx:4052
 TPainter3dAlgorithms.cxx:4053
 TPainter3dAlgorithms.cxx:4054
 TPainter3dAlgorithms.cxx:4055
 TPainter3dAlgorithms.cxx:4056
 TPainter3dAlgorithms.cxx:4057
 TPainter3dAlgorithms.cxx:4058
 TPainter3dAlgorithms.cxx:4059
 TPainter3dAlgorithms.cxx:4060
 TPainter3dAlgorithms.cxx:4061
 TPainter3dAlgorithms.cxx:4062
 TPainter3dAlgorithms.cxx:4063
 TPainter3dAlgorithms.cxx:4064
 TPainter3dAlgorithms.cxx:4065
 TPainter3dAlgorithms.cxx:4066
 TPainter3dAlgorithms.cxx:4067
 TPainter3dAlgorithms.cxx:4068
 TPainter3dAlgorithms.cxx:4069
 TPainter3dAlgorithms.cxx:4070
 TPainter3dAlgorithms.cxx:4071
 TPainter3dAlgorithms.cxx:4072
 TPainter3dAlgorithms.cxx:4073
 TPainter3dAlgorithms.cxx:4074
 TPainter3dAlgorithms.cxx:4075
 TPainter3dAlgorithms.cxx:4076
 TPainter3dAlgorithms.cxx:4077
 TPainter3dAlgorithms.cxx:4078
 TPainter3dAlgorithms.cxx:4079
 TPainter3dAlgorithms.cxx:4080
 TPainter3dAlgorithms.cxx:4081
 TPainter3dAlgorithms.cxx:4082
 TPainter3dAlgorithms.cxx:4083
 TPainter3dAlgorithms.cxx:4084
 TPainter3dAlgorithms.cxx:4085
 TPainter3dAlgorithms.cxx:4086
 TPainter3dAlgorithms.cxx:4087
 TPainter3dAlgorithms.cxx:4088
 TPainter3dAlgorithms.cxx:4089
 TPainter3dAlgorithms.cxx:4090
 TPainter3dAlgorithms.cxx:4091
 TPainter3dAlgorithms.cxx:4092
 TPainter3dAlgorithms.cxx:4093
 TPainter3dAlgorithms.cxx:4094
 TPainter3dAlgorithms.cxx:4095
 TPainter3dAlgorithms.cxx:4096
 TPainter3dAlgorithms.cxx:4097
 TPainter3dAlgorithms.cxx:4098
 TPainter3dAlgorithms.cxx:4099
 TPainter3dAlgorithms.cxx:4100
 TPainter3dAlgorithms.cxx:4101
 TPainter3dAlgorithms.cxx:4102
 TPainter3dAlgorithms.cxx:4103
 TPainter3dAlgorithms.cxx:4104
 TPainter3dAlgorithms.cxx:4105
 TPainter3dAlgorithms.cxx:4106
 TPainter3dAlgorithms.cxx:4107
 TPainter3dAlgorithms.cxx:4108
 TPainter3dAlgorithms.cxx:4109
 TPainter3dAlgorithms.cxx:4110
 TPainter3dAlgorithms.cxx:4111
 TPainter3dAlgorithms.cxx:4112
 TPainter3dAlgorithms.cxx:4113
 TPainter3dAlgorithms.cxx:4114
 TPainter3dAlgorithms.cxx:4115
 TPainter3dAlgorithms.cxx:4116
 TPainter3dAlgorithms.cxx:4117
 TPainter3dAlgorithms.cxx:4118
 TPainter3dAlgorithms.cxx:4119
 TPainter3dAlgorithms.cxx:4120
 TPainter3dAlgorithms.cxx:4121
 TPainter3dAlgorithms.cxx:4122
 TPainter3dAlgorithms.cxx:4123
 TPainter3dAlgorithms.cxx:4124
 TPainter3dAlgorithms.cxx:4125
 TPainter3dAlgorithms.cxx:4126
 TPainter3dAlgorithms.cxx:4127
 TPainter3dAlgorithms.cxx:4128
 TPainter3dAlgorithms.cxx:4129
 TPainter3dAlgorithms.cxx:4130
 TPainter3dAlgorithms.cxx:4131
 TPainter3dAlgorithms.cxx:4132
 TPainter3dAlgorithms.cxx:4133
 TPainter3dAlgorithms.cxx:4134
 TPainter3dAlgorithms.cxx:4135
 TPainter3dAlgorithms.cxx:4136
 TPainter3dAlgorithms.cxx:4137
 TPainter3dAlgorithms.cxx:4138
 TPainter3dAlgorithms.cxx:4139
 TPainter3dAlgorithms.cxx: