Logo ROOT  
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 "TGedEditor.h"
21 #include "TAttMarkerEditor.h"
22 #include "TGLabel.h"
23 #include "TG3DLine.h"
24 #include "TGButton.h"
25 #include "TGDoubleSlider.h"
26 
27 /** \class TEveTrackEditor
28 \ingroup TEve
29 Editor for TEveTrack class.
30 */
31 
33 
34 ////////////////////////////////////////////////////////////////////////////////
35 /// Constructor.
36 
38  UInt_t options, Pixel_t back) :
39  TGedFrame(p, width, height, options | kVerticalFrame, back),
40  fM(0),
41  fRSEditor(0)
42 {
43  MakeTitle("TEveTrack");
44 
46 
47  fRSEditor = new TGTextButton(f, "Edit Propagator");
48  fRSEditor->Connect("Clicked()", "TEveTrackEditor", this, "DoEditPropagator()");
49  f->AddFrame(fRSEditor, new TGLayoutHints(kLHintsLeft, 2, 1, 4, 4));
50 
51  AddFrame(f, new TGLayoutHints(kLHintsTop, 0,0,2,1));
52 }
53 
54 ////////////////////////////////////////////////////////////////////////////////
55 /// Set model object.
56 
58 {
59  fM = dynamic_cast<TEveTrack*>(obj);
60 }
61 
62 ////////////////////////////////////////////////////////////////////////////////
63 /// Slot for EditPropagator.
64 
66 {
68 }
69 
70 /** \class TEveTrackListEditor
71 \ingroup TEve
72 Editor for TEveTrackList class.
73 */
74 
76 
77 ////////////////////////////////////////////////////////////////////////////////
78 /// Constructor.
79 
81  Int_t width, Int_t height,
82  UInt_t options, Pixel_t back) :
83  TGedFrame(p, width, height, options | kVerticalFrame, back),
84 
85  fTC (0),
86  fPtRange (0),
87  fPRange (0),
88  fRSSubEditor(0)
89 {
90  {
92 
93  fRnrPoints = new TGCheckButton(f, "Draw Marker");
94  f->AddFrame(fRnrPoints, new TGLayoutHints(kLHintsLeft, 2,1,0,0));
95  fRnrPoints->Connect("Toggled(Bool_t)", "TEveTrackListEditor", this, "DoRnrPoints()");
96 
97  fRnrLine = new TGCheckButton(f, "Draw Line");
98  f->AddFrame(fRnrLine, new TGLayoutHints(kLHintsLeft, 1,2,0,0));
99  fRnrLine->Connect("Toggled(Bool_t)", "TEveTrackListEditor", this, "DoRnrLine()");
100 
101  AddFrame(f, new TGLayoutHints(kLHintsTop, 0,0,2,1));
102  }
103  { // --- Selectors
104  Int_t labelW = 51;
105  Int_t dbW = 210;
106 
107  fPtRange = new TEveGDoubleValuator(this,"Pt rng:", 40, 0);
108  fPtRange->SetNELength(6);
109  fPtRange->SetLabelWidth(labelW);
110  fPtRange->Build();
111  fPtRange->GetSlider()->SetWidth(dbW);
113  fPtRange->Connect("ValueSet()",
114  "TEveTrackListEditor", this, "DoPtRange()");
115  AddFrame(fPtRange, new TGLayoutHints(kLHintsTop, 1, 1, 4, 1));
116 
117  fPRange = new TEveGDoubleValuator(this,"P rng:", 40, 0);
118  fPRange->SetNELength(6);
119  fPRange->SetLabelWidth(labelW);
120  fPRange->Build();
121  fPRange->GetSlider()->SetWidth(dbW);
123  fPRange->Connect("ValueSet()",
124  "TEveTrackListEditor", this, "DoPRange()");
125  AddFrame(fPRange, new TGLayoutHints(kLHintsTop, 1, 1, 4, 1));
126  }
127 
128  MakeTitle("RenderStyle");
130  fRSSubEditor->Connect("Changed()", "TEveTrackListEditor", this, "Update()");
132  CreateRefsTab();
133 }
134 
135 ////////////////////////////////////////////////////////////////////////////////
136 /// Create tab for control of path-mark display.
137 
139 {
140  fRefs = CreateEditorTabSubFrame("Refs");
141 
142  TGCompositeFrame *title1 = new TGCompositeFrame(fRefs, 145, 10,
145  kFixedWidth |
147  title1->AddFrame(new TGLabel(title1, "PathMarks"),
148  new TGLayoutHints(kLHintsLeft, 1, 1, 0, 0));
149  title1->AddFrame(new TGHorizontal3DLine(title1),
150  new TGLayoutHints(kLHintsExpandX, 5, 5, 7, 7));
151  fRefs->AddFrame(title1, new TGLayoutHints(kLHintsTop, 0, 0, 2, 0));
152 
153  // path marks
157 }
158 
159 ////////////////////////////////////////////////////////////////////////////////
160 /// Set model object.
161 
163 {
164  fTC = dynamic_cast<TEveTrackList*>(obj);
167 
168  Float_t llim;
170  llim = fTC->fLimPt > 1 ? TMath::Log10(fTC->fLimPt) : 0;
173  llim = fTC->fLimP > 1 ? TMath::Log10(fTC->fLimP) : 0;
175 
177 }
178 
179 ////////////////////////////////////////////////////////////////////////////////
180 /// Slot for RnrLine.
181 
183 {
185  Update();
186 }
187 
188 ////////////////////////////////////////////////////////////////////////////////
189 /// Slot for RnrPoints.
190 
192 {
194  Update();
195 }
196 
197 ////////////////////////////////////////////////////////////////////////////////
198 /// Slot for PtRange.
199 
201 {
203  Update();
204 }
205 
206 ////////////////////////////////////////////////////////////////////////////////
207 /// Slot for PRange.
208 
210 {
212  Update();
213 }
214 
TEveTrackList::fMaxP
Double_t fMaxP
Definition: TEveTrack.h:159
TEveTrackPropagatorSubEditor
Sub-editor for TEveTrackPropagator class.
Definition: TEveTrackPropagatorEditor.h:34
TGWindow
ROOT GUI Window base class.
Definition: TGWindow.h:23
TGCheckButton::SetState
virtual void SetState(EButtonState state, Bool_t emit=kFALSE)
Set check button state.
Definition: TGButton.cxx:1250
kFixedWidth
@ kFixedWidth
Definition: GuiTypes.h:387
TEveTrackListEditor::fPRange
TEveGDoubleValuator * fPRange
Definition: TEveTrackEditor.h:74
TGDoubleSlider.h
TEveTrackPropagatorSubEditor::fFVAtt
TAttMarkerEditor * fFVAtt
Definition: TEveTrackPropagatorEditor.h:66
f
#define f(i)
Definition: RSha256.hxx:104
TGedFrame::CreateEditorTabSubFrame
virtual TGVerticalFrame * CreateEditorTabSubFrame(const char *name)
Create a vertical frame to be used by 'owner' in extra tab 'name'.
Definition: TGedFrame.cxx:122
TEveTrackListEditor
Editor for TEveTrackList class.
Definition: TEveTrackEditor.h:59
TEveTrackPropagatorSubEditor::SetModel
void SetModel(TEveTrackPropagator *m)
Set model object.
Definition: TEveTrackPropagatorEditor.cxx:236
TGHorizontal3DLine
A horizontal 3D line is a line that typically separates a toolbar from the menubar.
Definition: TG3DLine.h:18
TGedEditor::SetModel
virtual void SetModel(TVirtualPad *pad, TObject *obj, Int_t event, Bool_t force=kFALSE)
Activate object editors according to the selected object.
Definition: TGedEditor.cxx:345
TEveTrackList::GetPropagator
TEveTrackPropagator * GetPropagator()
Definition: TEveTrack.h:175
kButtonDown
@ kButtonDown
Definition: TGButton.h:54
kLHintsTop
@ kLHintsTop
Definition: TGLayout.h:27
Pixel_t
ULong_t Pixel_t
Pixel value.
Definition: GuiTypes.h:40
ClassImp
#define ClassImp(name)
Definition: Rtypes.h:364
TGCheckButton::IsOn
virtual Bool_t IsOn() const
Definition: TGButton.h:311
kVerticalFrame
@ kVerticalFrame
Definition: GuiTypes.h:381
TEveTrackList::fMinP
Double_t fMinP
Definition: TEveTrack.h:158
TEveTrack.h
kLHintsLeft
@ kLHintsLeft
Definition: TGLayout.h:24
TEveTrackListEditor::DoRnrPoints
void DoRnrPoints()
Slot for RnrPoints.
Definition: TEveTrackEditor.cxx:191
TEveTrackListEditor::DoRnrLine
void DoRnrLine()
Slot for RnrLine.
Definition: TEveTrackEditor.cxx:182
TGLabel
This class handles GUI labels.
Definition: TGLabel.h:24
TGedEditor.h
kButtonUp
@ kButtonUp
Definition: TGButton.h:53
Float_t
float Float_t
Definition: RtypesCore.h:57
width
include TDocParser_001 C image html pict1_TDocParser_001 png width
Definition: TDocParser.cxx:121
TGTextButton
Yield an action as soon as it is clicked.
Definition: TGButton.h:142
TEveTrackPropagator.h
TEveTrackListEditor::fPtRange
TEveGDoubleValuator * fPtRange
Definition: TEveTrackEditor.h:73
TEveTrackListEditor::DoPRange
void DoPRange()
Slot for PRange.
Definition: TEveTrackEditor.cxx:209
TEveManager::GetEditor
TEveGedEditor * GetEditor() const
Returns main object editor.
Definition: TEveManager.cxx:274
TEveGDoubleValuator::GetMin
Float_t GetMin() const
Definition: TEveGValuators.h:139
TEveTrackList
A list of tracks supporting change of common attributes and selection based on track parameters.
Definition: TEveTrack.h:140
TEveTrackPropagatorEditor.h
TGNumberFormat::kNESRealTwo
@ kNESRealTwo
Fixed fraction real, two digit.
Definition: TGNumberEntry.h:27
TEveTrackEditor::SetModel
virtual void SetModel(TObject *obj)
Set model object.
Definition: TEveTrackEditor.cxx:57
TGHorizontalFrame
A composite frame that layout their children in horizontal way.
Definition: TGFrame.h:386
TGedFrame::SetGedEditor
virtual void SetGedEditor(TGedEditor *ed)
Definition: TGedFrame.h:80
TEveTrackListEditor::SetModel
virtual void SetModel(TObject *obj)
Set model object.
Definition: TEveTrackEditor.cxx:162
TGedFrame::Update
virtual void Update()
Update the current pad when an attribute is changed via GUI.
Definition: TGedFrame.cxx:72
TEveTrackList::fMaxPt
Double_t fMaxPt
Definition: TEveTrack.h:156
TEveTrackList::SelectByPt
void SelectByPt(Double_t min_pt, Double_t max_pt)
Select visibility of tracks by transverse momentum.
Definition: TEveTrack.cxx:995
gEve
R__EXTERN TEveManager * gEve
Definition: TEveManager.h:243
TEveGValuators.h
kOwnBackground
@ kOwnBackground
Definition: GuiTypes.h:391
TEveGDoubleValuator::Build
virtual void Build(Bool_t connect=kTRUE)
Create sub-components (label, number entries, double-slider).
Definition: TEveGValuators.cxx:264
TEveTrackEditor.h
TEveTrackListEditor::TEveTrackListEditor
TEveTrackListEditor(const TEveTrackListEditor &)
TGCheckButton
Selects different options.
Definition: TGButton.h:264
TGedEditor::GetPad
virtual TVirtualPad * GetPad() const
Definition: TGedEditor.h:78
TGNumberFormat::kNESRealOne
@ kNESRealOne
Fixed fraction real, one digit.
Definition: TGNumberEntry.h:26
TG3DLine.h
TEveGDoubleValuator::SetLimits
void SetLimits(Int_t min, Int_t max)
Set limits of the represented range for integer values.
Definition: TEveGValuators.cxx:330
TEveTrackList::SelectByP
void SelectByP(Double_t min_p, Double_t max_p)
Select visibility of tracks by momentum.
Definition: TEveTrack.cxx:1040
TMath::Log10
Double_t Log10(Double_t x)
Definition: TMath.h:764
TEveTrack::GetPropagator
TEveTrackPropagator * GetPropagator() const
Definition: TEveTrack.h:84
TEveTrackList::SetRnrPoints
void SetRnrPoints(Bool_t r)
Set rendering of track as points for the list and the elements.
Definition: TEveTrack.cxx:768
TEveTrackList::GetRnrPoints
Bool_t GetRnrPoints() const
Definition: TEveTrack.h:203
TEveTrackListEditor::fTC
TEveTrackList * fTC
Definition: TEveTrackEditor.h:68
TEveTrackEditor
Editor for TEveTrack class.
Definition: TEveTrackEditor.h:34
TEveTrackList::fMinPt
Double_t fMinPt
Definition: TEveTrack.h:155
TGLayoutHints
This class describes layout hints used by the layout classes.
Definition: TGLayout.h:50
TEveTrackList::GetRnrLine
Bool_t GetRnrLine() const
Definition: TEveTrack.h:199
TEveGDoubleValuator::SetValues
void SetValues(Float_t min, Float_t max, Bool_t emit=kFALSE)
Set min/max values, optionally emit signal.
Definition: TEveGValuators.cxx:394
TEveGValuatorBase::SetNELength
void SetNELength(Int_t l)
Definition: TEveGValuators.h:46
TEveGDoubleValuator
Composite GUI element for selection of range (label, two number-entries and double-slider).
Definition: TEveGValuators.h:109
TEveTrackList::SetRnrLine
void SetRnrLine(Bool_t rnr)
Set rendering of track as line for the list and the elements.
Definition: TEveTrack.cxx:736
TEveGDoubleValuator::GetMax
Float_t GetMax() const
Definition: TEveGValuators.h:140
TGedFrame::MakeTitle
virtual void MakeTitle(const char *title)
Create attribute frame title.
Definition: TGedFrame.cxx:95
TAttMarkerEditor.h
TEveTrackPropagatorSubEditor::CreateRefsContainer
void CreateRefsContainer(TGVerticalFrame *p)
Create a frame containing track-reference controls under parent frame p.
Definition: TEveTrackPropagatorEditor.cxx:102
TEveGDoubleValuator::GetSlider
TGDoubleHSlider * GetSlider()
Definition: TEveGValuators.h:129
TEveTrackList::fLimPt
Double_t fLimPt
Definition: TEveTrack.h:157
TEveTrackListEditor::fRnrLine
TGCheckButton * fRnrLine
Definition: TEveTrackEditor.h:70
unsigned int
TEveTrackList::fLimP
Double_t fLimP
Definition: TEveTrack.h:160
kHorizontalFrame
@ kHorizontalFrame
Definition: GuiTypes.h:382
TEveTrack
Visual representation of a track.
Definition: TEveTrack.h:33
TEveTrackListEditor::fRSSubEditor
TEveTrackPropagatorSubEditor * fRSSubEditor
Definition: TEveTrackEditor.h:76
TGedFrame
Base frame for implementing GUI - a service class.
Definition: TGedFrame.h:27
TGLabel.h
TEveTrackListEditor::CreateRefsTab
void CreateRefsTab()
Create tab for control of path-mark display.
Definition: TEveTrackEditor.cxx:138
TEveManager.h
kButton1Down
@ kButton1Down
Definition: Buttons.h:17
TQObject::Connect
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:869
TGFrame::SetWidth
virtual void SetWidth(UInt_t w)
Definition: TGFrame.h:246
TEveTrackListEditor::fRefs
TGVerticalFrame * fRefs
Definition: TEveTrackEditor.h:66
TEveTrackPropagatorSubEditor::fPMAtt
TAttMarkerEditor * fPMAtt
Definition: TEveTrackPropagatorEditor.h:65
TObject
Mother of all ROOT objects.
Definition: TObject.h:37
TGButton.h
TEveGValuatorBase::SetLabelWidth
void SetLabelWidth(Int_t w)
Definition: TEveGValuators.h:42
TEveTrackListEditor::fRnrPoints
TGCheckButton * fRnrPoints
Definition: TEveTrackEditor.h:71
kLHintsExpandX
@ kLHintsExpandX
Definition: TGLayout.h:30
TEveTrackEditor::fRSEditor
TGTextButton * fRSEditor
Definition: TEveTrackEditor.h:41
TGedFrame::fGedEditor
TGedEditor * fGedEditor
manager of this frame
Definition: TGedFrame.h:48
TGCompositeFrame::TGCompositeFrame
TGCompositeFrame(const TGCompositeFrame &)=delete
TEveTrackEditor::DoEditPropagator
void DoEditPropagator()
Slot for EditPropagator.
Definition: TEveTrackEditor.cxx:65
TGCompositeFrame
The base class for composite widgets (menu bars, list boxes, etc.).
Definition: TGFrame.h:287
TGCompositeFrame::AddFrame
virtual void AddFrame(TGFrame *f, TGLayoutHints *l=0)
Add frame to the composite frame using the specified layout hints.
Definition: TGFrame.cxx:1117
TEveTrackEditor::fM
TEveTrack * fM
Definition: TEveTrackEditor.h:40
TEveTrackEditor::TEveTrackEditor
TEveTrackEditor(const TEveTrackEditor &)
TGedEditor
Definition: TGedEditor.h:31
TGNumberFormat::kNESInteger
@ kNESInteger
Style of number entry field.
Definition: TGNumberEntry.h:25
int
TEveTrackListEditor::DoPtRange
void DoPtRange()
Slot for PtRange.
Definition: TEveTrackEditor.cxx:200