]> git.uio.no Git - u/mrichter/AliRoot.git/blob - EVE/Alieve/TPCSector3DEditor.cxx
580aea7723b38849011aa43563bf75885895c8ff
[u/mrichter/AliRoot.git] / EVE / Alieve / TPCSector3DEditor.cxx
1 // $Header$
2
3 #include "TPCSector3DEditor.h"
4 #include <Alieve/TPCSector3D.h>
5
6 #include <Reve/RGValuators.h>
7
8 #include <TVirtualPad.h>
9 #include <TColor.h>
10
11 #include <TGLabel.h>
12 #include <TGButton.h>
13 #include <TGNumberEntry.h>
14 #include <TGColorSelect.h>
15 #include <TGSlider.h>
16 #include <TGDoubleSlider.h>
17
18 using namespace Reve;
19 using namespace Alieve;
20
21 //______________________________________________________________________
22 // TPCSector3DEditor
23 //
24
25 ClassImp(TPCSector3DEditor)
26
27 TPCSector3DEditor::TPCSector3DEditor(const TGWindow *p,
28                                      Int_t width, Int_t height,
29                                      UInt_t options, Pixel_t back) :
30   TGedFrame(p, width, height, options | kVerticalFrame, back),
31   fM(0),
32   fRnrFrame(0), fDriftVel(0), fPointFrac(0), fPointSize(0)
33 {
34   MakeTitle("TPCSector3D");
35
36   Int_t labelW = 60;
37
38   fRnrFrame = new TGCheckButton(this, "ShowFrame");
39   AddFrame(fRnrFrame, new TGLayoutHints(kLHintsTop, 3, 1, 1, 0));
40   fRnrFrame->Connect
41     ("Toggled(Bool_t)","Alieve::TPCSector3DEditor", this, "DoRnrFrame()");
42
43   fDriftVel = new RGValuator(this, "Vdrift fac", 110, 0);
44   fDriftVel->SetLabelWidth(labelW);
45   fDriftVel->SetShowSlider(kFALSE);
46   fDriftVel->SetNELength(6);
47   fDriftVel->Build();
48   fDriftVel->SetLimits(0.1, 10, 1, TGNumberFormat::kNESRealThree);
49   fDriftVel->SetToolTip("Drift velocity factor");
50   fDriftVel->Connect("ValueSet(Double_t)",
51                      "Alieve::TPCSector3DEditor", this, "DoDriftVel()");
52   AddFrame(fDriftVel, new TGLayoutHints(kLHintsTop, 1, 1, 2, 1));
53
54   fPointFrac = new RGValuator(this,"Point frac", 200, 0);
55   fPointFrac->SetLabelWidth(labelW);
56   fPointFrac->SetNELength(4);
57   fPointFrac->Build();
58   fPointFrac->GetSlider()->SetWidth(101 + 16);
59   fPointFrac->SetLimits(0.0, 1.0, 101);
60   fPointFrac->SetToolTip("Fraction of signal range displayed as points");
61   fPointFrac->Connect("ValueSet(Double_t)",
62                       "Alieve::TPCSector3DEditor", this, "DoPointFrac()");
63   AddFrame(fPointFrac, new TGLayoutHints(kLHintsTop, 1, 1, 2, 1));
64
65   fPointSize = new RGValuator(this,"Point size", 200, 0);
66   fPointSize->SetLabelWidth(labelW);
67   fPointSize->SetShowSlider(kFALSE);
68   fPointSize->SetNELength(4);
69   fPointSize->Build();
70   //fPointSize->GetSlider()->SetWidth(101 + 16);
71   fPointSize->SetLimits(0.1, 32.0, 1, TGNumberFormat::kNESRealOne);
72   fPointSize->SetToolTip("Size of displayed points");
73   fPointSize->Connect("ValueSet(Double_t)",
74                       "Alieve::TPCSector3DEditor", this, "DoPointSize()");
75   AddFrame(fPointSize, new TGLayoutHints(kLHintsTop, 1, 1, 2, 1));
76 }
77
78 TPCSector3DEditor::~TPCSector3DEditor()
79 {}
80
81 /**************************************************************************/
82
83 void TPCSector3DEditor::SetModel(TObject* obj)
84 {
85   fM = dynamic_cast<TPCSector3D*>(obj);
86
87   fRnrFrame->SetState(fM->fRnrFrame ? kButtonDown : kButtonUp);
88   fDriftVel->SetValue(fM->fDriftVel);
89
90   fPointFrac->SetValue(fM->fPointFrac);
91   fPointSize->SetValue(fM->fPointSize);
92 }
93
94 /**************************************************************************/
95
96 void TPCSector3DEditor::DoRnrFrame()
97 {
98   fM->SetRnrFrame(fRnrFrame->IsOn());
99   Update();
100 }
101
102 void TPCSector3DEditor::DoDriftVel()
103 {
104   fM->SetDriftVel(fDriftVel->GetValue());
105   Update();
106 }
107
108 void TPCSector3DEditor::DoPointFrac()
109 {
110   fM->SetPointFrac(fPointFrac->GetValue());
111   Update();
112 }
113
114 void TPCSector3DEditor::DoPointSize()
115 {
116   fM->SetPointSize(fPointSize->GetValue());
117   Update();
118 }
119