2 // Main authors: Matevz Tadel & Alja Mrak-Tadel: 2006, 2007
4 /**************************************************************************
5 * Copyright(c) 1998-2008, ALICE Experiment at CERN, all rights reserved. *
6 * See http://aliceinfo.cern.ch/Offline/AliRoot/License.html for *
7 * full copyright notice. *
8 **************************************************************************/
10 #include "AliEveTPCSector2DEditor.h"
11 #include <Alieve/AliEveTPCSector2D.h>
14 #include <TGComboBox.h>
18 //______________________________________________________________________
19 // AliEveTPCSector2DEditor
22 ClassImp(AliEveTPCSector2DEditor)
24 AliEveTPCSector2DEditor::AliEveTPCSector2DEditor(const TGWindow *p,
25 Int_t width, Int_t height,
26 UInt_t options, Pixel_t back) :
27 TGedFrame(p, width, height, options | kVerticalFrame, back),
29 fShowMax(0), fAverage(0), fUseTexture(0), fPickEmpty(0), fPickMode(0)
31 MakeTitle("AliEveTPCSector2D");
34 TGHorizontalFrame* f = new TGHorizontalFrame(this);
35 fShowMax = new TGCheckButton(f, "ShowMax");
36 f->AddFrame(fShowMax, new TGLayoutHints(kLHintsLeft, 3, 16, 1, 0));
37 fShowMax->Connect("Toggled(Bool_t)","AliEveTPCSector2DEditor", this, "DoShowMax()");
38 fAverage = new TGCheckButton(f, "Average");
39 f->AddFrame(fAverage, new TGLayoutHints(kLHintsLeft, 3, 1, 1, 0));
40 fAverage->Connect("Toggled(Bool_t)","AliEveTPCSector2DEditor", this, "DoAverage()");
44 TGHorizontalFrame* f = new TGHorizontalFrame(this);
45 fUseTexture = new TGCheckButton(f, "UseTexture");
46 f->AddFrame(fUseTexture, new TGLayoutHints(kLHintsTop, 3, 9, 1, 0));
47 fUseTexture->Connect("Toggled(Bool_t)","AliEveTPCSector2DEditor", this, "DoUseTexture()");
48 fPickEmpty = new TGCheckButton(f, "PickEmpty");
49 f->AddFrame(fPickEmpty, new TGLayoutHints(kLHintsTop, 3, 1, 1, 0));
50 fPickEmpty->Connect("Toggled(Bool_t)","AliEveTPCSector2DEditor", this, "DoPickEmpty()");
54 TGHorizontalFrame* f = new TGHorizontalFrame(this);
55 TGLabel* lab = new TGLabel(f, "PickMode");
56 f->AddFrame(lab, new TGLayoutHints(kLHintsLeft|kLHintsBottom, 1, 10, 1, 2));
57 fPickMode = new TGComboBox(f);
58 fPickMode->AddEntry("Print", 0);
59 fPickMode->AddEntry("1D histo", 1);
60 fPickMode->AddEntry("2D histo", 2);
61 TGListBox* lb = fPickMode->GetListBox();
62 lb->Resize(lb->GetWidth(), 3*18);
63 fPickMode->Resize(80, 20);
64 fPickMode->Connect("Selected(Int_t)", "AliEveTPCSector2DEditor", this, "DoPickMode(Int_t)");
65 f->AddFrame(fPickMode, new TGLayoutHints(kLHintsTop, 1, 1, 1, 1));
70 AliEveTPCSector2DEditor::~AliEveTPCSector2DEditor()
73 /**************************************************************************/
75 void AliEveTPCSector2DEditor::SetModel(TObject* obj)
77 fM = dynamic_cast<AliEveTPCSector2D*>(obj);
79 fShowMax->SetState(fM->fShowMax ? kButtonDown : kButtonUp);
82 fUseTexture->SetState(fM->fUseTexture ? kButtonDown : kButtonUp);
83 fPickEmpty->SetState(fM->fPickEmpty ? kButtonDown : kButtonUp);
84 fPickMode->Select(fM->fPickMode, kFALSE);
87 /**************************************************************************/
89 void AliEveTPCSector2DEditor::DoShowMax()
91 fM->SetShowMax(fShowMax->IsOn());
96 void AliEveTPCSector2DEditor::DoAverage()
98 fM->SetAverage(fAverage->IsOn());
102 void AliEveTPCSector2DEditor::SetupAverage()
105 fAverage->SetEnabled(kFALSE);
107 fAverage->SetEnabled(kTRUE);
108 fAverage->SetState(fM->fAverage ? kButtonDown : kButtonUp);
112 /**************************************************************************/
114 void AliEveTPCSector2DEditor::DoUseTexture()
116 fM->fUseTexture = fUseTexture->IsOn();
120 void AliEveTPCSector2DEditor::DoPickEmpty()
122 fM->fPickEmpty = fPickEmpty->IsOn();
126 void AliEveTPCSector2DEditor::DoPickMode(Int_t mode)
128 fM->fPickMode = mode;