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 <EveDet/AliEveTPCSector3D.h>
13 #include <TEveGValuators.h>
15 #include <TVirtualPad.h>
20 #include <TGNumberEntry.h>
21 #include <TGColorSelect.h>
23 #include <TGDoubleSlider.h>
26 //______________________________________________________________________________
28 // Editor for AliEveTPCSector3D.
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)
41 MakeTitle("AliEveTPCSector3D");
45 fRnrFrame = new TGCheckButton(this, "ShowFrame");
46 AddFrame(fRnrFrame, new TGLayoutHints(kLHintsTop, 3, 1, 1, 0));
48 ("Toggled(Bool_t)","AliEveTPCSector3DEditor", this, "DoRnrFrame()");
50 fDriftVel = new TEveGValuator(this, "Vdrift fac", 110, 0);
51 fDriftVel->SetLabelWidth(labelW);
52 fDriftVel->SetShowSlider(kFALSE);
53 fDriftVel->SetNELength(6);
55 fDriftVel->SetLimits(0.1, 10, 1, TGNumberFormat::kNESRealThree);
56 fDriftVel->SetToolTip("Drift velocity factor");
57 fDriftVel->Connect("ValueSet(Double_t)",
58 "AliEveTPCSector3DEditor", this, "DoDriftVel()");
59 AddFrame(fDriftVel, new TGLayoutHints(kLHintsTop, 1, 1, 2, 1));
61 fPointFrac = new TEveGValuator(this,"Point frac", 200, 0);
62 fPointFrac->SetLabelWidth(labelW);
63 fPointFrac->SetNELength(4);
65 fPointFrac->GetSlider()->SetWidth(101 + 16);
66 fPointFrac->SetLimits(0.0, 1.0, 101);
67 fPointFrac->SetToolTip("Fraction of signal range displayed as points");
68 fPointFrac->Connect("ValueSet(Double_t)",
69 "AliEveTPCSector3DEditor", this, "DoPointFrac()");
70 AddFrame(fPointFrac, new TGLayoutHints(kLHintsTop, 1, 1, 2, 1));
72 fPointSize = new TEveGValuator(this,"Point size", 200, 0);
73 fPointSize->SetLabelWidth(labelW);
74 fPointSize->SetShowSlider(kFALSE);
75 fPointSize->SetNELength(4);
77 //fPointSize->GetSlider()->SetWidth(101 + 16);
78 fPointSize->SetLimits(0.1, 32.0, 1, TGNumberFormat::kNESRealOne);
79 fPointSize->SetToolTip("Size of displayed points");
80 fPointSize->Connect("ValueSet(Double_t)",
81 "AliEveTPCSector3DEditor", this, "DoPointSize()");
82 AddFrame(fPointSize, new TGLayoutHints(kLHintsTop, 1, 1, 2, 1));
85 /******************************************************************************/
87 void AliEveTPCSector3DEditor::SetModel(TObject* obj)
91 fM = dynamic_cast<AliEveTPCSector3D*>(obj);
93 fRnrFrame->SetState(fM->fRnrFrame ? kButtonDown : kButtonUp);
94 fDriftVel->SetValue(fM->fDriftVel);
96 fPointFrac->SetValue(fM->fPointFrac);
97 fPointSize->SetValue(fM->fPointSize);
100 /******************************************************************************/
102 void AliEveTPCSector3DEditor::DoRnrFrame()
104 // Slot for RnrFrame.
106 fM->SetRnrFrame(fRnrFrame->IsOn());
110 void AliEveTPCSector3DEditor::DoDriftVel()
112 // Slot for DriftVel.
114 fM->SetDriftVel(fDriftVel->GetValue());
118 void AliEveTPCSector3DEditor::DoPointFrac()
120 // Slot for PointFrac.
122 fM->SetPointFrac(fPointFrac->GetValue());
126 void AliEveTPCSector3DEditor::DoPointSize()
128 // Slot for PointSize.
130 fM->SetPointSize(fPointSize->GetValue());