3 #include "TPCSector3DEditor.h"
4 #include <Alieve/TPCSector3D.h>
6 #include <Reve/RGValuators.h>
8 #include <TVirtualPad.h>
13 #include <TGNumberEntry.h>
14 #include <TGColorSelect.h>
16 #include <TGDoubleSlider.h>
19 using namespace Alieve;
21 //______________________________________________________________________
25 ClassImp(TPCSector3DEditor)
27 TPCSector3DEditor::TPCSector3DEditor(const TGWindow *p, Int_t id,
28 Int_t width, Int_t height,
29 UInt_t options, Pixel_t back) :
30 TGedFrame(p, id, width, height, options | kVerticalFrame, back),
32 fRnrFrame(0), fDriftVel(0), fPointFrac(0), fPointSize(0)
34 MakeTitle("TPCSector3D");
38 fRnrFrame = new TGCheckButton(this, "ShowFrame");
39 AddFrame(fRnrFrame, new TGLayoutHints(kLHintsTop, 3, 1, 1, 0));
41 ("Toggled(Bool_t)","Alieve::TPCSector3DEditor", this, "DoRnrFrame()");
43 fDriftVel = new RGValuator(this, "Vdrift fac", 110, 0);
44 fDriftVel->SetLabelWidth(labelW);
45 fDriftVel->SetShowSlider(kFALSE);
46 fDriftVel->SetNELength(6);
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));
54 fPointFrac = new RGValuator(this,"Point frac", 200, 0);
55 fPointFrac->SetLabelWidth(labelW);
56 fPointFrac->SetNELength(4);
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));
65 fPointSize = new RGValuator(this,"Point size", 200, 0);
66 fPointSize->SetLabelWidth(labelW);
67 fPointSize->SetShowSlider(kFALSE);
68 fPointSize->SetNELength(4);
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));
77 // Register the editor.
78 TClass *cl = TPCSector3D::Class();
79 TGedElement *ge = new TGedElement;
82 cl->GetEditorList()->Add(ge);
85 TPCSector3DEditor::~TPCSector3DEditor()
88 /**************************************************************************/
90 void TPCSector3DEditor::SetModel(TVirtualPad* pad, TObject* obj, Int_t /*event*/)
95 if (!obj || !obj->InheritsFrom(TPCSector3D::Class()) || obj->InheritsFrom(TVirtualPad::Class())) {
103 fM = dynamic_cast<TPCSector3D*>(fModel);
105 fRnrFrame->SetState(fM->fRnrFrame ? kButtonDown : kButtonUp);
106 fDriftVel->SetValue(fM->fDriftVel);
108 fPointFrac->SetValue(fM->fPointFrac);
109 fPointSize->SetValue(fM->fPointSize);
114 /**************************************************************************/
116 void TPCSector3DEditor::DoRnrFrame()
118 fM->SetRnrFrame(fRnrFrame->IsOn());
122 void TPCSector3DEditor::DoDriftVel()
124 fM->SetDriftVel(fDriftVel->GetValue());
128 void TPCSector3DEditor::DoPointFrac()
130 fM->SetPointFrac(fPointFrac->GetValue());
134 void TPCSector3DEditor::DoPointSize()
136 fM->SetPointSize(fPointSize->GetValue());