// @(#):$Id$
// 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.             *
 *************************************************************************/

//////////////////////////////////////////////////////////////////////////
//                                                                      //
//  TGeoTrapEditor                                                      //
//                                                                      //
//////////////////////////////////////////////////////////////////////////
//Begin_Html
/*
<img src="gif/trap_pic.gif">
*/
//End_Html
//Begin_Html
/*
<img src="gif/trap_ed.jpg">
*/
//End_Html

#include "TGeoTrapEditor.h"
#include "TGeoTabManager.h"
#include "TGeoArb8.h"
#include "TGeoManager.h"
#include "TVirtualGeoPainter.h"
#include "TPad.h"
#include "TView.h"
#include "TGTab.h"
#include "TGComboBox.h"
#include "TGButton.h"
#include "TGTextEntry.h"
#include "TGNumberEntry.h"
#include "TGLabel.h"

ClassImp(TGeoTrapEditor)

enum ETGeoTrapWid {
   kTRAP_NAME, kTRAP_H1, kTRAP_BL1, kTRAP_TL1, kTRAP_DZ, kTRAP_ALPHA1,
   kTRAP_SC1, kTRAP_SC2, kTRAP_THETA, kTRAP_PHI, kTRAP_APPLY, kTRAP_UNDO
};

//______________________________________________________________________________
TGeoTrapEditor::TGeoTrapEditor(const TGWindow *p, Int_t width,
                                   Int_t height, UInt_t options, Pixel_t back)
   : TGeoGedFrame(p, width, height, options | kVerticalFrame, back)
{
   // Constructor for para editor
   fShape   = 0;
   fH1i = fBl1i = fTl1i = fDzi = fAlpha1i = fThetai = fPhii = fSci = 0.0;
   fNamei = "";
   fIsModified = kFALSE;
   fIsShapeEditable = kTRUE;

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

   TGTextEntry *nef;
   MakeTitle("Dimensions");
   // Number entry for H1
   TGCompositeFrame *f1 = new TGCompositeFrame(this, 155, 10, kHorizontalFrame | kFixedWidth);
   f1->AddFrame(new TGLabel(f1, "DY"), new TGLayoutHints(kLHintsLeft, 1, 1, 6, 0));
   fEH1 = new TGNumberEntry(f1, 0., 5, kTRAP_H1);
   fEH1->SetNumAttr(TGNumberFormat::kNEAPositive);
   fEH1->Resize(100, fEH1->GetDefaultHeight());
   nef = (TGTextEntry*)fEH1->GetNumberEntry();
   nef->SetToolTipText("Enter the half length in y at low z");
   fEH1->Associate(this);
   f1->AddFrame(fEH1, new TGLayoutHints(kLHintsRight, 2, 2, 4, 4));
   AddFrame(f1, new TGLayoutHints(kLHintsLeft, 2, 2, 4, 4));
   
   // Number entry for Bl1
   f1 = new TGCompositeFrame(this, 155, 10, kHorizontalFrame | kFixedWidth);
   f1->AddFrame(new TGLabel(f1, "DX1"), new TGLayoutHints(kLHintsLeft, 1, 1, 6, 0));
   fEBl1 = new TGNumberEntry(f1, 0., 5, kTRAP_BL1);
   fEBl1->SetNumAttr(TGNumberFormat::kNEAPositive);
   fEBl1->Resize(100, fEBl1->GetDefaultHeight());
   nef = (TGTextEntry*)fEBl1->GetNumberEntry();
   nef->SetToolTipText("Enter the half length in x at low z and y low edge");
   fEBl1->Associate(this);
   f1->AddFrame(fEBl1, new TGLayoutHints(kLHintsRight, 2, 2, 4, 4));
   AddFrame(f1, new TGLayoutHints(kLHintsLeft, 2, 2, 4, 4));
   
   // Number entry for Tl1
   f1 = new TGCompositeFrame(this, 155, 10, kHorizontalFrame | kFixedWidth);
   f1->AddFrame(new TGLabel(f1, "DX2"), new TGLayoutHints(kLHintsLeft, 1, 1, 6, 0));
   fETl1 = new TGNumberEntry(f1, 0., 5, kTRAP_TL1);
   fETl1->SetNumAttr(TGNumberFormat::kNEAPositive);
   fETl1->Resize(100, fETl1->GetDefaultHeight());
   nef = (TGTextEntry*)fETl1->GetNumberEntry();
   nef->SetToolTipText("Enter the half length in x at low z and y high edge");
   fETl1->Associate(this);
   f1->AddFrame(fETl1, new TGLayoutHints(kLHintsRight, 2, 2, 4, 4));
   AddFrame(f1, new TGLayoutHints(kLHintsLeft, 2, 2, 4, 4));

    // Number entry for scale factor
   f1 = new TGCompositeFrame(this, 155, 10, kHorizontalFrame | kFixedWidth);
   f1->AddFrame(new TGLabel(f1, "SC1"), new TGLayoutHints(kLHintsLeft, 1, 1, 6, 0));
   fESc1 = new TGNumberEntry(f1, 0., 5, kTRAP_SC1);
   fESc1->SetNumAttr(TGNumberFormat::kNEAPositive);
   fESc1->Resize(100, fESc1->GetDefaultHeight());
   nef = (TGTextEntry*)fESc1->GetNumberEntry();
   nef->SetToolTipText("Enter the scale factor for lower Z face");
   fESc1->Associate(this);
   f1->AddFrame(fESc1, new TGLayoutHints(kLHintsRight, 2, 2, 4, 4));
   AddFrame(f1, new TGLayoutHints(kLHintsLeft, 2, 2, 4, 4));
   
    // Number entry for scale factor
   f1 = new TGCompositeFrame(this, 155, 10, kHorizontalFrame | kFixedWidth);
   f1->AddFrame(new TGLabel(f1, "SC2"), new TGLayoutHints(kLHintsLeft, 1, 1, 6, 0));
   fESc2 = new TGNumberEntry(f1, 0., 5, kTRAP_SC2);
   fESc2->SetNumAttr(TGNumberFormat::kNEAPositive);
   fESc2->Resize(100, fESc2->GetDefaultHeight());
   nef = (TGTextEntry*)fESc2->GetNumberEntry();
   nef->SetToolTipText("Enter the scale factor for upper Z face");
   fESc2->Associate(this);
   f1->AddFrame(fESc2, new TGLayoutHints(kLHintsRight, 2, 2, 4, 4));
   AddFrame(f1, new TGLayoutHints(kLHintsLeft, 2, 2, 4, 4));

  // Number entry for dz
   f1 = new TGCompositeFrame(this, 155, 10, kHorizontalFrame | kFixedWidth);
   f1->AddFrame(new TGLabel(f1, "DZ"), new TGLayoutHints(kLHintsLeft, 1, 1, 6, 0));
   fEDz = new TGNumberEntry(f1, 0., 5, kTRAP_DZ);
   fEDz->SetNumAttr(TGNumberFormat::kNEAPositive);
   fEDz->Resize(100, fEDz->GetDefaultHeight());
   nef = (TGTextEntry*)fEDz->GetNumberEntry();
   nef->SetToolTipText("Enter the half-lenth in Z");
   fEDz->Associate(this);
   f1->AddFrame(fEDz, new TGLayoutHints(kLHintsRight, 2, 2, 4, 4));
   AddFrame(f1, new TGLayoutHints(kLHintsLeft, 2, 2, 4, 4));
 
   // Number entry for Alpha1
   f1 = new TGCompositeFrame(this, 155, 10, kHorizontalFrame | kFixedWidth);
   f1->AddFrame(new TGLabel(f1, "ALPHA"), new TGLayoutHints(kLHintsLeft, 1, 1, 6, 0));
   fEAlpha1 = new TGNumberEntry(f1, 0., 5, kTRAP_ALPHA1);
   fEAlpha1->Resize(100, fEAlpha1->GetDefaultHeight());
   nef = (TGTextEntry*)fEAlpha1->GetNumberEntry();
   nef->SetToolTipText("Enter  angle between centers of x edges an y axis at low z");
   fEAlpha1->Associate(this);
   f1->AddFrame(fEAlpha1, new TGLayoutHints(kLHintsRight, 2, 2, 4, 4));
   AddFrame(f1, new TGLayoutHints(kLHintsLeft, 2, 2, 4, 4));

   // Number entry for Theta
   f1 = new TGCompositeFrame(this, 155, 10, kHorizontalFrame | kFixedWidth);
   f1->AddFrame(new TGLabel(f1, "Theta"), new TGLayoutHints(kLHintsLeft, 1, 1, 6, 0));
   fETheta = new TGNumberEntry(f1, 0., 5, kTRAP_THETA);
   fETheta->SetNumAttr(TGNumberFormat::kNEAPositive);
   fETheta->Resize(100, fETheta->GetDefaultHeight());
   nef = (TGTextEntry*)fETheta->GetNumberEntry();
   nef->SetToolTipText("Enter initial  theta");
   fETheta->Associate(this);
   f1->AddFrame(fETheta, new TGLayoutHints(kLHintsRight, 2, 2, 4, 4));
   AddFrame(f1, new TGLayoutHints(kLHintsLeft, 2, 2, 4, 4));

    // Number entry for Phi
   f1 = new TGCompositeFrame(this, 155, 10, kHorizontalFrame | kFixedWidth);
   f1->AddFrame(new TGLabel(f1, "Phi"), new TGLayoutHints(kLHintsLeft, 1, 1, 6, 0));
   fEPhi = new TGNumberEntry(f1, 0., 5, kTRAP_PHI);
   fEPhi->SetNumAttr(TGNumberFormat::kNEAPositive);
   fEPhi->Resize(100, fEPhi->GetDefaultHeight());
   nef = (TGTextEntry*)fEPhi->GetNumberEntry();
   nef->SetToolTipText("Enter initial  phi");
   fEPhi->Associate(this);
   f1->AddFrame(fEPhi, new TGLayoutHints(kLHintsRight, 2, 2, 4, 4));
   AddFrame(f1, new TGLayoutHints(kLHintsLeft, 2, 2, 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, 6, 6, 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());
}

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

//______________________________________________________________________________
void TGeoTrapEditor::ConnectSignals2Slots()
{
   // Connect signals to slots.
   fApply->Connect("Clicked()", "TGeoTrapEditor", this, "DoApply()");
   fUndo->Connect("Clicked()", "TGeoTrapEditor", this, "DoUndo()");
   fShapeName->Connect("TextChanged(const char *)", "TGeoTrapEditor", this, "DoModified()");
   fEH1->Connect("ValueSet(Long_t)", "TGeoTrapEditor", this, "DoH1()");
   fEBl1->Connect("ValueSet(Long_t)", "TGeoTrapEditor", this, "DoBl1()");
   fETl1->Connect("ValueSet(Long_t)", "TGeoTrapEditor", this, "DoTl1()");
   fEDz->Connect("ValueSet(Long_t)", "TGeoTrapEditor", this, "DoDz()");
   fESc1->Connect("ValueSet(Long_t)", "TGeoTrapEditor", this, "DoSc1()");
   fESc2->Connect("ValueSet(Long_t)", "TGeoTrapEditor", this, "DoSc2()");
   fEAlpha1->Connect("ValueSet(Long_t)", "TGeoTrapEditor", this, "DoAlpha1()");
   fETheta->Connect("ValueSet(Long_t)", "TGeoTrapEditor", this, "DoTheta()");
   fEPhi->Connect("ValueSet(Long_t)", "TGeoTrapEditor", this, "DoPhi()");
   fEH1->GetNumberEntry()->Connect("TextChanged(const char *)", "TGeoTrapEditor", this, "DoModified()");
   fEBl1->GetNumberEntry()->Connect("TextChanged(const char *)", "TGeoTrapEditor", this, "DoModified()");
   fETl1->GetNumberEntry()->Connect("TextChanged(const char *)", "TGeoTrapEditor", this, "DoModified()");
   fEDz->GetNumberEntry()->Connect("TextChanged(const char *)", "TGeoTrapEditor", this, "DoModified()");
   fESc1->GetNumberEntry()->Connect("TextChanged(const char *)", "TGeoTrapEditor", this, "DoModified()");
   fESc2->GetNumberEntry()->Connect("TextChanged(const char *)", "TGeoTrapEditor", this, "DoModified()");
   fEAlpha1->GetNumberEntry()->Connect("TextChanged(const char *)", "TGeoTrapEditor", this, "DoModified()");
   fETheta->GetNumberEntry()->Connect("TextChanged(const char *)", "TGeoTrapEditor", this, "DoModified()");
   fEPhi->GetNumberEntry()->Connect("TextChanged(const char *)", "TGeoTrapEditor", this, "DoModified()");
   fInit = kFALSE;
}

//______________________________________________________________________________
void TGeoTrapEditor::SetModel(TObject* obj)
{
   // Connect to the selected object.
   if (obj == 0 || (obj->IsA()!=TGeoTrap::Class())) {
      SetActive(kFALSE);
      return;                 
   } 
   fShape = (TGeoTrap*)obj;
   fH1i = fShape->GetH1();
   fBl1i = fShape->GetBl1();
   fTl1i = fShape->GetTl1();
   fDzi = fShape->GetDz();
   Double_t h2i = fShape->GetH2();
//   Double_t bl2i = fShape->GetBl2();
//   Double_t tl2i = fShape->GetTl2();
   fSci = h2i/fH1i;
   fAlpha1i = fShape->GetAlpha1();
   fThetai = fShape->GetTheta();
   fPhii = fShape->GetPhi();
   const char *sname = fShape->GetName();
   if (!strcmp(sname, fShape->ClassName())) fShapeName->SetText("-no_name");
   else {
      fShapeName->SetText(sname);
      fNamei = sname;
   }   
   fEH1->SetNumber(fH1i);
   fEBl1->SetNumber(fBl1i);
   fETl1->SetNumber(fTl1i);
   fEDz->SetNumber(fDzi);
   fESc1->SetNumber(1.);
   fESc2->SetNumber(fSci);
   fEAlpha1->SetNumber(fAlpha1i);
   fETheta->SetNumber(fThetai);
   fEPhi->SetNumber(fPhii);
   fApply->SetEnabled(kFALSE);
   fUndo->SetEnabled(kFALSE);
   
   if (fInit) ConnectSignals2Slots();
   SetActive();
}

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

//______________________________________________________________________________
void TGeoTrapEditor::DoName()
{
// Slot for name.
   DoModified();
}

//______________________________________________________________________________
void TGeoTrapEditor::DoApply()
{
// Slot for applying current settings.
   const char *name = fShapeName->GetText();
   if (strcmp(name,fShape->GetName())) fShape->SetName(name);
   Double_t sc1 = fESc1->GetNumber();
   Double_t sc2 = fESc2->GetNumber();
   Double_t h1 = sc1*fEH1->GetNumber();
   Double_t bl1 = sc1*fEBl1->GetNumber(); 
   Double_t tl1 = sc1*fETl1->GetNumber(); 
   Double_t h2 = sc2*fEH1->GetNumber();
   Double_t bl2 = sc2*fEBl1->GetNumber(); 
   Double_t tl2 = sc2*fETl1->GetNumber(); 
   Double_t dz = fEDz->GetNumber();
   Double_t alpha1 = fEAlpha1->GetNumber();
   Double_t theta = fETheta->GetNumber(); 
   Double_t phi = fEPhi->GetNumber();      
   Double_t param[11];
   param[0] = dz;
   param[1] = theta;
   param[2] = phi;
   param[3] = h1;
   param[7] = h2;
   param[4] = bl1;
   param[8] = bl2;
   param[5] = tl1;
   param[9] = tl2;
   param[6] = alpha1;
   param[10] = alpha1;
   fShape->SetDimensions(param);
   fShape->ComputeBBox();
   fUndo->SetEnabled();
   fApply->SetEnabled(kFALSE);
   if (fPad) {
      if (gGeoManager && gGeoManager->GetPainter() && gGeoManager->GetPainter()->IsPaintingShape()) {
         TView *view = fPad->GetView();
         if (!view) {
            fShape->Draw();
            fPad->GetView()->ShowAxis();
         } else {
            view->SetRange(-fShape->GetDX(), -fShape->GetDY(), -fShape->GetDZ(),
                           fShape->GetDX(), fShape->GetDY(), fShape->GetDZ());
            Update();
         }                  
      } else Update();
   }   
}

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

//______________________________________________________________________________
void TGeoTrapEditor::DoUndo()
{
// Slot for undoing last operation.
   fEH1->SetNumber(fH1i);
   fEBl1->SetNumber(fBl1i);
   fETl1->SetNumber(fTl1i);
   fESc1->SetNumber(1.);
   fESc2->SetNumber(fSci);
   fEDz->SetNumber(fDzi);
   fEAlpha1->SetNumber(fAlpha1i);
   fETheta->SetNumber(fThetai);
   fEPhi->SetNumber(fPhii);
   DoApply();
   fUndo->SetEnabled(kFALSE);
   fApply->SetEnabled(kFALSE);
}
   
//______________________________________________________________________________
void TGeoTrapEditor::DoH1()
{
// Slot for H1.
   Double_t h1 = fEH1->GetNumber();
   if (h1<=0) {
      h1 = 0.1;
      fEH1->SetNumber(h1);
   }   
   DoModified();
   if (!IsDelayed()) DoApply();
}

//______________________________________________________________________________
void TGeoTrapEditor::DoBl1()
{
// Slot for Bl1.
   Double_t bl1 = fEBl1->GetNumber();
   if (bl1<=0) {
      bl1 = 0.1;
      fEBl1->SetNumber(bl1);
   }   
   DoModified();
   if (!IsDelayed()) DoApply();
}

//______________________________________________________________________________
void TGeoTrapEditor::DoTl1()
{
// Slot for Tl1.
   Double_t tl1 = fETl1->GetNumber();
   if (tl1<=0) {
      tl1 = 0.1;
      fETl1->SetNumber(tl1);
   }   
   DoModified();
   if (!IsDelayed()) DoApply();
}

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

//______________________________________________________________________________
void TGeoTrapEditor::DoSc1()
{
// Slot for H2.
   Double_t sc1 = fESc1->GetNumber();
   if (sc1<=0) {
      sc1 = 0.1;
      fESc1->SetNumber(sc1);
   }   
   DoModified();
   if (!IsDelayed()) DoApply();
}

//______________________________________________________________________________
void TGeoTrapEditor::DoSc2()
{
// Slot for H2.
   Double_t sc2 = fESc2->GetNumber();
   if (sc2<=0) {
      sc2 = 0.1;
      fESc2->SetNumber(sc2);
   }   
   DoModified();
   if (!IsDelayed()) DoApply();
}

//______________________________________________________________________________
void TGeoTrapEditor::DoAlpha1()
{
// Slot for alpha1.
   Double_t alpha1 = fEAlpha1->GetNumber();
   if (TMath::Abs(alpha1)>=90) {
      alpha1 = 89.9*TMath::Sign(1.,alpha1);
      fEAlpha1->SetNumber(alpha1);
   }   
   DoModified();
   if (!IsDelayed()) DoApply();
}

//______________________________________________________________________________
void TGeoTrapEditor::DoTheta()
{
// Slot for theta.
   Double_t theta = fETheta->GetNumber(); 
   if (theta<0) {
      theta = 0;
      fETheta->SetNumber(theta);
   }   
   if (theta>180) {
      theta = 180;
      fETheta->SetNumber(theta);
   }   
   DoModified();
   if (!IsDelayed()) DoApply();
}

//______________________________________________________________________________
void TGeoTrapEditor::DoPhi()
{
// Slot for phi.
   Double_t phi = fEPhi->GetNumber();
   if (phi<0 || phi>360) {
      phi = 0;
      fEPhi->SetNumber(phi);
   }   
   DoModified();
   if (!IsDelayed()) DoApply();
}

ClassImp(TGeoGtraEditor)

enum ETGeoGtraWid {
   kGTRA_TWIST
};

//////////////////////////////////////////////////////////////////////////
//                                                                      //
//  TGeoGtraEditor                                                      //
//                                                                      //
//////////////////////////////////////////////////////////////////////////
//Begin_Html
/*
<img src="gif/gtra_pic.gif">
*/
//End_Html
//Begin_Html
/*
<img src="gif/gtra_ed.jpg">
*/
//End_Html

//______________________________________________________________________________
TGeoGtraEditor::TGeoGtraEditor(const TGWindow *p, Int_t width,
                               Int_t height, UInt_t options, Pixel_t back)
   : TGeoTrapEditor(p, width, height, options, back)
{
   // Constructor for gtra editor
   fTwisti = 0;
   TGTextEntry *nef;
   // Number entry for Twist angle
   TGCompositeFrame *f1 = new TGCompositeFrame(this, 155, 10, kHorizontalFrame | kFixedWidth);
   f1->AddFrame(new TGLabel(f1, "TWIST"), new TGLayoutHints(kLHintsLeft, 1, 1, 6, 0));
   fETwist = new TGNumberEntry(f1, 0., 5, kGTRA_TWIST);
   fETwist->Resize(100, fETwist->GetDefaultHeight());
   nef = (TGTextEntry*)fETwist->GetNumberEntry();
   nef->SetToolTipText("Enter twist angle");
   fETwist->Associate(this);
   f1->AddFrame(fETwist, new TGLayoutHints(kLHintsRight, 2, 2, 4, 4));
   AddFrame(f1, new TGLayoutHints(kLHintsLeft, 2, 2, 4, 4));
   TGeoTabManager::MoveFrame(fDFrame, this);
   TGeoTabManager::MoveFrame(fBFrame, this);
   fETwist->Connect("ValueSet(Long_t)", "TGeoGtraEditor", this, "DoTwist()");
   nef->Connect("TextChanged(const char *)", "TGeoGtraEditor", this, "DoModified()");
}
//______________________________________________________________________________
TGeoGtraEditor::~TGeoGtraEditor()
{
// Destructor
   TGFrameElement *el;
   TIter next(GetList());
   while ((el = (TGFrameElement *)next())) {
      if (el->fFrame->IsComposite()) 
         TGeoTabManager::Cleanup((TGCompositeFrame*)el->fFrame);
   }
   Cleanup();   
}

//______________________________________________________________________________
void TGeoGtraEditor::SetModel(TObject* obj)
{
   // Connect to a given twisted trapezoid.
   if (obj == 0 || (obj->IsA()!=TGeoGtra::Class())) {
      SetActive(kFALSE);
      return;                 
   } 
   fShape = (TGeoTrap*)obj;
   fH1i = fShape->GetH1();
   fBl1i = fShape->GetBl1();
   fTl1i = fShape->GetTl1();
   fDzi = fShape->GetDz();
   Double_t h2i = fShape->GetH2();
//   Double_t bl2i = fShape->GetBl2();
//   Double_t tl2i = fShape->GetTl2();
   fSci = h2i/fH1i;
   fAlpha1i = fShape->GetAlpha1();
   fThetai = fShape->GetTheta();
   fPhii = fShape->GetPhi();
   fTwisti = ((TGeoGtra*)fShape)->GetTwistAngle();
   const char *sname = fShape->GetName();
   if (!strcmp(sname, fShape->ClassName())) fShapeName->SetText("-no_name");
   else {
      fShapeName->SetText(sname);
      fNamei = sname;
   }   
   fEH1->SetNumber(fH1i);
   fEBl1->SetNumber(fBl1i);
   fETl1->SetNumber(fTl1i);
   fEDz->SetNumber(fDzi);
   fESc1->SetNumber(1.);
   fESc2->SetNumber(fSci);
   fEAlpha1->SetNumber(fAlpha1i);
   fETheta->SetNumber(fThetai);
   fEPhi->SetNumber(fPhii);
   fETwist->SetNumber(fTwisti);
   fApply->SetEnabled(kFALSE);
   fUndo->SetEnabled(kFALSE);
   
   if (fInit) ConnectSignals2Slots();
   SetActive();
}   
   
//______________________________________________________________________________
void TGeoGtraEditor::DoApply()
{
// Slot for applying current settings.
   const char *name = fShapeName->GetText();
   if (strcmp(name,fShape->GetName())) fShape->SetName(name);
   Double_t sc1 = fESc1->GetNumber();
   Double_t sc2 = fESc2->GetNumber();
   Double_t h1 = sc1*fEH1->GetNumber();
   Double_t bl1 = sc1*fEBl1->GetNumber(); 
   Double_t tl1 = sc1*fETl1->GetNumber(); 
   Double_t h2 = sc2*fEH1->GetNumber();
   Double_t bl2 = sc2*fEBl1->GetNumber(); 
   Double_t tl2 = sc2*fETl1->GetNumber(); 
   Double_t dz = fEDz->GetNumber();
   Double_t alpha1 = fEAlpha1->GetNumber();
   Double_t theta = fETheta->GetNumber(); 
   Double_t phi = fEPhi->GetNumber();
   Double_t twist = fETwist->GetNumber();      
   Double_t param[12];
   param[0] = dz;
   param[1] = theta;
   param[2] = phi;
   param[3] = h1;
   param[7] = h2;
   param[4] = bl1;
   param[8] = bl2;
   param[5] = tl1;
   param[9] = tl2;
   param[6] = alpha1;
   param[10] = alpha1;
   param[11] = twist;
   TGeoGtra *shape = (TGeoGtra*)fShape;
   shape->SetDimensions(param);
   shape->ComputeBBox();
   fUndo->SetEnabled();
   fApply->SetEnabled(kFALSE);
   if (fPad) {
      if (gGeoManager && gGeoManager->GetPainter() && gGeoManager->GetPainter()->IsPaintingShape()) {
         TView *view = fPad->GetView();
         if (!view) {
            fShape->Draw();
            fPad->GetView()->ShowAxis();
         } else {
            view->SetRange(-fShape->GetDX(), -fShape->GetDY(), -fShape->GetDZ(),
                           fShape->GetDX(), fShape->GetDY(), fShape->GetDZ());
            Update();
         }                  
      } else Update();
   }   
}

//______________________________________________________________________________
void TGeoGtraEditor::DoUndo()
{
// Slot for undoing last operation.
   fEH1->SetNumber(fH1i);
   fEBl1->SetNumber(fBl1i);
   fETl1->SetNumber(fTl1i);
   fESc1->SetNumber(1.);
   fESc2->SetNumber(fSci);
   fEDz->SetNumber(fDzi);
   fEAlpha1->SetNumber(fAlpha1i);
   fETheta->SetNumber(fThetai);
   fEPhi->SetNumber(fPhii);
   fETwist->SetNumber(fTwisti);
   DoApply();
   fUndo->SetEnabled(kFALSE);
   fApply->SetEnabled(kFALSE);
}

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