// @(#)root/table:$Id$
// Author: Valery Fine   10/12/98

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

#include "Riostream.h"
#include <stdlib.h>

#include "TROOT.h"
#include "TClass.h"
#include "TVirtualPad.h"
#include "TView.h"
#include "TGeometry.h"
#include "TRotMatrix.h"
#include "TShape.h"
#include "TVolume.h"
#include "TBrowser.h"
#include "X3DBuffer.h"

#include "TTablePadView3D.h"
#include "TCanvas.h"

#include "TRotMatrix.h"
#include "TVolumePosition.h"
#include "TVirtualViewer3D.h"
#include "TBuffer3D.h"

#if 0
const Int_t kVectorSize = 3;
const Int_t kMatrixSize = kVectorSize*kVectorSize;
const Int_t kMAXLEVELS = 20;

static Double_t gTranslation[kMAXLEVELS][kVectorSize];
static Double_t gRotMatrix[kMAXLEVELS][kMatrixSize];
static Int_t gGeomLevel = 0;

TVolume *gNode;
#endif
//R__EXTERN  Size3D gSize3D;
static TRotMatrix *gIdentity = 0;

ClassImp(TVolume)

//______________________________________________________________________________
//*-*-*-*-*-*-*-*-*-*-*-* T V O L U M E  description *-*-*-*-*-*-*-*-*-*-*-*-*
//*-*                     ==========================
//*-*
//*-*    A TVolume object is used to build the geometry hierarchy.
//*-*    Since TVolume is derived from TDataSet class it may contain other volumes.
//*-*
//*-*    A geometry volume has attributes:
//*-*      - name and title
//*-*      - pointer to the referenced shape (see TShape).
//*-*      - list of TVolumePosition object defining the position of the nested volumes
//*-*        with respect to the mother node.
//*-*
//*-*
//*-*    A volume can be drawn.
//*-*
//*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*


//______________________________________________________________________________
TVolume::TVolume()
{
//*-*-*-*-*-*-*-*-*-*-*Volume default constructor*-*-*-*-*-*-*-*-*-*-*-*-*
//*-*                  ========================

   fShape        = 0;
   fListOfShapes = 0;
   fVisibility   = kBothVisible;
   if (!gGeometry) new TGeometry;
}

//______________________________________________________________________________
TVolume::TVolume(const char *name, const char *title, const char *shapename, Option_t *option)
       :TObjectSet(name),TAttLine(), TAttFill(),fShape(0),fListOfShapes(0)
{
//*-*-*-*-*-*-*-*-*-*-*Volume normal constructor*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
//*-*                  =========================
//*-*
//*-*    name    is the name of the node
//*-*    title   is title
//*-*    shapename is the name of the referenced shape
//*-*
//*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*

#ifdef WIN32
//*-* The color "1" - default produces a very bad 3D image with OpenGL
   Color_t lcolor = 16;
   SetLineColor(lcolor);
#endif
   static Int_t counter = 0;
   counter++;
   SetTitle(title);
   if(!(counter%1000))std::cout<<"TVolume count="<<counter<<" name="<<name<<std::endl;
   if (!gGeometry) new TGeometry;
   Add(gGeometry->GetShape(shapename),kTRUE);
//   fParent = gGeometry->GetCurrenTVolume();
   fOption = option;
   fVisibility = kBothVisible;

   if(fShape) ImportShapeAttributes();
}


//______________________________________________________________________________
TVolume::TVolume(const char *name, const char *title, TShape *shape, Option_t *option)
                :TObjectSet(name),TAttLine(),TAttFill(),fShape(0),fListOfShapes(0)
{
//*-*-*-*-*-*-*-*-*-*-*Volume normal constructor*-*-*-*-*-*-*-*-*-*-*
//*-*                  ================================
//*-*
//*-*    name    is the name of the node
//*-*    title   is title
//*-*    shape   is the pointer to the shape definition
//*-*
//*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
#ifdef WIN32
//*-* The color "1" - default produces a very bad 3D image with OpenGL
   Color_t lcolor = 16;
   SetLineColor(lcolor);
#endif

   if (!gGeometry) new TGeometry;
   Add(shape,kTRUE);
   fOption = option;
   fVisibility = kBothVisible;
   SetTitle(title);
   if(shape) ImportShapeAttributes();
}

//______________________________________________________________________________
Int_t TVolume::MapStNode2GEANTVis(ENodeSEEN  vis)
{
// ENodeSEEN Visibility flag  00 - everything visible,
//                            10 - this unvisible, but sons are visible
//                            01 - this visible but sons
//                            11 - neither this nor its sons are visible
// Maps the value of the visibility flag to begin_html <a href="http://wwwinfo.cern.ch/asdoc/geant_html3/node128.html#SECTION056000000000000000000000">GEANT 3.21 "volume attributes"</a>end_html
   const Int_t mapVis[4] = {1, -2, 0, -1 };
   return mapVis[vis];
}

//______________________________________________________________________________
//ENodeSEEN TVolume::MapGEANT2StNodeVis(Int_t vis)
Int_t TVolume::MapGEANT2StNodeVis(Int_t vis)
{
// Maps the value of begin_html <a href="http://wwwinfo.cern.ch/asdoc/geant_html3/node128.html#SECTION056000000000000000000000">GEANT 3.21 "volume attributes"</a>end_html to the visibility flag
   const Int_t mapVis[4] = {1, -2, 0, -1 };
   Int_t i;
//  for (i =0; i<3;i++) if (mapVis[i] == vis) return (ENodeSEEN)i;
   for (i =0; i<3;i++) if (mapVis[i] == vis) return i;
   return kBothVisible;
}

//______________________________________________________________________________
TVolume::TVolume(TNode &rootNode):fShape(0),fListOfShapes(0)
{
  // Convert a TNode object into a TVolume

   SetName(rootNode.GetName());
   SetTitle(rootNode.GetTitle());
   fVisibility = ENodeSEEN(MapGEANT2StNodeVis(rootNode.GetVisibility()));
   fOption     = rootNode.GetOption();
   Add(rootNode.GetShape(),kTRUE);

   SetLineColor(rootNode.GetLineColor());
   SetLineStyle(rootNode.GetLineStyle());
   SetLineWidth(rootNode.GetLineWidth());
   SetFillColor(rootNode.GetFillColor());
   SetFillStyle(rootNode.GetFillStyle());

   TList *nodes = rootNode.GetListOfNodes();
   if (nodes) {
      TIter next(nodes);
      TNode *node = 0;
      while ( (node = (TNode *) next()) ){
         TVolume *nextNode = new TVolume(*node);
         Add(nextNode,node->GetX(),node->GetY(),node->GetZ(),node->GetMatrix());
      }
   }
}

//______________________________________________________________________________
void TVolume::Add(TShape *shape, Bool_t IsMaster)
{
   //to be documented
   if (!shape) return;
   if (!fListOfShapes) fListOfShapes = new TList;
   fListOfShapes->Add(shape);
   if (IsMaster) fShape = shape;
}

//______________________________________________________________________________
TNode *TVolume::CreateTNode(const TVolumePosition *position)
{
   // Convert a TVolume object into a TNode

   Double_t x=0;
   Double_t y=0;
   Double_t z=0;
   const TRotMatrix* matrix = 0;
   if (position) {
      x=position->GetX();
      y=position->GetY();
      z=position->GetZ();
      matrix = position->GetMatrix();
   }
//  const Char_t  *path = Path();
//  printf("%s: %s/%s, shape=%s/%s\n",path,GetName(),GetTitle(),GetShape()->GetName(),GetShape()->ClassName());
   TNode *newNode  = new TNode(GetName(),GetTitle(),GetShape(),x,y,z,(TRotMatrix* )matrix,GetOption());
   newNode->SetVisibility(MapStNode2GEANTVis(GetVisibility()));

   newNode->SetLineColor(GetLineColor());
   newNode->SetLineStyle(GetLineStyle());
   newNode->SetLineWidth(GetLineWidth());
   newNode->SetFillColor(GetFillColor());
   newNode->SetFillStyle(GetFillStyle());

   TList *positions = GetListOfPositions();
   if (positions) {
      TIter next(positions);
      TVolumePosition *pos = 0;
      while ( (pos = (TVolumePosition *) next()) ){
         TVolume *node = pos->GetNode();
         if (node) {
            newNode->cd();
            node->CreateTNode(pos);
         }
      }
   }
   newNode->ImportShapeAttributes();
   return newNode;
}

//______________________________________________________________________________
TVolume::~TVolume()
{
//*-*-*-*-*-*-*-*-*-*-*Volume default destructor*-*-*-*-*-*-*-*-*-*-*-*-*-*
//*-*                  ======================

   // Hmm, here we are in the troubles, in theory we have to find all
   // place where this node is sitting but we don't (yet :-()

   if (GetListOfPositions()) {
      GetListOfPositions()->Delete();
      SetPositionsList();
   }
   SafeDelete(fListOfShapes);
}

//______________________________________________________________________________
void TVolume::Add(TVolumePosition *position)
{
   //to be documented
   if (!GetListOfPositions()) SetPositionsList(new TList);
   if ( GetListOfPositions()) GetListOfPositions()->Add(position);
   else Error("Add","Can not create list of positions for the current node <%s>:<%s>",GetName(),GetTitle());
}

//______________________________________________________________________________
TVolumePosition *TVolume::Add(TVolume *node, TVolumePosition *nodePosition)
{
   //to be documented
   TVolumePosition *position = nodePosition;
   if (!node) return 0;
   if (!position) position = new TVolumePosition(node);  // Create default position
   // The object must be placed at once. Check it:
   if (!(GetCollection() && GetCollection()->FindObject(node)) ) TDataSet::Add(node);
   Add(position);
   return position;
}

//______________________________________________________________________________
TVolumePosition *TVolume::Add(TVolume *volume, Double_t x, Double_t y, Double_t z,
                              TRotMatrix *matrix,  UInt_t id, Option_t *)
{
//*-*
//*-*    volume  the pointer to the volume to be placed
//*-*    x,y,z   are the offsets of the volume with respect to his mother
//*-*    matrix  is the pointer to the rotation matrix
//*-*     id     is a unique position id
//*-*
   if (!volume) return 0;
   TRotMatrix *rotation = matrix;
   if(!rotation) rotation = GetIdentity();
   TVolumePosition *position = new TVolumePosition(volume,x,y,z,rotation);
   position->SetId(id);
   return Add(volume,position);
}

//______________________________________________________________________________
TVolumePosition *TVolume::Add(TVolume *volume, Double_t x, Double_t y, Double_t z,
                              const char *matrixname,  UInt_t id, Option_t *)
{
//*-*
//*-*    volume      the pointer to the volume to be placed
//*-*    x,y,z       are the offsets of the volume with respect to his mother
//*-*    matrixname  is the name of the rotation matrix
//*-*     id         is a unique position id
//*-*
   if (!volume) return 0;
   TRotMatrix *rotation = 0;
   if (matrixname && strlen(matrixname)) rotation = gGeometry->GetRotMatrix(matrixname);
   if (!rotation)                        rotation = GetIdentity();
   TVolumePosition *position = new TVolumePosition(volume,x,y,z,rotation);
   position->SetId(id);
   return Add(volume,position);
}

//______________________________________________________________________________
void TVolume::Browse(TBrowser *b)
{
   //to be documented
   if (GetListOfPositions()){
      TVolumePosition *nodePosition = 0;
      TIter next(GetListOfPositions());
      Int_t posNumber = 0;
      while ( (nodePosition = (TVolumePosition *)next()) ) {
         posNumber       = nodePosition->GetId();
         TString posName = "*";
         posName += nodePosition->GetNode()->GetTitle();
         char num[10];
         posName += ";";
         snprintf(num,10,"%d",posNumber);
         posName += num;
         b->Add(nodePosition,posName.Data());
      }
   }
}
//______________________________________________________________________________
Int_t TVolume::DistancetoPrimitive(Int_t px, Int_t py)
{
   //to be documented
   return DistancetoNodePrimitive(px,py);
}

//______________________________________________________________________________
Int_t TVolume::DistancetoNodePrimitive(Int_t px, Int_t py,TVolumePosition *pos)
{
//*-*-*-*-*-*-*-*-*Compute distance from point px,py to a TVolumeView*-*-*-*-*-*
//*-*                  ===========================================
//*-*  Compute the closest distance of approach from point px,py to the position of
//*-*  this volume.
//*-*  The distance is computed in pixels units.
//*-*
//*-*  It is restricted by 2 levels of TVolumes
//*-*
//*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*

   const Int_t big = 9999;
   if ( GetVisibility() == kNoneVisible )  return big;

   const Int_t inaxis = 7;
   const Int_t maxdist = 5;

   Int_t puxmin = gPad->XtoAbsPixel(gPad->GetUxmin());
   Int_t puymin = gPad->YtoAbsPixel(gPad->GetUymin());
   Int_t puxmax = gPad->XtoAbsPixel(gPad->GetUxmax());
   Int_t puymax = gPad->YtoAbsPixel(gPad->GetUymax());

//*-*- return if point is not in the user area
   if (px < puxmin - inaxis) return big;
   if (py > puymin + inaxis) return big;
   if (px > puxmax + inaxis) return big;
   if (py < puymax - inaxis) return big;

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

   static TVolumePosition nullPosition;
   TVolumePosition *position = pos;
   if (!position) position = &nullPosition;
   if (pos) position->UpdatePosition();
   Int_t dist = big;
   if ( !(GetVisibility() & kThisUnvisible ) ) {
      TShape  *shape = 0;
      TIter nextShape(fListOfShapes);
      while ((shape = (TShape *)nextShape())) {
         //*-*- Distnance to the next referenced shape  if visible
         if (shape->GetVisibility()) {
            Int_t dshape = shape->DistancetoPrimitive(px,py);
            if (dshape < maxdist) {
               gPad->SetSelected(this);
               return 0;
            }
            if (dshape < dist) dist = dshape;
         }
      }
   }

   if ( (GetVisibility() & kSonUnvisible) ) return dist;

//*-*- Loop on all sons
   TList *posList = GetListOfPositions();
   Int_t dnode = dist;
   if (posList && posList->GetSize()) {
      gGeometry->PushLevel();
      TVolumePosition *thisPosition;
      TObject *obj;
      TIter  next(posList);
      while ((obj = next())) {
         thisPosition = (TVolumePosition*)obj;
         TVolume *node = thisPosition->GetNode();
         dnode = node->DistancetoNodePrimitive(px,py,thisPosition);
         if (dnode <= 0)  break;
         if (dnode < dist) dist = dnode;
         if (gGeometry->GeomLevel() > 2) break;
      }
      gGeometry->PopLevel();
   }

   if (gGeometry->GeomLevel()==0 && dnode > maxdist) {
      gPad->SetSelected(view);
      return 0;
   } else
      return dnode;
}

//______________________________________________________________________________
void TVolume::Draw(Option_t *option)
{
//*-*-*-*-*-*-*-*-*-*-*-*Draw Referenced node with current parameters*-*-*-*
//*-*                   =============================================

   TString opt = option;
   opt.ToLower();
//*-*- Clear pad if option "same" not given
   if (!gPad) {
      gROOT->MakeDefCanvas();
   }
   if (!opt.Contains("same")) gPad->Clear();

    // Check geometry level

   Int_t iopt = atoi(option);
   TDataSet *parent = 0;
   char buffer[10];
   if (iopt < 0) {
      // set the "positive option"
      snprintf(buffer,10,"%d",-iopt);
      option = buffer;
      // select parent to draw
      parent = this;
      do parent = parent->GetParent();
      while (parent && ++iopt);
   }
   if (parent) parent->AppendPad(option);
   else        AppendPad(option);
#if ROOT_VERSION_CODE >= ROOT_VERSION(4,03,05)
   // the new (4.03/05) way to active 3D viewer
   // Create a 3-D view
   TView *view = gPad->GetView();
   if (!view) {
      view = TView::CreateView(1,0,0);
      // Set the view to perform a first autorange (frame) draw.
      // TViewer3DPad will revert view to normal painting after this
      view->SetAutoRange(kTRUE);
   }

   // Create a 3D viewer to draw us
//   gPad->GetViewer3D(option);
   gPad->GetViewer3D();
#else
    Paint(option);
#endif
}


//______________________________________________________________________________
void TVolume::DrawOnly(Option_t *option)
{
//*-*-*-*-*-*-*-*-*-*Draw only Sons of this node*-*-*-*-*-*-*-*-*-*-*-*-*
//*-*                ===========================

   SetVisibility(kThisUnvisible);
   Draw(option);
}


//______________________________________________________________________________
void TVolume::ExecuteEvent(Int_t, Int_t, Int_t)
{
//*-*-*-*-*-*-*-*-*-*-*Execute action corresponding to one event*-*-*-*
//*-*                  =========================================
//*-*  This member function must be implemented to realize the action
//*-*  corresponding to the mouse click on the object in the window
//*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*

//   if (gPad->GetView())
//             gPad->GetView()->ExecuteRotateView(event, px, py);

//   if (!gPad->GetListOfPrimitives()->FindObject(this)) gPad->SetCursor(kCross);
   gPad->SetCursor(kHand);
}

//______________________________________________________________________________
TRotMatrix *TVolume::GetIdentity()
{
   // Return a pointer the "identity" matrix
   Double_t *identityMatrix = 0;
   if (!gIdentity) {
      gIdentity = gGeometry->GetRotMatrix("Identity");
      if (!gIdentity) {
         gIdentity  =  new TRotMatrix();
         gIdentity->SetName("Identity");
         gIdentity->SetTitle("Identity matrix");
         gIdentity->SetMatrix((Double_t *)0);
         identityMatrix = gIdentity->GetMatrix();
         memset(identityMatrix,0,9*sizeof(Double_t));
                                *identityMatrix = 1;
         identityMatrix += 4;   *identityMatrix = 1;
         identityMatrix += 4;   *identityMatrix = 1;
         gGeometry->GetListOfMatrices()->AddFirst(gIdentity);
      }
   }
   return gIdentity;
}

//______________________________________________________________________________
char *TVolume::GetObjectInfo(Int_t px, Int_t py) const
{
   //to be documented
   if (!gPad) return 0;
   static char info[512];
   snprintf(info,512,"%s/%s",GetName(),GetTitle());
   Double_t x[3];
   ((TPad *)gPad)->AbsPixeltoXY(px,py,x[0],x[1]);
   x[2] = 0;
   TView *view =gPad->GetView();
   if (view) view->NDCtoWC(x, x);

   TIter nextShape(fListOfShapes);
   TShape *shape = 0;
   while( (shape = (TShape *)nextShape()) ) {
      Int_t nchi = strlen(info);
      snprintf(&info[nchi],512-nchi," %6.2f/%6.2f: shape=%s/%s",x[0],x[1],shape->GetName(),shape->ClassName());
   }
   return info;
}

//______________________________________________________________________________
void TVolume::ImportShapeAttributes()
{
//*-*-*-*-*-*-*Copy shape attributes as node attributes*-*-*-*-*--*-*-*-*-*-*
//*-*          ========================================

   if (fShape) {
      SetLineColor(fShape->GetLineColor());
      SetLineStyle(fShape->GetLineStyle());
      SetLineWidth(fShape->GetLineWidth());
      SetFillColor(fShape->GetFillColor());
      SetFillStyle(fShape->GetFillStyle());
   }

   if (!GetCollection()) return;
   TVolume *volume;
   TIter  next(GetCollection());
   while ( (volume = (TVolume *)next()) )
      volume->ImportShapeAttributes();
}

//______________________________________________________________________________
void TVolume::Paint(Option_t *opt)
{
//*-*- Draw Referenced node
   gGeometry->SetGeomLevel();
   gGeometry->UpdateTempMatrix();
   PaintNodePosition(opt);
   return;
}

//______________________________________________________________________________
void TVolume::PaintNodePosition(Option_t *option,TVolumePosition *pos)
{
//*-*-*-*-*-*-*-*-*-*-*-*Paint Referenced volume with current parameters*-*-*-*
//*-*                   ==============================================
//*-*
//*-*  vis = 1  (default) shape is drawn
//*-*  vis = 0  shape is not drawn but its sons may be not drawn
//*-*  vis = -1 shape is not drawn. Its sons are not drawn
//*-*  vis = -2 shape is drawn. Its sons are not drawn
//*-*
//*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
   if ( GetVisibility() == kNoneVisible )  return;

   static TVolumePosition nullPosition;

// restrict the levels for "range" option
   Int_t level = gGeometry->GeomLevel();
//  if (option && option[0]=='r' && level > 3 && strcmp(option,"range") == 0) return;
   if ((!(GetVisibility() & kThisUnvisible)) && option && option[0]=='r' && level > 3 ) return;
   Int_t iopt = 0;
   if (option) iopt = atoi(option);
   if ( (0 < iopt) && (iopt <= level) )  return;

   TTablePadView3D *view3D = (TTablePadView3D*)gPad->GetView3D();
   TVirtualViewer3D * viewer3D = gPad->GetViewer3D();

   TVolumePosition *position = pos;
   if (!position)   position   = &nullPosition;

   // PaintPosition does change the current matrix and it MUST be callled FIRST !!!

   position->UpdatePosition(option);

   if ( viewer3D && !(GetVisibility() & kThisUnvisible))  PaintShape(option);

   if (GetVisibility() & kSonUnvisible) return;

//*-*- Paint all sons
   TList *posList = GetListOfPositions();
   if (posList && posList->GetSize()) {
      gGeometry->PushLevel();
      TVolumePosition *thisPosition;
      TIter  next(posList);
      while ((thisPosition = (TVolumePosition *)next())) {
         if (view3D)  view3D->PushMatrix();

         TVolume *volume = thisPosition->GetNode();
         if (volume) volume->PaintNodePosition(option,thisPosition);

         if (view3D) view3D->PopMatrix();
      }
      gGeometry->PopLevel();
   }
}

//______________________________________________________________________________
void TVolume::PaintShape(Option_t *option)
{
   // Paint shape of the volume
   // To be called from the TObject::Paint method only
   Bool_t rangeView = option && option[0]=='r';
   if (!rangeView) {
      TAttLine::Modify();
      TAttFill::Modify();
   }

   if ( (GetVisibility() & kThisUnvisible) ) return;

   TIter nextShape(fListOfShapes);
   TShape *shape = 0;
   while( (shape = (TShape *)nextShape()) ) {
      if (!rangeView) {
         shape->SetLineColor(GetLineColor());
         shape->SetLineStyle(GetLineStyle());
         shape->SetLineWidth(GetLineWidth());
         shape->SetFillColor(GetFillColor());
         shape->SetFillStyle(GetFillStyle());
         TTablePadView3D *view3D = (TTablePadView3D*)gPad->GetView3D();
         gPad->GetViewer3D();
         if (view3D)
            view3D->SetLineAttr(GetLineColor(),GetLineWidth(),option);
      }

#if ROOT_VERSION_CODE >= ROOT_VERSION(4,03,05)
      // It MUST be the TShape::Paint method:
      Bool_t viewerWantsSons = kTRUE;
      TVirtualViewer3D * viewer3D = gPad->GetViewer3D();
      if (viewer3D) {
         // We only provide master frame positions in these shapes
         // so don't ask viewer preference

         // Ask all shapes for kCore/kBoundingBox/kShapeSpecific
         // Not all will support the last two - which is fine
         const TBuffer3D & buffer =
            fShape->GetBuffer3D(TBuffer3D::kCore|TBuffer3D::kBoundingBox|TBuffer3D::kShapeSpecific);

         // TShape sets buffer id based on TNode * gNode
         // As we not using TNode we need to override this
         const_cast<TBuffer3D &>(buffer).fID = this;

         Int_t reqSections = viewer3D->AddObject(buffer, &viewerWantsSons);
         if (reqSections != TBuffer3D::kNone) {
            fShape->GetBuffer3D(reqSections);
            viewer3D->AddObject(buffer);
         }
      }
#else
    shape->Paint(option);
#endif
   }
}

//______________________________________________________________________________
void TVolume::DeletePosition(TVolumePosition *position)
{
  // DeletePosition deletes the position of the TVolume *node from this TVolume
  // and removes that volume from the list of the nodes of this TVolume

   if (!position) return;

   if (GetListOfPositions()) {
      TObjLink *lnk = GetListOfPositions()->FirstLink();
      while (lnk) {
         TVolumePosition *nextPosition = (TVolumePosition *)(lnk->GetObject());
         if (nextPosition && nextPosition == position) {
            TVolume *node = nextPosition->GetNode();
            GetListOfPositions()->Remove(lnk);
            delete nextPosition;
            Remove(node);
            break;
         }
         lnk = lnk->Next();
      }
   }
}

//______________________________________________________________________________
void TVolume::GetLocalRange(Float_t *min, Float_t *max)
{
  //  GetRange
  //
  //  Calculates the size of 3 box the volume occupies,
  //  Return:
  //    two floating point arrays with the bound of box
  //     surroundind all shapes of this TVolumeView
  //

   TVirtualPad *savePad = gPad;
   //  Create a dummy TPad;
   TCanvas dummyPad("--Dumm--","dum",1,1);
   // Assing 3D TView
   TView *view = TView::CreateView(1,0,0);

   gGeometry->SetGeomLevel();
   gGeometry->UpdateTempMatrix();
   view->SetAutoRange(kTRUE);
   Paint("range");
   view->GetRange(&min[0],&max[0]);
   delete view;
   // restore "current pad"
   if (savePad) savePad->cd();
}

//______________________________________________________________________________
void TVolume::SetVisibility(ENodeSEEN vis)
{
//*-*-*-*-*-*-*Set visibility for this volume and its sons*-*-*-*-*--*-*-*-*-*-*
//*-*          =========================================
// ENodeSEEN Visibility flag  00 - everything visible,
//                            10 - this unvisible, but sons are visible
//                            01 - this visible but sons
//                            11 - neither this nor its sons are visible
//*-*
//*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
   fVisibility = vis;
}

//______________________________________________________________________________
void TVolume::Sizeof3D() const
{
//*-*-*-*-*-*-*Return total size of this 3-D volume with its attributes*-*-*
//*-*          ==========================================================

   if (!(GetVisibility() & kThisUnvisible) ) {
      TIter nextShape(fListOfShapes);
      TShape *shape = 0;
      while( (shape = (TShape *)nextShape()) ) {
         if (shape->GetVisibility())  shape->Sizeof3D();
      }
   }

   if ( GetVisibility() & kSonUnvisible ) return;

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