#include "TEveCaloVizEditor.h"
#include "TEveCalo.h"
#include "TEveGValuators.h"
#include "TEveRGBAPaletteEditor.h"
#include "TGLabel.h"
#include "TGNumberEntry.h"
#include "TGDoubleSlider.h"
#include "TGNumberEntry.h"
#include "TG3DLine.h"
#include "TMathBase.h"
#include "TMath.h"
ClassImp(TEveCaloVizEditor);
TEveCaloVizEditor::TEveCaloVizEditor(const TGWindow *p, Int_t width, Int_t height,
UInt_t options, Pixel_t back) :
TGedFrame(p, width, height, options | kVerticalFrame, back),
fM(0),
fEtaRng(0),
fPhi(0),
fPhiRng(0),
fTower(0),
fPalette(0),
fCellZScale(0)
{
fTower = CreateEditorTabSubFrame("Towers");
Int_t labelW = 45;
fEtaRng = new TEveGDoubleValuator(fTower,"Eta rng:", 40, 0);
fEtaRng->SetNELength(6);
fEtaRng->SetLabelWidth(labelW);
fEtaRng->Build();
fEtaRng->GetSlider()->SetWidth(195);
fEtaRng->SetLimits(-5.5, 5.5, TGNumberFormat::kNESRealTwo);
fEtaRng->Connect("ValueSet()", "TEveCaloVizEditor", this, "DoEtaRange()");
fTower->AddFrame(fEtaRng, new TGLayoutHints(kLHintsTop, 1, 1, 4, 5));
fPhi = new TEveGValuator(fTower, "Phi:", 90, 0);
fPhi->SetLabelWidth(labelW);
fPhi->SetNELength(6);
fPhi->Build();
fPhi->SetLimits(-180, 180);
fPhi->Connect("ValueSet(Double_t)", "TEveCaloVizEditor", this, "DoPhi()");
fTower->AddFrame(fPhi, new TGLayoutHints(kLHintsTop, 1, 1, 1, 1));
fPhiRng = new TEveGValuator(fTower, "PhiRng:", 90, 0);
fPhiRng->SetLabelWidth(labelW);
fPhiRng->SetNELength(6);
fPhiRng->Build();
fPhiRng->SetLimits(0, 180);
fPhiRng->Connect("ValueSet(Double_t)", "TEveCaloVizEditor", this, "DoPhi()");
fTower->AddFrame(fPhiRng, new TGLayoutHints(kLHintsTop, 1, 1, 1, 1));
fCellZScale = new TEveGValuator(fTower, "ZScale:", 90, 0);
fCellZScale->SetLabelWidth(labelW);
fCellZScale->SetNELength(6);
fCellZScale->Build();
fCellZScale->SetLimits(0, 5, 100, TGNumberFormat::kNESRealTwo);
fCellZScale->Connect("ValueSet(Double_t)", "TEveCaloVizEditor", this, "DoCellZScale()");
fTower->AddFrame(fCellZScale, new TGLayoutHints(kLHintsTop, 1, 1, 1, 1));
TGHorizontalFrame *title2 = new TGHorizontalFrame(fTower, 145, 10, kLHintsExpandX| kFixedWidth);
title2->AddFrame(new TGLabel(title2, "Palette Controls"),
new TGLayoutHints(kLHintsLeft, 1, 1, 0, 0));
title2->AddFrame(new TGHorizontal3DLine(title2),
new TGLayoutHints(kLHintsExpandX, 5, 5, 7, 7));
fTower->AddFrame(title2, new TGLayoutHints(kLHintsTop, 0, 0, 5, 0));
fPalette = new TEveRGBAPaletteSubEditor(fTower);
fTower->AddFrame(fPalette, new TGLayoutHints(kLHintsTop | kLHintsExpandX, 2, 0, 0, 0));
fPalette->Connect("Changed()", "TEveCaloVizEditor", this, "DoPalette()");
}
void TEveCaloVizEditor::SetModel(TObject* obj)
{
fM = dynamic_cast<TEveCaloViz*>(obj);
fEtaRng->SetLimits(fM->fEtaLowLimit, fM->fEtaHighLimit);
fEtaRng->SetValues(fM->fEtaMin, fM->fEtaMax);
fPhi->SetValue(fM->fPhi*TMath::RadToDeg());
fPhiRng->SetValue(fM->fPhiRng*TMath::RadToDeg());
fPalette->SetModel(fM->fPalette);
fCellZScale->SetValue(fM->fCellZScale);
}
void TEveCaloVizEditor::DoEtaRange()
{
fM->SetEta(fEtaRng->GetMin(), fEtaRng->GetMax());
Update();
}
void TEveCaloVizEditor::DoPhi()
{
fM->SetPhiWithRng(fPhi->GetValue()*TMath::DegToRad(), fPhiRng->GetValue()*TMath::DegToRad());
Update();
}
void TEveCaloVizEditor::DoCellZScale()
{
fM->SetCellZScale(fCellZScale->GetValue());
Update();
}
void TEveCaloVizEditor::DoPalette()
{
fM->InvalidateCache();
Update();
}
Last change: Tue May 13 17:08:35 2008
Last generated: 2008-05-13 17:08
This page has been automatically generated. If you have any comments or suggestions about the page layout send a mail to ROOT support, or contact the developers with any questions or problems regarding ROOT.