]>
Commit | Line | Data |
---|---|---|
d810d0de | 1 | // $Id$ |
2 | // Main authors: Matevz Tadel & Alja Mrak-Tadel: 2006, 2007 | |
092578a7 | 3 | |
d810d0de | 4 | /************************************************************************** |
5 | * Copyright(c) 1998-2008, ALICE Experiment at CERN, all rights reserved. * | |
6 | * See http://aliceinfo.cern.ch/Offline/AliRoot/License.html for * | |
51346b82 | 7 | * full copyright notice. * |
d810d0de | 8 | **************************************************************************/ |
9 | ||
10 | #include "AliEveTPCSectorVizEditor.h" | |
cb4245bb | 11 | #include <EveDet/AliEveTPCSectorViz.h> |
092578a7 | 12 | |
84aff7a4 | 13 | #include <TEveGValuators.h> |
14 | #include <TEveTransEditor.h> | |
5987168b | 15 | |
092578a7 | 16 | #include <TVirtualPad.h> |
092578a7 | 17 | |
092578a7 | 18 | #include <TGButton.h> |
19 | #include <TGNumberEntry.h> | |
092578a7 | 20 | #include <TGSlider.h> |
21 | #include <TGDoubleSlider.h> | |
d810d0de | 22 | |
092578a7 | 23 | |
57ffa5fb | 24 | //______________________________________________________________________________ |
092578a7 | 25 | // |
a97abca8 | 26 | // Editor for AliEveTPCSectorViz. |
092578a7 | 27 | |
d810d0de | 28 | ClassImp(AliEveTPCSectorVizEditor) |
092578a7 | 29 | |
d810d0de | 30 | AliEveTPCSectorVizEditor::AliEveTPCSectorVizEditor(const TGWindow *p, |
265ecb21 | 31 | Int_t width, Int_t height, |
32 | UInt_t options, Pixel_t back) : | |
a8600b56 | 33 | TGedFrame(p, width, height, options | kVerticalFrame, back), |
265ecb21 | 34 | fM(0), |
fbb1b08d | 35 | fHMTrans (0), |
36 | fSectorID (0), fAutoTrans (0), | |
37 | fRnrInn (0), fRnrOut1 (0), fRnrOut2(0), | |
38 | fThreshold (0), fMaxVal (0), | |
265ecb21 | 39 | fTime (0) |
092578a7 | 40 | { |
a97abca8 | 41 | // Constructor. |
42 | ||
a8600b56 | 43 | fPriority = 40; |
092578a7 | 44 | |
5987168b | 45 | Int_t labelW = 60; |
092578a7 | 46 | |
fbb1b08d | 47 | MakeTitle("Transformation matrix"); |
48 | ||
84aff7a4 | 49 | fHMTrans = new TEveTransSubEditor(this); |
d810d0de | 50 | fHMTrans->Connect("UseTrans()", "AliEveTPCSectorVizEditor", this, "Update()"); |
51 | fHMTrans->Connect("TransChanged()", "AliEveTPCSectorVizEditor", this, "Update()"); | |
fbb1b08d | 52 | AddFrame(fHMTrans, new TGLayoutHints(kLHintsTop | kLHintsExpandX, 2, 0, 0, 0)); |
53 | ||
d810d0de | 54 | MakeTitle("AliEveTPCSectorViz"); |
fbb1b08d | 55 | |
84aff7a4 | 56 | fSectorID = new TEveGValuator(this, "SectorID", 110, 0); |
5987168b | 57 | fSectorID->SetLabelWidth(labelW); |
58 | fSectorID->SetShowSlider(kFALSE); | |
59 | fSectorID->SetNELength(4); | |
60 | fSectorID->Build(); | |
61 | fSectorID->SetLimits(0, 35); | |
62 | fSectorID->SetToolTip("0-17 +z plate; 18-35 -z plate"); | |
63 | fSectorID->Connect("ValueSet(Double_t)", | |
d810d0de | 64 | "AliEveTPCSectorVizEditor", this, "DoSectorID()"); |
fbb1b08d | 65 | // Reuse sectorID for auto-transformation button |
66 | fAutoTrans = new TGCheckButton(fSectorID, "AutoTrans"); | |
67 | fAutoTrans->SetToolTipText("Automatically set transformation to true position"); | |
68 | fSectorID->AddFrame(fAutoTrans, new TGLayoutHints(kLHintsLeft, 12, 0, 1, 0)); | |
d810d0de | 69 | fAutoTrans->Connect("Toggled(Bool_t)","AliEveTPCSectorVizEditor", this, "DoAutoTrans()"); |
5987168b | 70 | AddFrame(fSectorID, new TGLayoutHints(kLHintsTop, 1, 1, 1, 1)); |
092578a7 | 71 | |
092578a7 | 72 | { |
73 | TGHorizontalFrame* f = new TGHorizontalFrame(this); | |
74 | ||
75 | fRnrInn = new TGCheckButton(f, "Inner"); | |
76 | f->AddFrame(fRnrInn, new TGLayoutHints(kLHintsTop, 3, 1, 1, 0)); | |
d810d0de | 77 | fRnrInn->Connect("Toggled(Bool_t)","AliEveTPCSectorVizEditor", this, "DoRnrInn()"); |
092578a7 | 78 | |
79 | fRnrOut1 = new TGCheckButton(f, "Outer 1"); | |
80 | f->AddFrame(fRnrOut1, new TGLayoutHints(kLHintsTop, 3, 1, 1, 0)); | |
d810d0de | 81 | fRnrOut1->Connect("Toggled(Bool_t)","AliEveTPCSectorVizEditor", this, "DoRnrOut1()"); |
092578a7 | 82 | |
83 | fRnrOut2 = new TGCheckButton(f, "Outer 2"); | |
84 | f->AddFrame(fRnrOut2, new TGLayoutHints(kLHintsTop, 3, 1, 1, 0)); | |
d810d0de | 85 | fRnrOut2->Connect("Toggled(Bool_t)","AliEveTPCSectorVizEditor", this, "DoRnrOut2()"); |
092578a7 | 86 | |
87 | AddFrame(f, new TGLayoutHints(kLHintsTop, 1, 1, 1, 1)); | |
88 | } | |
5987168b | 89 | |
84aff7a4 | 90 | fThreshold = new TEveGValuator(this, "Threshold", 200, 0); |
5987168b | 91 | fThreshold->SetNELength(4); |
92 | fThreshold->SetLabelWidth(labelW); | |
93 | fThreshold->Build(); | |
94 | fThreshold->GetSlider()->SetWidth(120); | |
a8600b56 | 95 | fThreshold->SetLimits(0,250); |
5987168b | 96 | fThreshold->Connect("ValueSet(Double_t)", |
d810d0de | 97 | "AliEveTPCSectorVizEditor", this, "DoThreshold()"); |
5987168b | 98 | AddFrame(fThreshold, new TGLayoutHints(kLHintsTop, 1, 1, 2, 1)); |
99 | ||
84aff7a4 | 100 | fMaxVal = new TEveGValuator(this,"MaxVal", 200, 0); |
5987168b | 101 | fMaxVal->SetNELength(4); |
102 | fMaxVal->SetLabelWidth(labelW); | |
103 | fMaxVal->Build(); | |
104 | fMaxVal->GetSlider()->SetWidth(120); | |
a8600b56 | 105 | fMaxVal->SetLimits(0, 500); |
5987168b | 106 | fMaxVal->Connect("ValueSet(Double_t)", |
d810d0de | 107 | "AliEveTPCSectorVizEditor", this, "DoMaxVal()"); |
5987168b | 108 | AddFrame(fMaxVal, new TGLayoutHints(kLHintsTop, 1, 1, 2, 1)); |
109 | ||
84aff7a4 | 110 | fTime = new TEveGDoubleValuator(this,"Time", 200, 0); |
5987168b | 111 | fTime->SetNELength(4); |
112 | fTime->SetLabelWidth(labelW); | |
113 | fTime->Build(); | |
114 | fTime->GetSlider()->SetWidth(224); | |
115 | fTime->SetLimits(0, 1023, TGNumberFormat::kNESInteger); | |
116 | fTime->Connect("ValueSet()", | |
d810d0de | 117 | "AliEveTPCSectorVizEditor", this, "DoTime()"); |
5987168b | 118 | AddFrame(fTime, new TGLayoutHints(kLHintsTop, 1, 1, 2, 1)); |
092578a7 | 119 | } |
120 | ||
57ffa5fb | 121 | /******************************************************************************/ |
092578a7 | 122 | |
d810d0de | 123 | void AliEveTPCSectorVizEditor::SetModel(TObject* obj) |
092578a7 | 124 | { |
a97abca8 | 125 | // Set model object. |
126 | ||
d810d0de | 127 | fM = dynamic_cast<AliEveTPCSectorViz*>(obj); |
092578a7 | 128 | |
a15e6d7d | 129 | fHMTrans->SetModel(fM->PtrMainTrans()); |
fbb1b08d | 130 | |
5987168b | 131 | fSectorID->SetValue(fM->fSectorID); |
fbb1b08d | 132 | fAutoTrans->SetState(fM->fAutoTrans ? kButtonDown : kButtonUp); |
5987168b | 133 | |
134 | fRnrInn ->SetState(fM->fRnrInn ? kButtonDown : kButtonUp); | |
092578a7 | 135 | fRnrOut1->SetState(fM->fRnrOut1 ? kButtonDown : kButtonUp); |
136 | fRnrOut2->SetState(fM->fRnrOut2 ? kButtonDown : kButtonUp); | |
092578a7 | 137 | |
5987168b | 138 | fThreshold->SetValue(fM->fThreshold); |
139 | fMaxVal->SetValue(fM->fMaxVal); | |
140 | ||
141 | fTime->SetValues(fM->fMinTime, fM->fMaxTime); | |
092578a7 | 142 | } |
143 | ||
57ffa5fb | 144 | /******************************************************************************/ |
092578a7 | 145 | |
d810d0de | 146 | void AliEveTPCSectorVizEditor::DoSectorID() |
092578a7 | 147 | { |
a97abca8 | 148 | // Slot for SectorID. |
149 | ||
5987168b | 150 | fM->SetSectorID((Int_t) fSectorID->GetValue()); |
092578a7 | 151 | Update(); |
152 | } | |
153 | ||
d810d0de | 154 | void AliEveTPCSectorVizEditor::DoAutoTrans() |
02937761 | 155 | { |
a97abca8 | 156 | // Slot for AutoTrans. |
157 | ||
fbb1b08d | 158 | fM->SetAutoTrans(fAutoTrans->IsOn()); |
02937761 | 159 | Update(); |
160 | } | |
161 | ||
57ffa5fb | 162 | /******************************************************************************/ |
092578a7 | 163 | |
d810d0de | 164 | void AliEveTPCSectorVizEditor::DoRnrInn() |
092578a7 | 165 | { |
a97abca8 | 166 | // Slot for RnrInn. |
167 | ||
092578a7 | 168 | fM->SetRnrInn(fRnrInn->IsOn()); |
169 | Update(); | |
170 | } | |
171 | ||
d810d0de | 172 | void AliEveTPCSectorVizEditor::DoRnrOut1() |
092578a7 | 173 | { |
a97abca8 | 174 | // Slot for RnrOut1. |
175 | ||
092578a7 | 176 | fM->SetRnrOut1(fRnrOut1->IsOn()); |
177 | Update(); | |
178 | } | |
179 | ||
d810d0de | 180 | void AliEveTPCSectorVizEditor::DoRnrOut2() |
092578a7 | 181 | { |
a97abca8 | 182 | // Slot for RnrOut2. |
183 | ||
092578a7 | 184 | fM->SetRnrOut2(fRnrOut2->IsOn()); |
185 | Update(); | |
186 | } | |
187 | ||
57ffa5fb | 188 | /******************************************************************************/ |
092578a7 | 189 | |
d810d0de | 190 | void AliEveTPCSectorVizEditor::DoThreshold() |
092578a7 | 191 | { |
a97abca8 | 192 | // Slot for Threshold. |
193 | ||
5987168b | 194 | fM->SetThreshold((Short_t) fThreshold->GetValue()); |
a89f67d8 | 195 | fThreshold->SetValue(fM->fThreshold); |
092578a7 | 196 | Update(); |
197 | } | |
198 | ||
d810d0de | 199 | void AliEveTPCSectorVizEditor::DoMaxVal() |
092578a7 | 200 | { |
a97abca8 | 201 | // Slot for MaxVal. |
202 | ||
5987168b | 203 | fM->SetMaxVal((Int_t) fMaxVal->GetValue()); |
a89f67d8 | 204 | fMaxVal->SetValue(fM->fMaxVal); |
092578a7 | 205 | Update(); |
206 | } | |
207 | ||
57ffa5fb | 208 | /******************************************************************************/ |
092578a7 | 209 | |
d810d0de | 210 | void AliEveTPCSectorVizEditor::DoTime() |
51346b82 | 211 | { |
a97abca8 | 212 | // Slot for time-range. |
213 | ||
5987168b | 214 | fM->SetMinTime((Int_t) fTime->GetMin()); |
215 | fM->SetMaxTime((Int_t) fTime->GetMax()); | |
092578a7 | 216 | Update(); |
217 | } |