]>
Commit | Line | Data |
---|---|---|
092578a7 | 1 | // $Header$ |
2 | ||
3 | #include "TPCSector3DEditor.h" | |
4 | #include <Alieve/TPCSector3D.h> | |
5 | ||
e2bf98a4 | 6 | #include <Reve/RGValuators.h> |
7 | ||
092578a7 | 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 | ||
a8600b56 | 27 | TPCSector3DEditor::TPCSector3DEditor(const TGWindow *p, |
265ecb21 | 28 | Int_t width, Int_t height, |
092578a7 | 29 | UInt_t options, Pixel_t back) : |
a8600b56 | 30 | TGedFrame(p, width, height, options | kVerticalFrame, back), |
265ecb21 | 31 | fM(0), |
32 | fRnrFrame(0), fDriftVel(0), fPointFrac(0), fPointSize(0) | |
092578a7 | 33 | { |
092578a7 | 34 | MakeTitle("TPCSector3D"); |
35 | ||
e2bf98a4 | 36 | Int_t labelW = 60; |
37 | ||
092578a7 | 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 | ||
e2bf98a4 | 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)); | |
092578a7 | 64 | |
8a08431f | 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)); | |
092578a7 | 76 | } |
77 | ||
78 | TPCSector3DEditor::~TPCSector3DEditor() | |
79 | {} | |
80 | ||
81 | /**************************************************************************/ | |
82 | ||
a8600b56 | 83 | void TPCSector3DEditor::SetModel(TObject* obj) |
092578a7 | 84 | { |
a8600b56 | 85 | fM = dynamic_cast<TPCSector3D*>(obj); |
092578a7 | 86 | |
87 | fRnrFrame->SetState(fM->fRnrFrame ? kButtonDown : kButtonUp); | |
e2bf98a4 | 88 | fDriftVel->SetValue(fM->fDriftVel); |
89 | ||
90 | fPointFrac->SetValue(fM->fPointFrac); | |
8a08431f | 91 | fPointSize->SetValue(fM->fPointSize); |
092578a7 | 92 | } |
93 | ||
94 | /**************************************************************************/ | |
95 | ||
96 | void TPCSector3DEditor::DoRnrFrame() | |
97 | { | |
98 | fM->SetRnrFrame(fRnrFrame->IsOn()); | |
99 | Update(); | |
100 | } | |
101 | ||
102 | void TPCSector3DEditor::DoDriftVel() | |
103 | { | |
e2bf98a4 | 104 | fM->SetDriftVel(fDriftVel->GetValue()); |
092578a7 | 105 | Update(); |
106 | } | |
e2bf98a4 | 107 | |
108 | void TPCSector3DEditor::DoPointFrac() | |
109 | { | |
110 | fM->SetPointFrac(fPointFrac->GetValue()); | |
111 | Update(); | |
112 | } | |
113 | ||
8a08431f | 114 | void TPCSector3DEditor::DoPointSize() |
115 | { | |
116 | fM->SetPointSize(fPointSize->GetValue()); | |
117 | Update(); | |
118 | } | |
119 |