2 // Main authors: Matevz Tadel & Alja Mrak-Tadel: 2006, 2007
4 /**************************************************************************
5 * Copyright(c) 1998-2008, ALICE Experiment at CERN, all rights reserved. *
6 * See http://aliceinfo.cern.ch/Offline/AliRoot/License.html for *
7 * full copyright notice. *
8 **************************************************************************/
10 #include "AliEveTPCSector3DEditor.h"
11 #include <Alieve/AliEveTPCSector3D.h>
13 #include <TEveGValuators.h>
15 #include <TVirtualPad.h>
20 #include <TGNumberEntry.h>
21 #include <TGColorSelect.h>
23 #include <TGDoubleSlider.h>
26 //______________________________________________________________________________
27 // AliEveTPCSector3DEditor
30 ClassImp(AliEveTPCSector3DEditor)
32 AliEveTPCSector3DEditor::AliEveTPCSector3DEditor(const TGWindow *p,
33 Int_t width, Int_t height,
34 UInt_t options, Pixel_t back) :
35 TGedFrame(p, width, height, options | kVerticalFrame, back),
37 fRnrFrame(0), fDriftVel(0), fPointFrac(0), fPointSize(0)
39 MakeTitle("AliEveTPCSector3D");
43 fRnrFrame = new TGCheckButton(this, "ShowFrame");
44 AddFrame(fRnrFrame, new TGLayoutHints(kLHintsTop, 3, 1, 1, 0));
46 ("Toggled(Bool_t)","AliEveTPCSector3DEditor", this, "DoRnrFrame()");
48 fDriftVel = new TEveGValuator(this, "Vdrift fac", 110, 0);
49 fDriftVel->SetLabelWidth(labelW);
50 fDriftVel->SetShowSlider(kFALSE);
51 fDriftVel->SetNELength(6);
53 fDriftVel->SetLimits(0.1, 10, 1, TGNumberFormat::kNESRealThree);
54 fDriftVel->SetToolTip("Drift velocity factor");
55 fDriftVel->Connect("ValueSet(Double_t)",
56 "AliEveTPCSector3DEditor", this, "DoDriftVel()");
57 AddFrame(fDriftVel, new TGLayoutHints(kLHintsTop, 1, 1, 2, 1));
59 fPointFrac = new TEveGValuator(this,"Point frac", 200, 0);
60 fPointFrac->SetLabelWidth(labelW);
61 fPointFrac->SetNELength(4);
63 fPointFrac->GetSlider()->SetWidth(101 + 16);
64 fPointFrac->SetLimits(0.0, 1.0, 101);
65 fPointFrac->SetToolTip("Fraction of signal range displayed as points");
66 fPointFrac->Connect("ValueSet(Double_t)",
67 "AliEveTPCSector3DEditor", this, "DoPointFrac()");
68 AddFrame(fPointFrac, new TGLayoutHints(kLHintsTop, 1, 1, 2, 1));
70 fPointSize = new TEveGValuator(this,"Point size", 200, 0);
71 fPointSize->SetLabelWidth(labelW);
72 fPointSize->SetShowSlider(kFALSE);
73 fPointSize->SetNELength(4);
75 //fPointSize->GetSlider()->SetWidth(101 + 16);
76 fPointSize->SetLimits(0.1, 32.0, 1, TGNumberFormat::kNESRealOne);
77 fPointSize->SetToolTip("Size of displayed points");
78 fPointSize->Connect("ValueSet(Double_t)",
79 "AliEveTPCSector3DEditor", this, "DoPointSize()");
80 AddFrame(fPointSize, new TGLayoutHints(kLHintsTop, 1, 1, 2, 1));
83 AliEveTPCSector3DEditor::~AliEveTPCSector3DEditor()
86 /******************************************************************************/
88 void AliEveTPCSector3DEditor::SetModel(TObject* obj)
90 fM = dynamic_cast<AliEveTPCSector3D*>(obj);
92 fRnrFrame->SetState(fM->fRnrFrame ? kButtonDown : kButtonUp);
93 fDriftVel->SetValue(fM->fDriftVel);
95 fPointFrac->SetValue(fM->fPointFrac);
96 fPointSize->SetValue(fM->fPointSize);
99 /******************************************************************************/
101 void AliEveTPCSector3DEditor::DoRnrFrame()
103 fM->SetRnrFrame(fRnrFrame->IsOn());
107 void AliEveTPCSector3DEditor::DoDriftVel()
109 fM->SetDriftVel(fDriftVel->GetValue());
113 void AliEveTPCSector3DEditor::DoPointFrac()
115 fM->SetPointFrac(fPointFrac->GetValue());
119 void AliEveTPCSector3DEditor::DoPointSize()
121 fM->SetPointSize(fPointSize->GetValue());