Logo ROOT   6.08/07
Reference Guide
TEveTrackEditor.cxx
Go to the documentation of this file.
1 // @(#)root/eve:$Id$
2 // Authors: Matevz Tadel & Alja Mrak-Tadel: 2006, 2007
3 
4 /*************************************************************************
5  * Copyright (C) 1995-2007, Rene Brun and Fons Rademakers. *
6  * All rights reserved. *
7  * *
8  * For the licensing terms see $ROOTSYS/LICENSE. *
9  * For the list of contributors see $ROOTSYS/README/CREDITS. *
10  *************************************************************************/
11 
12 #include "TEveTrackEditor.h"
13 #include "TEveTrack.h"
14 #include "TEveTrackPropagator.h"
16 #include "TEveManager.h"
17 
18 #include "TEveGValuators.h"
19 
20 #include "TVirtualPad.h"
21 #include "TColor.h"
22 
23 #include "TGedEditor.h"
24 #include "TAttMarkerEditor.h"
25 #include "TGLabel.h"
26 #include "TG3DLine.h"
27 #include "TGButton.h"
28 #include "TGNumberEntry.h"
29 #include "TGColorSelect.h"
30 #include "TGDoubleSlider.h"
31 
32 /** \class TEveTrackEditor
33 \ingroup TEve
34 Editor for TEveTrack class.
35 */
36 
38 
39 ////////////////////////////////////////////////////////////////////////////////
40 /// Constructor.
41 
43  UInt_t options, Pixel_t back) :
44  TGedFrame(p, width, height, options | kVerticalFrame, back),
45  fM(0),
46  fRSEditor(0)
47 {
48  MakeTitle("TEveTrack");
49 
51 
52  fRSEditor = new TGTextButton(f, "Edit Propagator");
53  fRSEditor->Connect("Clicked()", "TEveTrackEditor", this, "DoEditPropagator()");
54  f->AddFrame(fRSEditor, new TGLayoutHints(kLHintsLeft, 2, 1, 4, 4));
55 
56  AddFrame(f, new TGLayoutHints(kLHintsTop, 0,0,2,1));
57 }
58 
59 ////////////////////////////////////////////////////////////////////////////////
60 /// Set model object.
61 
63 {
64  fM = dynamic_cast<TEveTrack*>(obj);
65 }
66 
67 ////////////////////////////////////////////////////////////////////////////////
68 /// Slot for EditPropagator.
69 
71 {
73 }
74 
75 /** \class TEveTrackListEditor
76 \ingroup TEve
77 Editor for TEveTrackList class.
78 */
79 
81 
82 ////////////////////////////////////////////////////////////////////////////////
83 /// Constructor.
84 
86  Int_t width, Int_t height,
87  UInt_t options, Pixel_t back) :
88  TGedFrame(p, width, height, options | kVerticalFrame, back),
89 
90  fTC (0),
91  fPtRange (0),
92  fPRange (0),
93  fRSSubEditor(0)
94 {
95  {
97 
98  fRnrPoints = new TGCheckButton(f, "Draw Marker");
99  f->AddFrame(fRnrPoints, new TGLayoutHints(kLHintsLeft, 2,1,0,0));
100  fRnrPoints->Connect("Toggled(Bool_t)", "TEveTrackListEditor", this, "DoRnrPoints()");
101 
102  fRnrLine = new TGCheckButton(f, "Draw Line");
103  f->AddFrame(fRnrLine, new TGLayoutHints(kLHintsLeft, 1,2,0,0));
104  fRnrLine->Connect("Toggled(Bool_t)", "TEveTrackListEditor", this, "DoRnrLine()");
105 
106  AddFrame(f, new TGLayoutHints(kLHintsTop, 0,0,2,1));
107  }
108  { // --- Selectors
109  Int_t labelW = 51;
110  Int_t dbW = 210;
111 
112  fPtRange = new TEveGDoubleValuator(this,"Pt rng:", 40, 0);
113  fPtRange->SetNELength(6);
114  fPtRange->SetLabelWidth(labelW);
115  fPtRange->Build();
116  fPtRange->GetSlider()->SetWidth(dbW);
118  fPtRange->Connect("ValueSet()",
119  "TEveTrackListEditor", this, "DoPtRange()");
120  AddFrame(fPtRange, new TGLayoutHints(kLHintsTop, 1, 1, 4, 1));
121 
122  fPRange = new TEveGDoubleValuator(this,"P rng:", 40, 0);
123  fPRange->SetNELength(6);
124  fPRange->SetLabelWidth(labelW);
125  fPRange->Build();
126  fPRange->GetSlider()->SetWidth(dbW);
128  fPRange->Connect("ValueSet()",
129  "TEveTrackListEditor", this, "DoPRange()");
130  AddFrame(fPRange, new TGLayoutHints(kLHintsTop, 1, 1, 4, 1));
131  }
132 
133  MakeTitle("RenderStyle");
135  fRSSubEditor->Connect("Changed()", "TEveTrackListEditor", this, "Update()");
137  CreateRefsTab();
138 }
139 
140 ////////////////////////////////////////////////////////////////////////////////
141 /// Create tab for control of path-mark display.
142 
144 {
145  fRefs = CreateEditorTabSubFrame("Refs");
146 
147  TGCompositeFrame *title1 = new TGCompositeFrame(fRefs, 145, 10,
150  kFixedWidth |
152  title1->AddFrame(new TGLabel(title1, "PathMarks"),
153  new TGLayoutHints(kLHintsLeft, 1, 1, 0, 0));
154  title1->AddFrame(new TGHorizontal3DLine(title1),
155  new TGLayoutHints(kLHintsExpandX, 5, 5, 7, 7));
156  fRefs->AddFrame(title1, new TGLayoutHints(kLHintsTop, 0, 0, 2, 0));
157 
158  // path marks
162 }
163 
164 ////////////////////////////////////////////////////////////////////////////////
165 /// Set model object.
166 
168 {
169  fTC = dynamic_cast<TEveTrackList*>(obj);
172 
173  Float_t llim;
175  llim = fTC->fLimPt > 1 ? TMath::Log10(fTC->fLimPt) : 0;
178  llim = fTC->fLimP > 1 ? TMath::Log10(fTC->fLimP) : 0;
179  fPRange ->SetLimits(0, fTC->fLimP, llim < 2 ? TGNumberFormat::kNESRealTwo : (llim < 3 ? TGNumberFormat::kNESRealOne : TGNumberFormat::kNESInteger));
180 
182 }
183 
184 ////////////////////////////////////////////////////////////////////////////////
185 /// Slot for RnrLine.
186 
188 {
190  Update();
191 }
192 
193 ////////////////////////////////////////////////////////////////////////////////
194 /// Slot for RnrPoints.
195 
197 {
199  Update();
200 }
201 
202 ////////////////////////////////////////////////////////////////////////////////
203 /// Slot for PtRange.
204 
206 {
208  Update();
209 }
210 
211 ////////////////////////////////////////////////////////////////////////////////
212 /// Slot for PRange.
213 
215 {
217  Update();
218 }
219 
Double_t fLimP
Definition: TEveTrack.h:160
void DoPRange()
Slot for PRange.
void SetRnrPoints(Bool_t r)
Set rendering of track as points for the list and the elements.
Definition: TEveTrack.cxx:770
void DoRnrLine()
Slot for RnrLine.
virtual TVirtualPad * GetPad() const
Definition: TGedEditor.h:97
virtual void SetModel(TObject *obj)
Set model object.
Bool_t GetRnrLine() const
Definition: TEveTrack.h:199
void CreateRefsContainer(TGVerticalFrame *p)
Create a frame containing track-reference controls under parent frame p.
float Float_t
Definition: RtypesCore.h:53
void SetRnrLine(Bool_t rnr)
Set rendering of track as line for the list and the elements.
Definition: TEveTrack.cxx:738
void DoRnrPoints()
Slot for RnrPoints.
TEveTrack * fM
void SetLimits(Int_t min, Int_t max)
Set limits of the represented range for integer values.
int Int_t
Definition: RtypesCore.h:41
virtual void SetModel(TVirtualPad *pad, TObject *obj, Int_t event)
Activate object editors according to the selected object.
Definition: TGedEditor.cxx:349
TGTextButton * fRSEditor
TGDoubleHSlider * GetSlider()
Double_t fMaxP
Definition: TEveTrack.h:159
void DoPtRange()
Slot for PtRange.
Double_t fLimPt
Definition: TEveTrack.h:157
void SelectByP(Double_t min_p, Double_t max_p)
Select visibility of tracks by momentum.
Definition: TEveTrack.cxx:1042
ULong_t Pixel_t
Definition: GuiTypes.h:41
TEveTrackEditor(const TEveTrackEditor &)
TEveTrackPropagatorSubEditor * fRSSubEditor
TEveGDoubleValuator * fPtRange
Double_t Log10(Double_t x)
Definition: TMath.h:529
A list of tracks supporting change of common attributes and selection based on track parameters...
Definition: TEveTrack.h:137
virtual void Update()
Update the current pad when an attribute is changed via GUI.
Definition: TGedFrame.cxx:73
TGCompositeFrame(const TGCompositeFrame &)
Float_t GetMax() const
virtual TGVerticalFrame * CreateEditorTabSubFrame(const char *name)
Create a vertical frame to be used by &#39;owner&#39; in extra tab &#39;name&#39;.
Definition: TGedFrame.cxx:123
Editor for TEveTrackList class.
virtual Bool_t IsOn() const
Definition: TGButton.h:315
Bool_t GetRnrPoints() const
Definition: TEveTrack.h:203
Double_t fMinPt
Definition: TEveTrack.h:155
Double_t fMaxPt
Definition: TEveTrack.h:156
TGVerticalFrame * fRefs
TEveGDoubleValuator * fPRange
Bool_t Connect(const char *signal, const char *receiver_class, void *receiver, const char *slot)
Non-static method is used to connect from the signal of this object to the receiver slot...
Definition: TQObject.cxx:1137
Editor for TEveTrack class.
void SetModel(TEveTrackPropagator *m)
Set model object.
void SetNELength(Int_t l)
R__EXTERN TEveManager * gEve
Definition: TEveManager.h:243
TEveGedEditor * GetEditor() const
Returns main object editor.
unsigned int UInt_t
Definition: RtypesCore.h:42
TEveTrackPropagator * GetPropagator()
Definition: TEveTrack.h:175
Visual representation of a track.
Definition: TEveTrack.h:32
TEveTrackPropagator * GetPropagator() const
Definition: TEveTrack.h:84
void SelectByPt(Double_t min_pt, Double_t max_pt)
Select visibility of tracks by transverse momentum.
Definition: TEveTrack.cxx:997
Double_t fMinP
Definition: TEveTrack.h:158
void SetValues(Float_t min, Float_t max, Bool_t emit=kFALSE)
Set min/max values, optionally emit signal.
void CreateRefsTab()
Create tab for control of path-mark display.
virtual void SetWidth(UInt_t w)
Definition: TGFrame.h:309
#define ClassImp(name)
Definition: Rtypes.h:279
virtual void Build(Bool_t connect=kTRUE)
Create sub-components (label, number entries, double-slider).
double f(double x)
TGCheckButton * fRnrPoints
TGCheckButton * fRnrLine
TEveTrackList * fTC
virtual void AddFrame(TGFrame *f, TGLayoutHints *l=0)
Add frame to the composite frame using the specified layout hints.
Definition: TGFrame.cxx:1099
Float_t GetMin() const
Mother of all ROOT objects.
Definition: TObject.h:37
TEveTrackListEditor(const TEveTrackListEditor &)
virtual void SetModel(TObject *obj)
Set model object.
Sub-editor for TEveTrackPropagator class.
void DoEditPropagator()
Slot for EditPropagator.
void SetLabelWidth(Int_t w)
Composite GUI element for selection of range (label, two number-entries and double-slider).
virtual void SetState(EButtonState state, Bool_t emit=kFALSE)
Set check button state.
Definition: TGButton.cxx:1200
TGedEditor * fGedEditor
Definition: TGedFrame.h:56
virtual void MakeTitle(const char *title)
Create attribute frame title.
Definition: TGedFrame.cxx:96
virtual void SetGedEditor(TGedEditor *ed)
Definition: TGedFrame.h:88