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

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

#include <algorithm>

#include "TColor.h"

#include "TGLIncludes.h"
#include "TGLPlotBox.h"

//______________________________________________________________________________
//
// Implementation of a box around a histogram/function for
// plot-painters.

ClassImp(TGLPlotBox)

const Int_t TGLPlotBox::fgFramePlanes[][4] =
   {
    {0, 4, 5, 1},
    {1, 5, 6, 2},
    {2, 6, 7, 3},
    {0, 3, 7, 4},
    {0, 1, 2, 3}
   };
const Double_t TGLPlotBox::fgNormals[][3] =
   {
    { 0., 1., 0.},
    {-1., 0., 0.},
    { 0.,-1., 0.},
    { 1., 0., 0.},
    { 0., 0., 1.}
   };
const Int_t TGLPlotBox::fgBackPairs[][2] =
   {
    {2, 1},
    {3, 2},
    {0, 3},
    {1, 0}
   };

const Int_t TGLPlotBox::fgFrontPairs[][2] =
   {
    {3, 0},
    {0, 1},
    {1, 2},
    {2, 3}
   };
//______________________________________________________________________________
TGLPlotBox::TGLPlotBox(Bool_t xoy, Bool_t xoz, Bool_t yoz)
               : fFrameColor(0),
                 fXOYSelectable(xoy),
                 fXOZSelectable(xoz),
                 fYOZSelectable(yoz),
                 fSelectablePairs(),
                 fFrontPoint(0),
                 fRangeXU(1.),
                 fRangeYU(1.),
                 fRangeZU(1.),
                 fDrawBack(kTRUE),
                 fDrawFront(kTRUE)
{
   // Constructor.
   //Front point is 0.
   fSelectablePairs[0][0] = xoz;
   fSelectablePairs[0][1] = yoz;
   //Front point is 1.
   fSelectablePairs[1][0] = yoz;
   fSelectablePairs[1][1] = xoz;
   //Front point is 2.
   fSelectablePairs[2][0] = xoz;
   fSelectablePairs[2][1] = yoz;
   //Front point is 3.
   fSelectablePairs[3][0] = yoz;
   fSelectablePairs[3][1] = xoz;
}


//______________________________________________________________________________
TGLPlotBox::~TGLPlotBox()
{
   // Empty dtor to suppress g++ warnings.
}

//______________________________________________________________________________
void TGLPlotBox::DrawBack(Int_t selected, Bool_t selectionPass, const std::vector<Double_t> &zLevels,
                          Bool_t highColor)const
{
   using namespace Rgl;
   TGLDisableGuard depthTest(GL_DEPTH_TEST); //[0-0]
   glDepthMask(GL_FALSE);//[1

   if (!selectionPass) {
      glEnable(GL_BLEND);//[2
      glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
      glHint(GL_LINE_SMOOTH_HINT, GL_NICEST);
      glEnable(GL_LINE_SMOOTH);//[3
   }

   //Back planes are partially transparent to make their color smoother.
   Float_t backColor[] = {0.9f, 0.9f, 0.9f, 0.85f};
   if (fFrameColor)
      fFrameColor->GetRGB(backColor[0], backColor[1], backColor[2]);

   if (!selectionPass) {
      glMaterialfv(GL_FRONT, GL_DIFFUSE, backColor);
      if (selected == 1) {
         fXOYSelectable ?
                        glMaterialfv(GL_FRONT_AND_BACK, GL_EMISSION, Rgl::gGreenEmission)
                        :
                        glMaterialfv(GL_FRONT_AND_BACK, GL_EMISSION, Rgl::gRedEmission);
      }
   } else
      ObjectIDToColor(1, highColor);//Bottom plane, encoded as 1 in a selection buffer.

   DrawQuadFilled(f3DBox[0], f3DBox[1], f3DBox[2], f3DBox[3], TGLVector3(0., 0., 1.));

   if (!selectionPass) {
      if (selected == 1)
         glMaterialfv(GL_FRONT_AND_BACK, GL_EMISSION, Rgl::gNullEmission);
      else if (selected == 2)
         fSelectablePairs[fFrontPoint][0] ? glMaterialfv(GL_FRONT_AND_BACK, GL_EMISSION, Rgl::gGreenEmission)
                                          : glMaterialfv(GL_FRONT_AND_BACK, GL_EMISSION, Rgl::gRedEmission);
   } else
      ObjectIDToColor(2, highColor);//Left plane, encoded as 2 in a selection buffer.

   DrawBackPlane(fgBackPairs[fFrontPoint][0], selectionPass, zLevels);

   if (!selectionPass) {
      if (selected == 2)
         glMaterialfv(GL_FRONT_AND_BACK, GL_EMISSION, Rgl::gNullEmission);
      else if (selected == 3)
         fSelectablePairs[fFrontPoint][1] ? glMaterialfv(GL_FRONT_AND_BACK, GL_EMISSION, Rgl::gGreenEmission)
                                          : glMaterialfv(GL_FRONT_AND_BACK, GL_EMISSION, Rgl::gRedEmission);
   } else
      ObjectIDToColor(3, highColor); //Right plane, encoded as 3 in a selection buffer.

   DrawBackPlane(fgBackPairs[fFrontPoint][1], selectionPass, zLevels);

   glDepthMask(GL_TRUE);//1]
   if (!selectionPass) {
      if (selected == 3)
         glMaterialfv(GL_FRONT_AND_BACK, GL_EMISSION, Rgl::gNullEmission);
      glDisable(GL_BLEND);//2]
      glDisable(GL_LINE_SMOOTH);//3]
   }
}

//______________________________________________________________________________
void TGLPlotBox::DrawFront()const
{
   using namespace Rgl;

   const TGLDisableGuard lightGuard(GL_LIGHTING);
//   const TGLEnableGuard blend(GL_BLEND);
//   const TGLEnableGuard lineSmooth(GL_LINE_SMOOTH);

  // glColor4d(0., 0., 0., 0.8);
   glColor3d(0., 0., 0.);

   const Int_t *vertInd = fgFramePlanes[fgFrontPairs[fFrontPoint][0]];
   DrawQuadOutline(f3DBox[vertInd[0]], f3DBox[vertInd[1]], f3DBox[vertInd[2]], f3DBox[vertInd[3]]);

   vertInd = fgFramePlanes[fgFrontPairs[fFrontPoint][1]];
   DrawQuadOutline(f3DBox[vertInd[0]], f3DBox[vertInd[1]], f3DBox[vertInd[2]], f3DBox[vertInd[3]]);
}

//______________________________________________________________________________
void TGLPlotBox::DrawBox(Int_t selected, Bool_t selectionPass, const std::vector<Double_t> &zLevels,
                         Bool_t highColor)const
{
   // Draw back box for a plot.
   if (fDrawBack)
      DrawBack(selected, selectionPass, zLevels, highColor);

   if (fDrawFront && !selectionPass)
      DrawFront();
}


//______________________________________________________________________________
void TGLPlotBox::SetPlotBox(const Rgl::Range_t &x, const Rgl::Range_t &y, const Rgl::Range_t &z)
{
   // Set up a frame box.

   f3DBox[0].Set(x.first,  y.first,  z.first);
   f3DBox[1].Set(x.second, y.first,  z.first);
   f3DBox[2].Set(x.second, y.second, z.first);
   f3DBox[3].Set(x.first,  y.second, z.first);
   f3DBox[4].Set(x.first,  y.first,  z.second);
   f3DBox[5].Set(x.second, y.first,  z.second);
   f3DBox[6].Set(x.second, y.second, z.second);
   f3DBox[7].Set(x.first,  y.second, z.second);
}

//______________________________________________________________________________
void TGLPlotBox::SetPlotBox(const Rgl::Range_t &x, Double_t xr, const Rgl::Range_t &y, Double_t yr,
                            const Rgl::Range_t &z, Double_t zr)
{
   // Set up a frame box.
   fRangeXU = xr;
   fRangeYU = yr;
   fRangeZU = zr;

   SetPlotBox(x, y, z);
}

//______________________________________________________________________________
void TGLPlotBox::SetFrameColor(const TColor *color)
{
   // Back box color.

   fFrameColor = color;
}

namespace {

   bool Compare(const TGLVertex3 &v1, const TGLVertex3 &v2)
   {
      return v1.Z() < v2.Z();
   }

}


//______________________________________________________________________________
Int_t TGLPlotBox::FindFrontPoint()const
{
   // Convert 3d points into window coordinate system
   // and find the nearest.

   Double_t mvMatrix[16] = {0.};
   glGetDoublev(GL_MODELVIEW_MATRIX, mvMatrix);
   Double_t prMatrix[16] = {0.};
   glGetDoublev(GL_PROJECTION_MATRIX, prMatrix);
   Int_t viewport[4] = {0};
   glGetIntegerv(GL_VIEWPORT, viewport);

   const Double_t zMin = f3DBox[0].Z();
   const Double_t zMax = f3DBox[4].Z();

   const Double_t uBox[][2] = {{-fRangeXU / 2., -fRangeYU / 2.},
                               { fRangeXU / 2., -fRangeYU / 2.},
                               { fRangeXU / 2.,  fRangeYU / 2.},
                               {-fRangeXU / 2.,  fRangeYU / 2.}};

   for (Int_t i = 0; i < 4; ++i) {
      gluProject(f3DBox[i].X(), f3DBox[i].Y(), zMin, mvMatrix, prMatrix, viewport,
                 &f2DBox[i].X(), &f2DBox[i].Y(), &f2DBox[i].Z());
      gluProject(f3DBox[i].X(), f3DBox[i].Y(), zMax, mvMatrix, prMatrix, viewport,
                 &f2DBox[i + 4].X(), &f2DBox[i + 4].Y(), &f2DBox[i + 4].Z());

      gluProject(uBox[i][0], uBox[i][1], -0.5, mvMatrix, prMatrix, viewport,
                 &f2DBoxU[i].X(), &f2DBoxU[i].Y(), &f2DBoxU[i].Z());
      gluProject(uBox[i][0], uBox[i][1], 0.5, mvMatrix, prMatrix, viewport,
                 &f2DBoxU[i + 4].X(), &f2DBoxU[i + 4].Y(), &f2DBoxU[i + 4].Z());
   }

   //2D bbox must be in a canvas space, this can be affected by scaling
   //on retina displays.
   TGLUtil::InitializeIfNeeded();
   const Float_t scale = TGLUtil::GetScreenScalingFactor();
   if (scale) {
      for (Int_t i = 0; i < 8; ++i) {
         //downscale:
         f2DBoxU[i].X() /= scale;
         f2DBoxU[i].Y() /= scale;
      }
   }

   //return fFrontPoint = std::min_element(f2DBox, f2DBox + 4, Compare) - f2DBox;
   return fFrontPoint = std::min_element(f2DBoxU, f2DBoxU + 4, Compare) - f2DBoxU;
}


//______________________________________________________________________________
Int_t TGLPlotBox::GetFrontPoint()const
{
   // The nearest point.

   return fFrontPoint;
}


//______________________________________________________________________________
const TGLVertex3 *TGLPlotBox::Get3DBox()const
{
   // Get 3D box.

   return f3DBox;
}


//______________________________________________________________________________
const TGLVertex3 *TGLPlotBox::Get2DBox()const
{
   // Get 2D box.
   return f2DBoxU;
}


//______________________________________________________________________________
void TGLPlotBox::DrawBackPlane(Int_t plane, Bool_t selectionPass,
                               const std::vector<Double_t> &zLevels)const
{
   //Draw back plane with number 'plane'
   using namespace Rgl;
   const Int_t *vertInd = fgFramePlanes[plane];
   DrawQuadFilled(f3DBox[vertInd[0]], f3DBox[vertInd[1]], f3DBox[vertInd[2]],
                  f3DBox[vertInd[3]], fgNormals[plane]);
   //Antialias back plane outline.
   if (!selectionPass) {
      const TGLDisableGuard lightGuard(GL_LIGHTING);
      glColor3d(0., 0., 0.);
      DrawQuadOutline(f3DBox[vertInd[0]], f3DBox[vertInd[1]],
                      f3DBox[vertInd[2]], f3DBox[vertInd[3]]);
      //draw grid.
      const TGLEnableGuard stippleGuard(GL_LINE_STIPPLE);//[1-1]
      const UShort_t stipple = 0x5555;
      glLineStipple(1, stipple);

      Double_t lineCaps[][4] =
      {
         {f3DBox[1].X(), f3DBox[0].Y(), f3DBox[0].X(), f3DBox[0].Y()},
         {f3DBox[1].X(), f3DBox[0].Y(), f3DBox[1].X(), f3DBox[2].Y()},
         {f3DBox[1].X(), f3DBox[2].Y(), f3DBox[0].X(), f3DBox[3].Y()},
         {f3DBox[0].X(), f3DBox[3].Y(), f3DBox[0].X(), f3DBox[0].Y()}
      };

      for (UInt_t i = 0; i < zLevels.size(); ++i) {
         glBegin(GL_LINES);
         glVertex3d(lineCaps[plane][0], lineCaps[plane][1], zLevels[i]);
         glVertex3d(lineCaps[plane][2], lineCaps[plane][3], zLevels[i]);
         glEnd();
      }

   }
}
 TGLPlotBox.cxx:1
 TGLPlotBox.cxx:2
 TGLPlotBox.cxx:3
 TGLPlotBox.cxx:4
 TGLPlotBox.cxx:5
 TGLPlotBox.cxx:6
 TGLPlotBox.cxx:7
 TGLPlotBox.cxx:8
 TGLPlotBox.cxx:9
 TGLPlotBox.cxx:10
 TGLPlotBox.cxx:11
 TGLPlotBox.cxx:12
 TGLPlotBox.cxx:13
 TGLPlotBox.cxx:14
 TGLPlotBox.cxx:15
 TGLPlotBox.cxx:16
 TGLPlotBox.cxx:17
 TGLPlotBox.cxx:18
 TGLPlotBox.cxx:19
 TGLPlotBox.cxx:20
 TGLPlotBox.cxx:21
 TGLPlotBox.cxx:22
 TGLPlotBox.cxx:23
 TGLPlotBox.cxx:24
 TGLPlotBox.cxx:25
 TGLPlotBox.cxx:26
 TGLPlotBox.cxx:27
 TGLPlotBox.cxx:28
 TGLPlotBox.cxx:29
 TGLPlotBox.cxx:30
 TGLPlotBox.cxx:31
 TGLPlotBox.cxx:32
 TGLPlotBox.cxx:33
 TGLPlotBox.cxx:34
 TGLPlotBox.cxx:35
 TGLPlotBox.cxx:36
 TGLPlotBox.cxx:37
 TGLPlotBox.cxx:38
 TGLPlotBox.cxx:39
 TGLPlotBox.cxx:40
 TGLPlotBox.cxx:41
 TGLPlotBox.cxx:42
 TGLPlotBox.cxx:43
 TGLPlotBox.cxx:44
 TGLPlotBox.cxx:45
 TGLPlotBox.cxx:46
 TGLPlotBox.cxx:47
 TGLPlotBox.cxx:48
 TGLPlotBox.cxx:49
 TGLPlotBox.cxx:50
 TGLPlotBox.cxx:51
 TGLPlotBox.cxx:52
 TGLPlotBox.cxx:53
 TGLPlotBox.cxx:54
 TGLPlotBox.cxx:55
 TGLPlotBox.cxx:56
 TGLPlotBox.cxx:57
 TGLPlotBox.cxx:58
 TGLPlotBox.cxx:59
 TGLPlotBox.cxx:60
 TGLPlotBox.cxx:61
 TGLPlotBox.cxx:62
 TGLPlotBox.cxx:63
 TGLPlotBox.cxx:64
 TGLPlotBox.cxx:65
 TGLPlotBox.cxx:66
 TGLPlotBox.cxx:67
 TGLPlotBox.cxx:68
 TGLPlotBox.cxx:69
 TGLPlotBox.cxx:70
 TGLPlotBox.cxx:71
 TGLPlotBox.cxx:72
 TGLPlotBox.cxx:73
 TGLPlotBox.cxx:74
 TGLPlotBox.cxx:75
 TGLPlotBox.cxx:76
 TGLPlotBox.cxx:77
 TGLPlotBox.cxx:78
 TGLPlotBox.cxx:79
 TGLPlotBox.cxx:80
 TGLPlotBox.cxx:81
 TGLPlotBox.cxx:82
 TGLPlotBox.cxx:83
 TGLPlotBox.cxx:84
 TGLPlotBox.cxx:85
 TGLPlotBox.cxx:86
 TGLPlotBox.cxx:87
 TGLPlotBox.cxx:88
 TGLPlotBox.cxx:89
 TGLPlotBox.cxx:90
 TGLPlotBox.cxx:91
 TGLPlotBox.cxx:92
 TGLPlotBox.cxx:93
 TGLPlotBox.cxx:94
 TGLPlotBox.cxx:95
 TGLPlotBox.cxx:96
 TGLPlotBox.cxx:97
 TGLPlotBox.cxx:98
 TGLPlotBox.cxx:99
 TGLPlotBox.cxx:100
 TGLPlotBox.cxx:101
 TGLPlotBox.cxx:102
 TGLPlotBox.cxx:103
 TGLPlotBox.cxx:104
 TGLPlotBox.cxx:105
 TGLPlotBox.cxx:106
 TGLPlotBox.cxx:107
 TGLPlotBox.cxx:108
 TGLPlotBox.cxx:109
 TGLPlotBox.cxx:110
 TGLPlotBox.cxx:111
 TGLPlotBox.cxx:112
 TGLPlotBox.cxx:113
 TGLPlotBox.cxx:114
 TGLPlotBox.cxx:115
 TGLPlotBox.cxx:116
 TGLPlotBox.cxx:117
 TGLPlotBox.cxx:118
 TGLPlotBox.cxx:119
 TGLPlotBox.cxx:120
 TGLPlotBox.cxx:121
 TGLPlotBox.cxx:122
 TGLPlotBox.cxx:123
 TGLPlotBox.cxx:124
 TGLPlotBox.cxx:125
 TGLPlotBox.cxx:126
 TGLPlotBox.cxx:127
 TGLPlotBox.cxx:128
 TGLPlotBox.cxx:129
 TGLPlotBox.cxx:130
 TGLPlotBox.cxx:131
 TGLPlotBox.cxx:132
 TGLPlotBox.cxx:133
 TGLPlotBox.cxx:134
 TGLPlotBox.cxx:135
 TGLPlotBox.cxx:136
 TGLPlotBox.cxx:137
 TGLPlotBox.cxx:138
 TGLPlotBox.cxx:139
 TGLPlotBox.cxx:140
 TGLPlotBox.cxx:141
 TGLPlotBox.cxx:142
 TGLPlotBox.cxx:143
 TGLPlotBox.cxx:144
 TGLPlotBox.cxx:145
 TGLPlotBox.cxx:146
 TGLPlotBox.cxx:147
 TGLPlotBox.cxx:148
 TGLPlotBox.cxx:149
 TGLPlotBox.cxx:150
 TGLPlotBox.cxx:151
 TGLPlotBox.cxx:152
 TGLPlotBox.cxx:153
 TGLPlotBox.cxx:154
 TGLPlotBox.cxx:155
 TGLPlotBox.cxx:156
 TGLPlotBox.cxx:157
 TGLPlotBox.cxx:158
 TGLPlotBox.cxx:159
 TGLPlotBox.cxx:160
 TGLPlotBox.cxx:161
 TGLPlotBox.cxx:162
 TGLPlotBox.cxx:163
 TGLPlotBox.cxx:164
 TGLPlotBox.cxx:165
 TGLPlotBox.cxx:166
 TGLPlotBox.cxx:167
 TGLPlotBox.cxx:168
 TGLPlotBox.cxx:169
 TGLPlotBox.cxx:170
 TGLPlotBox.cxx:171
 TGLPlotBox.cxx:172
 TGLPlotBox.cxx:173
 TGLPlotBox.cxx:174
 TGLPlotBox.cxx:175
 TGLPlotBox.cxx:176
 TGLPlotBox.cxx:177
 TGLPlotBox.cxx:178
 TGLPlotBox.cxx:179
 TGLPlotBox.cxx:180
 TGLPlotBox.cxx:181
 TGLPlotBox.cxx:182
 TGLPlotBox.cxx:183
 TGLPlotBox.cxx:184
 TGLPlotBox.cxx:185
 TGLPlotBox.cxx:186
 TGLPlotBox.cxx:187
 TGLPlotBox.cxx:188
 TGLPlotBox.cxx:189
 TGLPlotBox.cxx:190
 TGLPlotBox.cxx:191
 TGLPlotBox.cxx:192
 TGLPlotBox.cxx:193
 TGLPlotBox.cxx:194
 TGLPlotBox.cxx:195
 TGLPlotBox.cxx:196
 TGLPlotBox.cxx:197
 TGLPlotBox.cxx:198
 TGLPlotBox.cxx:199
 TGLPlotBox.cxx:200
 TGLPlotBox.cxx:201
 TGLPlotBox.cxx:202
 TGLPlotBox.cxx:203
 TGLPlotBox.cxx:204
 TGLPlotBox.cxx:205
 TGLPlotBox.cxx:206
 TGLPlotBox.cxx:207
 TGLPlotBox.cxx:208
 TGLPlotBox.cxx:209
 TGLPlotBox.cxx:210
 TGLPlotBox.cxx:211
 TGLPlotBox.cxx:212
 TGLPlotBox.cxx:213
 TGLPlotBox.cxx:214
 TGLPlotBox.cxx:215
 TGLPlotBox.cxx:216
 TGLPlotBox.cxx:217
 TGLPlotBox.cxx:218
 TGLPlotBox.cxx:219
 TGLPlotBox.cxx:220
 TGLPlotBox.cxx:221
 TGLPlotBox.cxx:222
 TGLPlotBox.cxx:223
 TGLPlotBox.cxx:224
 TGLPlotBox.cxx:225
 TGLPlotBox.cxx:226
 TGLPlotBox.cxx:227
 TGLPlotBox.cxx:228
 TGLPlotBox.cxx:229
 TGLPlotBox.cxx:230
 TGLPlotBox.cxx:231
 TGLPlotBox.cxx:232
 TGLPlotBox.cxx:233
 TGLPlotBox.cxx:234
 TGLPlotBox.cxx:235
 TGLPlotBox.cxx:236
 TGLPlotBox.cxx:237
 TGLPlotBox.cxx:238
 TGLPlotBox.cxx:239
 TGLPlotBox.cxx:240
 TGLPlotBox.cxx:241
 TGLPlotBox.cxx:242
 TGLPlotBox.cxx:243
 TGLPlotBox.cxx:244
 TGLPlotBox.cxx:245
 TGLPlotBox.cxx:246
 TGLPlotBox.cxx:247
 TGLPlotBox.cxx:248
 TGLPlotBox.cxx:249
 TGLPlotBox.cxx:250
 TGLPlotBox.cxx:251
 TGLPlotBox.cxx:252
 TGLPlotBox.cxx:253
 TGLPlotBox.cxx:254
 TGLPlotBox.cxx:255
 TGLPlotBox.cxx:256
 TGLPlotBox.cxx:257
 TGLPlotBox.cxx:258
 TGLPlotBox.cxx:259
 TGLPlotBox.cxx:260
 TGLPlotBox.cxx:261
 TGLPlotBox.cxx:262
 TGLPlotBox.cxx:263
 TGLPlotBox.cxx:264
 TGLPlotBox.cxx:265
 TGLPlotBox.cxx:266
 TGLPlotBox.cxx:267
 TGLPlotBox.cxx:268
 TGLPlotBox.cxx:269
 TGLPlotBox.cxx:270
 TGLPlotBox.cxx:271
 TGLPlotBox.cxx:272
 TGLPlotBox.cxx:273
 TGLPlotBox.cxx:274
 TGLPlotBox.cxx:275
 TGLPlotBox.cxx:276
 TGLPlotBox.cxx:277
 TGLPlotBox.cxx:278
 TGLPlotBox.cxx:279
 TGLPlotBox.cxx:280
 TGLPlotBox.cxx:281
 TGLPlotBox.cxx:282
 TGLPlotBox.cxx:283
 TGLPlotBox.cxx:284
 TGLPlotBox.cxx:285
 TGLPlotBox.cxx:286
 TGLPlotBox.cxx:287
 TGLPlotBox.cxx:288
 TGLPlotBox.cxx:289
 TGLPlotBox.cxx:290
 TGLPlotBox.cxx:291
 TGLPlotBox.cxx:292
 TGLPlotBox.cxx:293
 TGLPlotBox.cxx:294
 TGLPlotBox.cxx:295
 TGLPlotBox.cxx:296
 TGLPlotBox.cxx:297
 TGLPlotBox.cxx:298
 TGLPlotBox.cxx:299
 TGLPlotBox.cxx:300
 TGLPlotBox.cxx:301
 TGLPlotBox.cxx:302
 TGLPlotBox.cxx:303
 TGLPlotBox.cxx:304
 TGLPlotBox.cxx:305
 TGLPlotBox.cxx:306
 TGLPlotBox.cxx:307
 TGLPlotBox.cxx:308
 TGLPlotBox.cxx:309
 TGLPlotBox.cxx:310
 TGLPlotBox.cxx:311
 TGLPlotBox.cxx:312
 TGLPlotBox.cxx:313
 TGLPlotBox.cxx:314
 TGLPlotBox.cxx:315
 TGLPlotBox.cxx:316
 TGLPlotBox.cxx:317
 TGLPlotBox.cxx:318
 TGLPlotBox.cxx:319
 TGLPlotBox.cxx:320
 TGLPlotBox.cxx:321
 TGLPlotBox.cxx:322
 TGLPlotBox.cxx:323
 TGLPlotBox.cxx:324
 TGLPlotBox.cxx:325
 TGLPlotBox.cxx:326
 TGLPlotBox.cxx:327
 TGLPlotBox.cxx:328
 TGLPlotBox.cxx:329
 TGLPlotBox.cxx:330
 TGLPlotBox.cxx:331
 TGLPlotBox.cxx:332
 TGLPlotBox.cxx:333
 TGLPlotBox.cxx:334
 TGLPlotBox.cxx:335
 TGLPlotBox.cxx:336
 TGLPlotBox.cxx:337
 TGLPlotBox.cxx:338
 TGLPlotBox.cxx:339
 TGLPlotBox.cxx:340
 TGLPlotBox.cxx:341
 TGLPlotBox.cxx:342
 TGLPlotBox.cxx:343
 TGLPlotBox.cxx:344
 TGLPlotBox.cxx:345
 TGLPlotBox.cxx:346