]> git.uio.no Git - u/mrichter/AliRoot.git/blame - EVE/Alieve/TPCSector2DEditor.cxx
New files from Alexandru: TRD visualization.
[u/mrichter/AliRoot.git] / EVE / Alieve / TPCSector2DEditor.cxx
CommitLineData
5a5a1232 1// $Header$
2
915dabe1 3#include "TPCSector2DEditor.h"
4#include <Alieve/TPCSector2D.h>
5a5a1232 5
5a5a1232 6#include <TGButton.h>
a8600b56 7#include <TGComboBox.h>
8#include <TGLabel.h>
5a5a1232 9
10using namespace Reve;
11using namespace Alieve;
12
13//______________________________________________________________________
915dabe1 14// TPCSector2DEditor
5a5a1232 15//
16
915dabe1 17ClassImp(TPCSector2DEditor)
5a5a1232 18
a8600b56 19TPCSector2DEditor::TPCSector2DEditor(const TGWindow *p,
20 Int_t width, Int_t height,
684070b7 21 UInt_t options, Pixel_t back) :
a8600b56 22 TGedFrame(p, width, height, options | kVerticalFrame, back),
265ecb21 23 fM(0),
a8600b56 24 fShowMax(0), fAverage(0), fUseTexture(0), fPickEmpty(0), fPickMode(0)
5a5a1232 25{
915dabe1 26 MakeTitle("TPCSector2D");
5a5a1232 27
5a5a1232 28 {
29 TGHorizontalFrame* f = new TGHorizontalFrame(this);
b56d8877 30 fShowMax = new TGCheckButton(f, "ShowMax");
31 f->AddFrame(fShowMax, new TGLayoutHints(kLHintsLeft, 3, 16, 1, 0));
32 fShowMax->Connect("Toggled(Bool_t)","Alieve::TPCSector2DEditor", this, "DoShowMax()");
33 fAverage = new TGCheckButton(f, "Average");
34 f->AddFrame(fAverage, new TGLayoutHints(kLHintsLeft, 3, 1, 1, 0));
35 fAverage->Connect("Toggled(Bool_t)","Alieve::TPCSector2DEditor", this, "DoAverage()");
a8600b56 36 AddFrame(f);
37 }
38 {
39 TGHorizontalFrame* f = new TGHorizontalFrame(this);
40 fUseTexture = new TGCheckButton(f, "UseTexture");
41 f->AddFrame(fUseTexture, new TGLayoutHints(kLHintsTop, 3, 9, 1, 0));
42 fUseTexture->Connect("Toggled(Bool_t)","Alieve::TPCSector2DEditor", this, "DoUseTexture()");
43 fPickEmpty = new TGCheckButton(f, "PickEmpty");
44 f->AddFrame(fPickEmpty, new TGLayoutHints(kLHintsTop, 3, 1, 1, 0));
45 fPickEmpty->Connect("Toggled(Bool_t)","Alieve::TPCSector2DEditor", this, "DoPickEmpty()");
46 AddFrame(f);
47 }
48 {
49 TGHorizontalFrame* f = new TGHorizontalFrame(this);
50 TGLabel* lab = new TGLabel(f, "PickMode");
51 f->AddFrame(lab, new TGLayoutHints(kLHintsLeft|kLHintsBottom, 1, 10, 1, 2));
52 fPickMode = new TGComboBox(f);
53 fPickMode->AddEntry("Print", 0);
54 fPickMode->AddEntry("1D histo", 1);
55 fPickMode->AddEntry("2D histo", 2);
56 TGListBox* lb = fPickMode->GetListBox();
57 lb->Resize(lb->GetWidth(), 3*16);
58 fPickMode->Resize(80, 20);
59 fPickMode->Connect("Selected(Int_t)", "Alieve::TPCSector2DEditor", this, "DoPickMode(Int_t)");
60 f->AddFrame(fPickMode, new TGLayoutHints(kLHintsTop, 1, 1, 1, 1));
61 AddFrame(f);
b56d8877 62 }
5a5a1232 63}
64
915dabe1 65TPCSector2DEditor::~TPCSector2DEditor()
5a5a1232 66{}
67
68/**************************************************************************/
69
a8600b56 70void TPCSector2DEditor::SetModel(TObject* obj)
5a5a1232 71{
a8600b56 72 fM = dynamic_cast<TPCSector2D*>(obj);
5a5a1232 73
5a5a1232 74 fShowMax->SetState(fM->fShowMax ? kButtonDown : kButtonUp);
b56d8877 75 SetupAverage();
915dabe1 76
092578a7 77 fUseTexture->SetState(fM->fUseTexture ? kButtonDown : kButtonUp);
a8600b56 78 fPickEmpty->SetState(fM->fPickEmpty ? kButtonDown : kButtonUp);
79 fPickMode->Select(fM->fPickMode, kFALSE);
5a5a1232 80}
81
82/**************************************************************************/
83
915dabe1 84void TPCSector2DEditor::DoShowMax()
5a5a1232 85{
86 fM->SetShowMax(fShowMax->IsOn());
b56d8877 87 SetupAverage();
88 Update();
89}
90
91void TPCSector2DEditor::DoAverage()
92{
93 fM->SetAverage(fAverage->IsOn());
94 Update();
95}
96
97void TPCSector2DEditor::SetupAverage()
98{
99 if(fM->fShowMax) {
100 fAverage->SetEnabled(kFALSE);
101 } else {
102 fAverage->SetEnabled(kTRUE);
103 fAverage->SetState(fM->fAverage ? kButtonDown : kButtonUp);
104 }
105}
106
092578a7 107/**************************************************************************/
b56d8877 108
092578a7 109void TPCSector2DEditor::DoUseTexture()
b56d8877 110{
092578a7 111 fM->fUseTexture = fUseTexture->IsOn();
5a5a1232 112 Update();
113}
a8600b56 114
115void TPCSector2DEditor::DoPickEmpty()
116{
117 fM->fPickEmpty = fPickEmpty->IsOn();
118 // Update();
119}
120
121void TPCSector2DEditor::DoPickMode(Int_t mode)
122{
123 fM->fPickMode = mode;
124 // Update();
125}