ROOT logo
// @(#):$Id: TGeoTubeEditor.cxx 20882 2007-11-19 11:31:26Z rdm $
// Author: M.Gheata 

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

//////////////////////////////////////////////////////////////////////////
//                                                                      //
//  TGeoTubeEditor                                                      //
//                                                                      //
//////////////////////////////////////////////////////////////////////////
//Begin_Html
/*
<img src="gif/tube_pic.gif">
*/
//End_Html
//Begin_Html
/*
<img src="gif/tube_ed.jpg">
*/
//End_Html

#include "TGeoTubeEditor.h"
#include "TGeoTabManager.h"
#include "TGeoTube.h"
#include "TGeoManager.h"
#include "TVirtualGeoPainter.h"
#include "TPad.h"
#include "TView.h"
#include "TGTab.h"
#include "TMath.h"
#include "TGComboBox.h"
#include "TGButton.h"
#include "TGTextEntry.h"
#include "TGNumberEntry.h"
#include "TGLabel.h"
#include "TGDoubleSlider.h"

ClassImp(TGeoTubeEditor)

enum ETGeoTubeWid {
   kTUBE_NAME, kTUBE_RMIN, kTUBE_RMAX, kTUBE_Z,
   kTUBE_APPLY, kTUBE_UNDO
};

//______________________________________________________________________________
TGeoTubeEditor::TGeoTubeEditor(const TGWindow *p, Int_t width,
                                   Int_t height, UInt_t options, Pixel_t back)
   : TGeoGedFrame(p, width, height, options | kVerticalFrame, back)
{
   // Constructor for tube editor
   fShape   = 0;
   fRmini = fRmaxi = fDzi = 0.0;
   fNamei = "";
   fIsModified = kFALSE;
   fIsShapeEditable = kTRUE;

   // TextEntry for shape name
   MakeTitle("Name");
   fShapeName = new TGTextEntry(this, new TGTextBuffer(50), kTUBE_NAME);
   fShapeName->Resize(135, fShapeName->GetDefaultHeight());
   fShapeName->SetToolTipText("Enter the box name");
   fShapeName->Associate(this);
   AddFrame(fShapeName, new TGLayoutHints(kLHintsLeft, 3, 1, 2, 5));

   TGTextEntry *nef;
   MakeTitle("Tube dimensions");
   TGCompositeFrame *compxyz = new TGCompositeFrame(this, 118, 30, kVerticalFrame | kRaisedFrame);
   // Number entry for rmin
   TGCompositeFrame *f1 = new TGCompositeFrame(compxyz, 155, 30, kHorizontalFrame | kFixedWidth);
   f1->AddFrame(new TGLabel(f1, "Rmin"), new TGLayoutHints(kLHintsLeft, 1, 1, 6, 0));
   fERmin = new TGNumberEntry(f1, 0., 5, kTUBE_RMIN);
   fERmin->SetNumAttr(TGNumberFormat::kNEANonNegative);
   nef = (TGTextEntry*)fERmin->GetNumberEntry();
   nef->SetToolTipText("Enter the inner radius");
   fERmin->Associate(this);
   fERmin->Resize(100,fERmin->GetDefaultHeight());
   f1->AddFrame(fERmin, new TGLayoutHints(kLHintsRight , 2, 2, 2, 2));
   compxyz->AddFrame(f1, new TGLayoutHints(kLHintsLeft, 2, 2, 0, 0));
   
   // Number entry for Rmax
   f1 = new TGCompositeFrame(compxyz, 155, 30, kHorizontalFrame | kFixedWidth);
   f1->AddFrame(new TGLabel(f1, "Rmax"), new TGLayoutHints(kLHintsLeft, 1, 1, 6, 0));
   fERmax = new TGNumberEntry(f1, 0., 5, kTUBE_RMAX);
   fERmax->SetNumAttr(TGNumberFormat::kNEANonNegative);
   nef = (TGTextEntry*)fERmax->GetNumberEntry();
   nef->SetToolTipText("Enter the outer radius");
   fERmax->Associate(this);
   fERmax->Resize(100,fERmax->GetDefaultHeight());
   f1->AddFrame(fERmax, new TGLayoutHints(kLHintsRight , 2, 2, 2, 2));
   compxyz->AddFrame(f1, new TGLayoutHints(kLHintsLeft, 2, 2, 0, 0));
   
   // Number entry for dz
   f1 = new TGCompositeFrame(compxyz, 155, 30, kHorizontalFrame | kFixedWidth);
   f1->AddFrame(new TGLabel(f1, "DZ"), new TGLayoutHints(kLHintsLeft, 1, 1, 6, 0));
   fEDz = new TGNumberEntry(f1, 0., 5, kTUBE_Z);
   fEDz->SetNumAttr(TGNumberFormat::kNEAPositive);
   nef = (TGTextEntry*)fEDz->GetNumberEntry();
   nef->SetToolTipText("Enter the tube half-lenth in Z");
   fEDz->Associate(this);
   fEDz->Resize(100,fEDz->GetDefaultHeight());
   f1->AddFrame(fEDz, new TGLayoutHints(kLHintsRight , 2, 2, 2, 2));
   compxyz->AddFrame(f1, new TGLayoutHints(kLHintsLeft, 2, 2, 0, 0));
   
//   compxyz->Resize(150,30);
   AddFrame(compxyz, new TGLayoutHints(kLHintsLeft, 6, 6, 4, 4));
      
   // Delayed draw
   fDFrame = new TGCompositeFrame(this, 155, 10, kHorizontalFrame | kFixedWidth | kSunkenFrame);
   fDelayed = new TGCheckButton(fDFrame, "Delayed draw");
   fDFrame->AddFrame(fDelayed, new TGLayoutHints(kLHintsLeft , 2, 2, 4, 4));
   AddFrame(fDFrame,  new TGLayoutHints(kLHintsLeft, 2, 2, 4, 4));  

   // Buttons
   fBFrame = new TGCompositeFrame(this, 155, 10, kHorizontalFrame | kFixedWidth);
   fApply = new TGTextButton(fBFrame, "Apply");
   fBFrame->AddFrame(fApply, new TGLayoutHints(kLHintsLeft, 2, 2, 4, 4));
   fApply->Associate(this);
   fUndo = new TGTextButton(fBFrame, "Undo");
   fBFrame->AddFrame(fUndo, new TGLayoutHints(kLHintsRight , 2, 2, 4, 4));
   fUndo->Associate(this);
   AddFrame(fBFrame,  new TGLayoutHints(kLHintsLeft, 6, 6, 4, 4));  
   fUndo->SetSize(fApply->GetSize());
}

//______________________________________________________________________________
TGeoTubeEditor::~TGeoTubeEditor()
{
// Destructor
   TGFrameElement *el;
   TIter next(GetList());
   while ((el = (TGFrameElement *)next())) {
      if (el->fFrame->IsComposite()) 
         TGeoTabManager::Cleanup((TGCompositeFrame*)el->fFrame);
   }
   Cleanup();   
}

//______________________________________________________________________________
void TGeoTubeEditor::ConnectSignals2Slots()
{
   // Connect signals to slots.
   fApply->Connect("Clicked()", "TGeoTubeEditor", this, "DoApply()");
   fUndo->Connect("Clicked()", "TGeoTubeEditor", this, "DoUndo()");
   fShapeName->Connect("TextChanged(const char *)", "TGeoTubeEditor", this, "DoModified()");
   fERmin->Connect("ValueSet(Long_t)", "TGeoTubeEditor", this, "DoRmin()");
   fERmax->Connect("ValueSet(Long_t)", "TGeoTubeEditor", this, "DoRmax()");
   fEDz->Connect("ValueSet(Long_t)", "TGeoTubeEditor", this, "DoDz()");
   fERmin->GetNumberEntry()->Connect("TextChanged(const char *)", "TGeoTubeEditor", this, "DoRmin()");
   fERmax->GetNumberEntry()->Connect("TextChanged(const char *)", "TGeoTubeEditor", this, "DoRmax()");
   fEDz->GetNumberEntry()->Connect("TextChanged(const char *)", "TGeoTubeEditor", this, "DoDz()");
   fInit = kFALSE;
}


//______________________________________________________________________________
void TGeoTubeEditor::SetModel(TObject* obj)
{
   // Connect to the selected object.
   if (obj == 0 || (obj->IsA()!=TGeoTube::Class())) {
      SetActive(kFALSE);
      return;                 
   } 
   fShape = (TGeoTube*)obj;
   fRmini = fShape->GetRmin();
   fRmaxi = fShape->GetRmax();
   fDzi = fShape->GetDz();
   fNamei = fShape->GetName();
   fShapeName->SetText(fShape->GetName());
   fERmin->SetNumber(fRmini);
   fERmax->SetNumber(fRmaxi);
   fEDz->SetNumber(fDzi);
   fApply->SetEnabled(kFALSE);
   fUndo->SetEnabled(kFALSE);
   
   if (fInit) ConnectSignals2Slots();
   SetActive();
}

//______________________________________________________________________________
Bool_t TGeoTubeEditor::IsDelayed() const
{
// Check if shape drawing is delayed.
   return (fDelayed->GetState() == kButtonDown);
}

//______________________________________________________________________________
void TGeoTubeEditor::DoName()
{
// Perform name change.
   DoModified();
}

//______________________________________________________________________________
void TGeoTubeEditor::DoApply()
{
// Slot for applying modifications.
   const char *name = fShapeName->GetText();
   if (strcmp(name,fShape->GetName())) fShape->SetName(name);
   Double_t rmin = fERmin->GetNumber();
   Double_t rmax = fERmax->GetNumber();
   Double_t dz = fEDz->GetNumber();
   fShape->SetTubeDimensions(rmin, rmax, dz);
   fShape->ComputeBBox();
   fUndo->SetEnabled();
   fApply->SetEnabled(kFALSE);
   if (fPad) {
      if (gGeoManager && gGeoManager->GetPainter() && gGeoManager->GetPainter()->IsPaintingShape()) {
         fShape->Draw();
         fPad->GetView()->ShowAxis();
      } else Update();
   }   
}

//______________________________________________________________________________
void TGeoTubeEditor::DoModified()
{
// Slot for signaling modifications.
   fApply->SetEnabled();
}

//______________________________________________________________________________
void TGeoTubeEditor::DoUndo()
{
// Slot for undoing last operation.
   fERmin->SetNumber(fRmini);
   fERmax->SetNumber(fRmaxi);
   fEDz->SetNumber(fDzi);
   DoApply();
   fUndo->SetEnabled(kFALSE);
   fApply->SetEnabled(kFALSE);
}
   
//______________________________________________________________________________
void TGeoTubeEditor::DoRmin()
{
// Slot for rmin.
   Double_t rmin = fERmin->GetNumber();
   Double_t rmax = fERmax->GetNumber();
   if (rmax<rmin+1.e-10) {
      rmin = rmax - 0.1;
      fERmin->SetNumber(rmin);
   }   
   DoModified();
   if (!IsDelayed()) DoApply();
}

//______________________________________________________________________________
void TGeoTubeEditor::DoRmax()
{
// Slot for rmax.
   Double_t rmin = fERmin->GetNumber();
   Double_t rmax = fERmax->GetNumber();
   if (rmax <= 0.) {
      rmax = 0.1;
      fERmax->SetNumber(rmax);
   }     
   if (rmax<rmin+1.e-10) {
      rmax = rmin + 0.1;
      fERmax->SetNumber(rmax);
   }   
   DoModified();
   if (!IsDelayed()) DoApply();
}

//______________________________________________________________________________
void TGeoTubeEditor::DoDz()
{
// Slot for dz.
   Double_t dz = fEDz->GetNumber();
   if (dz<=0) {
      dz = 0.1;
      fEDz->SetNumber(dz);
   }   
   DoModified();
   if (!IsDelayed()) DoApply();
}

//////////////////////////////////////////////////////////////////////////
//                                                                      //
//  TGeoTubeSegEditor                                                   //
//                                                                      //
//////////////////////////////////////////////////////////////////////////
//Begin_Html
/*
<img src="gif/tubs_pic.gif">
*/
//End_Html
//Begin_Html
/*
<img src="gif/tubs_ed.jpg">
*/
//End_Html

ClassImp(TGeoTubeSegEditor)

enum ETGeoTubeSegWid {
   kTUBESEG_PHI1, kTUBESEG_PHI2, kTUBESEG_PHI
};

//______________________________________________________________________________
TGeoTubeSegEditor::TGeoTubeSegEditor(const TGWindow *p, Int_t width,
                                     Int_t height, UInt_t options, Pixel_t back)
  : TGeoTubeEditor(p, width, height, options | kVerticalFrame, back)
{
   // Constructor for tube segment editor
   fLock = kFALSE;
   MakeTitle("Phi range");
   TGTextEntry *nef;
   TGCompositeFrame *compxyz = new TGCompositeFrame(this, 155, 110, kHorizontalFrame | kFixedWidth | kFixedHeight | kRaisedFrame);
   // Vertical slider
   fSPhi = new TGDoubleVSlider(compxyz,100);
   fSPhi->SetRange(0.,720.);
   fSPhi->Resize(fSPhi->GetDefaultWidth(), 100);
   compxyz->AddFrame(fSPhi, new TGLayoutHints(kLHintsLeft, 2, 2, 4, 4)); 
   TGCompositeFrame *f1 = new TGCompositeFrame(compxyz, 135, 100, kVerticalFrame | kFixedHeight);
   f1->AddFrame(new TGLabel(f1, "Phi min."), new TGLayoutHints(kLHintsTop | kLHintsLeft, 0, 0, 6, 0));
   fEPhi1 = new TGNumberEntry(f1, 0., 5, kTUBESEG_PHI1);
   fEPhi1->Resize(100, fEPhi1->GetDefaultHeight());
   fEPhi1->SetNumAttr(TGNumberFormat::kNEANonNegative);
   nef = (TGTextEntry*)fEPhi1->GetNumberEntry();
   nef->SetToolTipText("Enter the phi1 value");
   fEPhi1->Associate(this);
   f1->AddFrame(fEPhi1, new TGLayoutHints(kLHintsTop | kLHintsRight, 2, 2, 2, 2));

   fEPhi2 = new TGNumberEntry(f1, 0., 5, kTUBESEG_PHI2);
   fEPhi2->Resize(100, fEPhi2->GetDefaultHeight());
   fEPhi2->SetNumAttr(TGNumberFormat::kNEANonNegative);
   nef = (TGTextEntry*)fEPhi2->GetNumberEntry();
   nef->SetToolTipText("Enter the phi2 value");
   fEPhi2->Associate(this);
   f1->AddFrame(fEPhi2, new TGLayoutHints(kLHintsBottom | kLHintsRight, 2, 2, 2, 2));
   f1->AddFrame(new TGLabel(f1, "Phi max."), new TGLayoutHints(kLHintsBottom, 0, 0, 6, 2));
   compxyz->AddFrame(f1, new TGLayoutHints(kLHintsLeft, 2, 2, 4, 4));
   
//   compxyz->Resize(150,150);
   AddFrame(compxyz, new TGLayoutHints(kLHintsLeft, 6, 6, 4, 4));
   TGeoTabManager::MoveFrame(fDFrame, this);
   TGeoTabManager::MoveFrame(fBFrame, this);
}

//______________________________________________________________________________
TGeoTubeSegEditor::~TGeoTubeSegEditor()
{
// Destructor
   TGFrameElement *el;
   TIter next(GetList());
   while ((el = (TGFrameElement *)next())) {
      if (el->fFrame->IsComposite()) 
         TGeoTabManager::Cleanup((TGCompositeFrame*)el->fFrame);
   }
   Cleanup();   
}

//______________________________________________________________________________
void TGeoTubeSegEditor::ConnectSignals2Slots()
{
   // Connect signals to slots.
   TGeoTubeEditor::ConnectSignals2Slots();
   Disconnect(fApply, "Clicked()",(TGeoTubeEditor*)this, "DoApply()");
   Disconnect(fUndo, "Clicked()",(TGeoTubeEditor*)this, "DoUndo()");
   fApply->Connect("Clicked()", "TGeoTubeSegEditor", this, "DoApply()");
   fUndo->Connect("Clicked()", "TGeoTubeSegEditor", this, "DoUndo()");
   fEPhi1->Connect("ValueSet(Long_t)", "TGeoTubeSegEditor", this, "DoPhi1()");
   fEPhi2->Connect("ValueSet(Long_t)", "TGeoTubeSegEditor", this, "DoPhi2()");
//   fEPhi1->GetNumberEntry()->Connect("TextChanged(const char *)","TGeoTubeSegEditor", this, "DoPhi1()");
//   fEPhi2->GetNumberEntry()->Connect("TextChanged(const char *)","TGeoTubeSegEditor", this, "DoPhi2()");
   fSPhi->Connect("PositionChanged()","TGeoTubeSegEditor", this, "DoPhi()");
}

//______________________________________________________________________________
void TGeoTubeSegEditor::SetModel(TObject* obj)
{
   // Connect to the selected object.
   if (obj == 0 || (obj->IsA()!=TGeoTubeSeg::Class())) {
      SetActive(kFALSE);
      return;                 
   } 
   fShape = (TGeoTube*)obj;
   fRmini = fShape->GetRmin();
   fRmaxi = fShape->GetRmax();
   fDzi = fShape->GetDz();
   fNamei = fShape->GetName();
   fPmini = ((TGeoTubeSeg*)fShape)->GetPhi1();
   fPmaxi = ((TGeoTubeSeg*)fShape)->GetPhi2();
   fShapeName->SetText(fShape->GetName());
   fEPhi1->SetNumber(fPmini);
   fEPhi2->SetNumber(fPmaxi);
   fSPhi->SetPosition(fPmini,fPmaxi);
   fERmin->SetNumber(fRmini);
   fERmax->SetNumber(fRmaxi);
   fEDz->SetNumber(fDzi);
   fApply->SetEnabled(kFALSE);
   fUndo->SetEnabled(kFALSE);
   
   if (fInit) ConnectSignals2Slots();
   SetActive();
}

//______________________________________________________________________________
void TGeoTubeSegEditor::DoPhi1()
{
// Slot for phi1.
   Double_t phi1 = fEPhi1->GetNumber();
   Double_t phi2 = fEPhi2->GetNumber();
   if (phi1 > 360-1.e-10) {
      phi1 = 0.;
      fEPhi1->SetNumber(phi1);
   }   
   if (phi2<phi1+1.e-10) {
      phi1 = phi2 - 0.1;
      fEPhi1->SetNumber(phi1);
   }   
   if (!fLock) {
      DoModified();
      fLock = kTRUE;
      fSPhi->SetPosition(phi1,phi2);
   } else fLock = kFALSE;
   if (!IsDelayed()) DoApply();
}

//______________________________________________________________________________
void TGeoTubeSegEditor::DoPhi2()
{
// Slot for phi2.
   Double_t phi1 = fEPhi1->GetNumber();
   Double_t phi2 = fEPhi2->GetNumber();
   if (phi2-phi1 > 360.) {
      phi2 -= 360.;
      fEPhi2->SetNumber(phi2);
   }   
   if (phi2<phi1+1.e-10) {
      phi2 = phi1 + 0.1;
      fEPhi2->SetNumber(phi2);
   }   
   if (!fLock) {
      DoModified();
      fLock = kTRUE;
      fSPhi->SetPosition(phi1,phi2);
   } else fLock = kFALSE;
   if (!IsDelayed()) DoApply();
}

//______________________________________________________________________________
void TGeoTubeSegEditor::DoPhi()
{
// Slot for phi slider.
   if (!fLock) {
      DoModified();
      fLock = kTRUE;
      fEPhi1->SetNumber(fSPhi->GetMinPosition());
      fLock = kTRUE;
      fEPhi2->SetNumber(fSPhi->GetMaxPosition());
   } else fLock = kFALSE;   
   if (!IsDelayed()) DoApply();
}

//______________________________________________________________________________
void TGeoTubeSegEditor::DoApply()
{
// Slot for applying modifications.
   fApply->SetEnabled(kFALSE);
   const char *name = fShapeName->GetText();
   if (strcmp(name,fShape->GetName())) fShape->SetName(name);
   Double_t rmin = fERmin->GetNumber();
   Double_t rmax = fERmax->GetNumber();
   if (rmin<0 || rmax<rmin) return;
   Double_t dz = fEDz->GetNumber();
   Double_t phi1 = fEPhi1->GetNumber();
   Double_t phi2 = fEPhi2->GetNumber();
   if ((phi2-phi1) > 360.001) {
      phi1 = 0.;
      phi2 = 360.;
      fEPhi1->SetNumber(phi1);
      fEPhi2->SetNumber(phi2);
      fLock = kTRUE;
      fSPhi->SetPosition(phi1,phi2);
      fLock = kFALSE;
   }   
   ((TGeoTubeSeg*)fShape)->SetTubsDimensions(rmin, rmax, dz, phi1, phi2);
   fShape->ComputeBBox();
   fUndo->SetEnabled();
   if (fPad) {
      if (gGeoManager && gGeoManager->GetPainter() && gGeoManager->GetPainter()->IsPaintingShape()) {
         fShape->Draw();
         fPad->GetView()->ShowAxis();
      } else Update();
   }   
}

//______________________________________________________________________________
void TGeoTubeSegEditor::DoUndo()
{
// Slot for undoing last operation.
   fERmin->SetNumber(fRmini);
   fERmax->SetNumber(fRmaxi);
   fEDz->SetNumber(fDzi);
   fEPhi1->SetNumber(fPmini);
   fEPhi2->SetNumber(fPmaxi);
   fSPhi->SetPosition(fPmini,fPmaxi);
   DoApply();
   fUndo->SetEnabled(kFALSE);
   fApply->SetEnabled(kFALSE);
}

//////////////////////////////////////////////////////////////////////////
//                                                                      //
//  TGeoCtubEditor                                                   //
//                                                                      //
//////////////////////////////////////////////////////////////////////////
//Begin_Html
/*
<img src="gif/ctub_pic.gif">
*/
//End_Html
//Begin_Html
/*
<img src="gif/ctub_ed.jpg">
*/
//End_Html

ClassImp(TGeoCtubEditor)

enum ETGeoCtubSegWid {
   kCTUB_THLO, kCTUB_PHLO, kCTUB_THHI, kCTUB_PHHI
};

//______________________________________________________________________________
TGeoCtubEditor::TGeoCtubEditor(const TGWindow *p, Int_t width,
                               Int_t height, UInt_t options, Pixel_t back)
  : TGeoTubeSegEditor(p, width, height, options, back)
{
   // Constructor for cut tube editor
   MakeTitle("Theta/phi low");
   TGTextEntry *nef;
   // Number entry for theta/phi of the lower normal
   TGCompositeFrame *compxyz = new TGCompositeFrame(this, 118, 30, kVerticalFrame | kRaisedFrame);
   TGCompositeFrame *f1 = new TGCompositeFrame(compxyz, 155, 30, kHorizontalFrame | kFixedWidth);
   f1->AddFrame(new TGLabel(f1, "TH_LO"), new TGLayoutHints(kLHintsLeft, 1, 1, 6, 0));
   fEThlo = new TGNumberEntry(f1, 0., 5, kCTUB_THLO);
   fEThlo->SetNumAttr(TGNumberFormat::kNEANonNegative);
   nef = (TGTextEntry*)fEThlo->GetNumberEntry();
   nef->SetToolTipText("Enter the theta angle of the lower plane normal");
   fEThlo->Associate(this);
   fEThlo->Connect("ValueSet(Long_t)", "TGeoCtubEditor", this, "DoThlo()");
   nef->Connect("TextChanged(const char *)","TGeoCtubEditor", this, "DoModified()");
   fEThlo->Resize(100,fEThlo->GetDefaultHeight());
   f1->AddFrame(fEThlo, new TGLayoutHints(kLHintsRight , 2, 2, 2, 2));
   compxyz->AddFrame(f1, new TGLayoutHints(kLHintsLeft, 2, 2, 0, 0));

   f1 = new TGCompositeFrame(compxyz, 155, 30, kHorizontalFrame | kFixedWidth);
   f1->AddFrame(new TGLabel(f1, "PH_LO"), new TGLayoutHints(kLHintsLeft, 1, 1, 6, 0));
   fEPhlo = new TGNumberEntry(f1, 0., 5, kCTUB_PHLO);
   fEPhlo->SetNumAttr(TGNumberFormat::kNEANonNegative);
   nef = (TGTextEntry*)fEPhlo->GetNumberEntry();
   nef->SetToolTipText("Enter the phi angle of the lower plane normal");
   fEPhlo->Associate(this);
   fEPhlo->Connect("ValueSet(Long_t)", "TGeoCtubEditor", this, "DoPhlo()");
   nef->Connect("TextChanged(const char *)","TGeoCtubEditor", this, "DoModified()");
   fEPhlo->Resize(100,fEPhlo->GetDefaultHeight());
   f1->AddFrame(fEPhlo, new TGLayoutHints(kLHintsRight , 2, 2, 2, 2));
   compxyz->AddFrame(f1, new TGLayoutHints(kLHintsLeft, 2, 2, 0, 0));
   AddFrame(compxyz, new TGLayoutHints(kLHintsLeft, 2, 2, 2, 2));

   // Number entry for theta/phi of the lower normal
   MakeTitle("Theta/phi high");
   compxyz = new TGCompositeFrame(this, 118, 30, kVerticalFrame | kRaisedFrame);
   f1 = new TGCompositeFrame(compxyz, 155, 30, kHorizontalFrame | kFixedWidth);
   f1->AddFrame(new TGLabel(f1, "TH_HI"), new TGLayoutHints(kLHintsLeft, 1, 1, 6, 0));
   fEThhi = new TGNumberEntry(f1, 0., 5, kCTUB_THHI);
   fEThhi->SetNumAttr(TGNumberFormat::kNEANonNegative);
   nef = (TGTextEntry*)fEThhi->GetNumberEntry();
   nef->SetToolTipText("Enter the theta angle of the upper plane normal");
   fEThhi->Associate(this);
   fEThhi->Connect("ValueSet(Long_t)", "TGeoCtubEditor", this, "DoThhi()");
   nef->Connect("TextChanged(const char *)","TGeoCtubEditor", this, "DoModified()");
   fEThhi->Resize(100,fEThhi->GetDefaultHeight());
   f1->AddFrame(fEThhi, new TGLayoutHints(kLHintsRight , 2, 2, 2, 2));
   compxyz->AddFrame(f1, new TGLayoutHints(kLHintsLeft, 2, 2, 0, 0));

   f1 = new TGCompositeFrame(compxyz, 155, 30, kHorizontalFrame | kFixedWidth);
   f1->AddFrame(new TGLabel(f1, "PH_HI"), new TGLayoutHints(kLHintsLeft, 1, 1, 6, 0));
   fEPhhi = new TGNumberEntry(f1, 0., 5, kCTUB_PHHI);
   fEPhhi->SetNumAttr(TGNumberFormat::kNEANonNegative);
   nef = (TGTextEntry*)fEPhhi->GetNumberEntry();
   nef->SetToolTipText("Enter the phi angle of the upper plane normal");
   fEPhhi->Associate(this);
   fEPhhi->Connect("ValueSet(Long_t)", "TGeoCtubEditor", this, "DoPhhi()");
   nef->Connect("TextChanged(const char *)","TGeoCtubEditor", this, "DoModified()");
   fEPhhi->Resize(100,fEPhhi->GetDefaultHeight());
   f1->AddFrame(fEPhhi, new TGLayoutHints(kLHintsRight , 2, 2, 4, 4));
   compxyz->AddFrame(f1, new TGLayoutHints(kLHintsLeft | kLHintsExpandX , 2, 2, 4, 4));
   AddFrame(compxyz, new TGLayoutHints(kLHintsLeft, 2, 2, 2, 2));
   TGeoTabManager::MoveFrame(fDFrame, this);
   TGeoTabManager::MoveFrame(fBFrame, this);
}

//______________________________________________________________________________
TGeoCtubEditor::~TGeoCtubEditor()
{
// Destructor
   TGFrameElement *el;
   TIter next(GetList());
   while ((el = (TGFrameElement *)next())) {
      if (el->fFrame->IsComposite()) 
         TGeoTabManager::Cleanup((TGCompositeFrame*)el->fFrame);
   }
   Cleanup();   
}

//______________________________________________________________________________
void TGeoCtubEditor::SetModel(TObject* obj)
{
   // Connect to the selected object.
   if (obj == 0 || (obj->IsA()!=TGeoCtub::Class())) {
      SetActive(kFALSE);
      return;                 
   } 
   fShape = (TGeoTube*)obj;
   fRmini = fShape->GetRmin();
   fRmaxi = fShape->GetRmax();
   fDzi = fShape->GetDz();
   fNamei = fShape->GetName();
   fPmini = ((TGeoTubeSeg*)fShape)->GetPhi1();
   fPmaxi = ((TGeoTubeSeg*)fShape)->GetPhi2();
   const Double_t *nlo = ((TGeoCtub*)fShape)->GetNlow();
   const Double_t *nhi = ((TGeoCtub*)fShape)->GetNhigh();
   fThlo = TMath::RadToDeg() * TMath::ACos(nlo[2]);
   fPhlo = TMath::RadToDeg() * TMath::ATan2(nlo[1], nlo[0]);
   fThhi = TMath::RadToDeg() * TMath::ACos(nhi[2]);
   fPhhi = TMath::RadToDeg() * TMath::ATan2(nhi[1], nhi[0]);
   
   fShapeName->SetText(fShape->GetName());
   fEPhi1->SetNumber(fPmini);
   fEPhi2->SetNumber(fPmaxi);
   fSPhi->SetPosition(fPmini,fPmaxi);
   fERmin->SetNumber(fRmini);
   fERmax->SetNumber(fRmaxi);
   fEDz->SetNumber(fDzi);
   fEThlo->SetNumber(fThlo);
   fEPhlo->SetNumber(fPhlo);
   fEThhi->SetNumber(fThhi);
   fEPhhi->SetNumber(fPhhi);
   fApply->SetEnabled(kFALSE);
   fUndo->SetEnabled(kFALSE);
   
   if (fInit) ConnectSignals2Slots();
   SetActive();
}

//______________________________________________________________________________
void TGeoCtubEditor::DoThlo()
{
// Slot for phi1.
   Double_t thlo = fEThlo->GetNumber();
   if (thlo <= 90.) {thlo = 91.; fEThlo->SetNumber(thlo);}
   if (thlo > 180.) {thlo = 180.; fEThlo->SetNumber(thlo);}
   DoModified();
   if (!IsDelayed()) DoApply();
}

//______________________________________________________________________________
void TGeoCtubEditor::DoPhlo()
{
// Slot for phi1.
   Double_t phlo = fEPhlo->GetNumber();
   if (phlo >= 360.) {
      phlo = 0.; 
      fEPhlo->SetNumber(phlo);
   }
   DoModified();
   if (!IsDelayed()) DoApply();
}
   
//______________________________________________________________________________
void TGeoCtubEditor::DoThhi()
{
// Slot for phi1.
   Double_t thhi = fEThhi->GetNumber();
   if (thhi >= 90.) {thhi = 89.; fEThhi->SetNumber(thhi);}
   DoModified();
   if (!IsDelayed()) DoApply();
}

//______________________________________________________________________________
void TGeoCtubEditor::DoPhhi()
{
// Slot for phi1.
   Double_t phhi = fEPhhi->GetNumber();
   if (phhi >= 360.) {
      phhi = 0.; 
      fEPhhi->SetNumber(phhi);
   }
   DoModified();
   if (!IsDelayed()) DoApply();
}

//______________________________________________________________________________
void TGeoCtubEditor::DoApply()
{
// Slot for applying modifications.
   fApply->SetEnabled(kFALSE);
   const char *name = fShapeName->GetText();
   if (strcmp(name,fShape->GetName())) fShape->SetName(name);
   Double_t rmin = fERmin->GetNumber();
   Double_t rmax = fERmax->GetNumber();
   if (rmin<0 || rmax<rmin) return;
   Double_t dz = fEDz->GetNumber();
   Double_t phi1 = fEPhi1->GetNumber();
   Double_t phi2 = fEPhi2->GetNumber();
   if ((phi2-phi1) > 360.001) {
      phi1 = 0.;
      phi2 = 360.;
      fEPhi1->SetNumber(phi1);
      fEPhi2->SetNumber(phi2);
      fLock = kTRUE;
      fSPhi->SetPosition(phi1,phi2);
      fLock = kFALSE;
   } 
   Double_t thlo = TMath::DegToRad()*fEThlo->GetNumber();
   Double_t phlo = TMath::DegToRad()*fEPhlo->GetNumber();
   Double_t thhi = TMath::DegToRad()*fEThhi->GetNumber();  
   Double_t phhi = TMath::DegToRad()*fEPhhi->GetNumber();
   Double_t lx = TMath::Sin(thlo)*TMath::Cos(phlo);  
   Double_t ly = TMath::Sin(thlo)*TMath::Sin(phlo);  
   Double_t lz = TMath::Cos(thlo);
   Double_t tx = TMath::Sin(thhi)*TMath::Cos(phhi);  
   Double_t ty = TMath::Sin(thhi)*TMath::Sin(phhi);  
   Double_t tz = TMath::Cos(thhi);
   ((TGeoCtub*)fShape)->SetCtubDimensions(rmin, rmax, dz, phi1, phi2, lx,ly,lz,tx,ty,tz);
   fShape->ComputeBBox();
   fUndo->SetEnabled();
   if (fPad) {
      if (gGeoManager && gGeoManager->GetPainter() && gGeoManager->GetPainter()->IsPaintingShape()) {
         fShape->Draw();
         fPad->GetView()->ShowAxis();
      } else Update();
   }   
}

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