X-Git-Url: http://git.uio.no/git/?a=blobdiff_plain;f=EVE%2FAlieve%2FTPCSector3DEditor.cxx;h=580aea7723b38849011aa43563bf75885895c8ff;hb=72da5d8cd19b83e459c83bd6ea73587c33a178db;hp=508084fbbadfac2a0f53508d8448971aa98bc176;hpb=092578a72f170a403728f2968a2888e55609d579;p=u%2Fmrichter%2FAliRoot.git diff --git a/EVE/Alieve/TPCSector3DEditor.cxx b/EVE/Alieve/TPCSector3DEditor.cxx index 508084fbbad..580aea7723b 100644 --- a/EVE/Alieve/TPCSector3DEditor.cxx +++ b/EVE/Alieve/TPCSector3DEditor.cxx @@ -3,6 +3,8 @@ #include "TPCSector3DEditor.h" #include +#include + #include #include @@ -22,38 +24,55 @@ using namespace Alieve; ClassImp(TPCSector3DEditor) -TPCSector3DEditor::TPCSector3DEditor(const TGWindow *p, Int_t id, Int_t width, Int_t height, +TPCSector3DEditor::TPCSector3DEditor(const TGWindow *p, + Int_t width, Int_t height, UInt_t options, Pixel_t back) : - TGedFrame(p, id, width, height, options | kVerticalFrame, back) + TGedFrame(p, width, height, options | kVerticalFrame, back), + fM(0), + fRnrFrame(0), fDriftVel(0), fPointFrac(0), fPointSize(0) { - fM = 0; MakeTitle("TPCSector3D"); + Int_t labelW = 60; + fRnrFrame = new TGCheckButton(this, "ShowFrame"); AddFrame(fRnrFrame, new TGLayoutHints(kLHintsTop, 3, 1, 1, 0)); fRnrFrame->Connect ("Toggled(Bool_t)","Alieve::TPCSector3DEditor", this, "DoRnrFrame()"); - { - TGHorizontalFrame* f = new TGHorizontalFrame(this); - TGLabel *l = new TGLabel(f, "Drift Velocity factor:"); - f->AddFrame(l, new TGLayoutHints(kLHintsLeft | kLHintsCenterY, 25, 2, 1, 1)); - fDriftVel = new TGNumberEntry(f, 0., 6, -1, - TGNumberFormat::kNESRealOne, TGNumberFormat::kNEAPositive, - TGNumberFormat::kNELLimitMinMax, 0.001, 1000.0); - fDriftVel->GetNumberEntry()->SetToolTipText("Drift velocity factor."); - f->AddFrame(fDriftVel, new TGLayoutHints(kLHintsLeft, 1, 1, 1, 1)); - fDriftVel->Associate(f); - fDriftVel->Connect("ValueSet(Long_t)", "Alieve::TPCSector3DEditor", this, "DoDriftVel()"); - AddFrame(f, new TGLayoutHints(kLHintsTop, 1, 1, 1, 1)); - } - - // Register the editor. - TClass *cl = TPCSector3D::Class(); - TGedElement *ge = new TGedElement; - ge->fGedFrame = this; - ge->fCanvas = 0; - cl->GetEditorList()->Add(ge); + fDriftVel = new RGValuator(this, "Vdrift fac", 110, 0); + fDriftVel->SetLabelWidth(labelW); + fDriftVel->SetShowSlider(kFALSE); + fDriftVel->SetNELength(6); + fDriftVel->Build(); + fDriftVel->SetLimits(0.1, 10, 1, TGNumberFormat::kNESRealThree); + fDriftVel->SetToolTip("Drift velocity factor"); + fDriftVel->Connect("ValueSet(Double_t)", + "Alieve::TPCSector3DEditor", this, "DoDriftVel()"); + AddFrame(fDriftVel, new TGLayoutHints(kLHintsTop, 1, 1, 2, 1)); + + fPointFrac = new RGValuator(this,"Point frac", 200, 0); + fPointFrac->SetLabelWidth(labelW); + fPointFrac->SetNELength(4); + fPointFrac->Build(); + fPointFrac->GetSlider()->SetWidth(101 + 16); + fPointFrac->SetLimits(0.0, 1.0, 101); + fPointFrac->SetToolTip("Fraction of signal range displayed as points"); + fPointFrac->Connect("ValueSet(Double_t)", + "Alieve::TPCSector3DEditor", this, "DoPointFrac()"); + AddFrame(fPointFrac, new TGLayoutHints(kLHintsTop, 1, 1, 2, 1)); + + fPointSize = new RGValuator(this,"Point size", 200, 0); + fPointSize->SetLabelWidth(labelW); + fPointSize->SetShowSlider(kFALSE); + fPointSize->SetNELength(4); + fPointSize->Build(); + //fPointSize->GetSlider()->SetWidth(101 + 16); + fPointSize->SetLimits(0.1, 32.0, 1, TGNumberFormat::kNESRealOne); + fPointSize->SetToolTip("Size of displayed points"); + fPointSize->Connect("ValueSet(Double_t)", + "Alieve::TPCSector3DEditor", this, "DoPointSize()"); + AddFrame(fPointSize, new TGLayoutHints(kLHintsTop, 1, 1, 2, 1)); } TPCSector3DEditor::~TPCSector3DEditor() @@ -61,25 +80,15 @@ TPCSector3DEditor::~TPCSector3DEditor() /**************************************************************************/ -void TPCSector3DEditor::SetModel(TVirtualPad* pad, TObject* obj, Int_t /*event*/) +void TPCSector3DEditor::SetModel(TObject* obj) { - fModel = 0; - fPad = 0; - - if (!obj || !obj->InheritsFrom(TPCSector3D::Class()) || obj->InheritsFrom(TVirtualPad::Class())) { - SetActive(kFALSE); - return; - } - - fModel = obj; - fPad = pad; - - fM = dynamic_cast(fModel); + fM = dynamic_cast(obj); fRnrFrame->SetState(fM->fRnrFrame ? kButtonDown : kButtonUp); - fDriftVel->SetNumber(fM->fDriftVel); + fDriftVel->SetValue(fM->fDriftVel); - SetActive(); + fPointFrac->SetValue(fM->fPointFrac); + fPointSize->SetValue(fM->fPointSize); } /**************************************************************************/ @@ -92,6 +101,19 @@ void TPCSector3DEditor::DoRnrFrame() void TPCSector3DEditor::DoDriftVel() { - fM->SetDriftVel((Float_t) fDriftVel->GetNumber()); + fM->SetDriftVel(fDriftVel->GetValue()); + Update(); +} + +void TPCSector3DEditor::DoPointFrac() +{ + fM->SetPointFrac(fPointFrac->GetValue()); Update(); } + +void TPCSector3DEditor::DoPointSize() +{ + fM->SetPointSize(fPointSize->GetValue()); + Update(); +} +