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
29Editor 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
72Editor 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);
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);
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()");
133}
134
135////////////////////////////////////////////////////////////////////////////////
136/// Create tab for control of path-mark display.
137
139{
141
142 TGCompositeFrame *title1 = new TGCompositeFrame(fRefs, 145, 10,
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
@ kButton1Down
Definition: Buttons.h:17
@ kVerticalFrame
Definition: GuiTypes.h:381
@ kFixedWidth
Definition: GuiTypes.h:387
@ kHorizontalFrame
Definition: GuiTypes.h:382
@ kOwnBackground
Definition: GuiTypes.h:391
ULong_t Pixel_t
Pixel value.
Definition: GuiTypes.h:40
#define f(i)
Definition: RSha256.hxx:104
int Int_t
Definition: RtypesCore.h:45
unsigned int UInt_t
Definition: RtypesCore.h:46
float Float_t
Definition: RtypesCore.h:57
#define ClassImp(name)
Definition: Rtypes.h:364
include TDocParser_001 C image html pict1_TDocParser_001 png width
Definition: TDocParser.cxx:121
R__EXTERN TEveManager * gEve
Definition: TEveManager.h:243
@ kButtonDown
Definition: TGButton.h:54
@ kButtonUp
Definition: TGButton.h:53
@ kLHintsLeft
Definition: TGLayout.h:24
@ kLHintsTop
Definition: TGLayout.h:27
@ kLHintsExpandX
Definition: TGLayout.h:30
Composite GUI element for selection of range (label, two number-entries and double-slider).
Float_t GetMin() const
TGDoubleHSlider * GetSlider()
void SetLimits(Int_t min, Int_t max)
Set limits of the represented range for integer values.
Float_t GetMax() const
virtual void Build(Bool_t connect=kTRUE)
Create sub-components (label, number entries, double-slider).
void SetValues(Float_t min, Float_t max, Bool_t emit=kFALSE)
Set min/max values, optionally emit signal.
void SetLabelWidth(Int_t w)
void SetNELength(Int_t l)
TEveGedEditor * GetEditor() const
Returns main object editor.
Editor for TEveTrack class.
void DoEditPropagator()
Slot for EditPropagator.
virtual void SetModel(TObject *obj)
Set model object.
TEveTrackEditor(const TEveTrackEditor &)
TGTextButton * fRSEditor
TEveTrack * fM
Editor for TEveTrackList class.
void CreateRefsTab()
Create tab for control of path-mark display.
TEveTrackListEditor(const TEveTrackListEditor &)
void DoRnrPoints()
Slot for RnrPoints.
TEveGDoubleValuator * fPtRange
TGCheckButton * fRnrPoints
TGVerticalFrame * fRefs
TGCheckButton * fRnrLine
virtual void SetModel(TObject *obj)
Set model object.
TEveGDoubleValuator * fPRange
TEveTrackPropagatorSubEditor * fRSSubEditor
void DoRnrLine()
Slot for RnrLine.
void DoPRange()
Slot for PRange.
TEveTrackList * fTC
void DoPtRange()
Slot for PtRange.
A list of tracks supporting change of common attributes and selection based on track parameters.
Definition: TEveTrack.h:140
Double_t fMinPt
Definition: TEveTrack.h:155
void SelectByP(Double_t min_p, Double_t max_p)
Select visibility of tracks by momentum.
Definition: TEveTrack.cxx:1040
void SetRnrPoints(Bool_t r)
Set rendering of track as points for the list and the elements.
Definition: TEveTrack.cxx:768
Double_t fMaxPt
Definition: TEveTrack.h:156
Bool_t GetRnrLine() const
Definition: TEveTrack.h:199
Double_t fMaxP
Definition: TEveTrack.h:159
Bool_t GetRnrPoints() const
Definition: TEveTrack.h:203
void SelectByPt(Double_t min_pt, Double_t max_pt)
Select visibility of tracks by transverse momentum.
Definition: TEveTrack.cxx:995
Double_t fLimP
Definition: TEveTrack.h:160
Double_t fLimPt
Definition: TEveTrack.h:157
TEveTrackPropagator * GetPropagator()
Definition: TEveTrack.h:175
Double_t fMinP
Definition: TEveTrack.h:158
void SetRnrLine(Bool_t rnr)
Set rendering of track as line for the list and the elements.
Definition: TEveTrack.cxx:736
Sub-editor for TEveTrackPropagator class.
void SetModel(TEveTrackPropagator *m)
Set model object.
void CreateRefsContainer(TGVerticalFrame *p)
Create a frame containing track-reference controls under parent frame p.
Visual representation of a track.
Definition: TEveTrack.h:33
TEveTrackPropagator * GetPropagator() const
Definition: TEveTrack.h:84
Selects different options.
Definition: TGButton.h:264
virtual Bool_t IsOn() const
Definition: TGButton.h:311
virtual void SetState(EButtonState state, Bool_t emit=kFALSE)
Set check button state.
Definition: TGButton.cxx:1250
The base class for composite widgets (menu bars, list boxes, etc.).
Definition: TGFrame.h:287
virtual void AddFrame(TGFrame *f, TGLayoutHints *l=0)
Add frame to the composite frame using the specified layout hints.
Definition: TGFrame.cxx:1117
TGCompositeFrame(const TGCompositeFrame &)=delete
virtual void SetWidth(UInt_t w)
Definition: TGFrame.h:246
A horizontal 3D line is a line that typically separates a toolbar from the menubar.
Definition: TG3DLine.h:18
A composite frame that layout their children in horizontal way.
Definition: TGFrame.h:386
This class handles GUI labels.
Definition: TGLabel.h:24
This class describes layout hints used by the layout classes.
Definition: TGLayout.h:50
@ kNESRealOne
Fixed fraction real, one digit.
Definition: TGNumberEntry.h:26
@ kNESInteger
Style of number entry field.
Definition: TGNumberEntry.h:25
@ kNESRealTwo
Fixed fraction real, two digit.
Definition: TGNumberEntry.h:27
Yield an action as soon as it is clicked.
Definition: TGButton.h:142
ROOT GUI Window base class.
Definition: TGWindow.h:23
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
virtual TVirtualPad * GetPad() const
Definition: TGedEditor.h:78
Base frame for implementing GUI - a service class.
Definition: TGedFrame.h:27
virtual void SetGedEditor(TGedEditor *ed)
Definition: TGedFrame.h:80
TGedEditor * fGedEditor
manager of this frame
Definition: TGedFrame.h:48
virtual TGVerticalFrame * CreateEditorTabSubFrame(const char *name)
Create a vertical frame to be used by 'owner' in extra tab 'name'.
Definition: TGedFrame.cxx:122
virtual void MakeTitle(const char *title)
Create attribute frame title.
Definition: TGedFrame.cxx:95
virtual void Update()
Update the current pad when an attribute is changed via GUI.
Definition: TGedFrame.cxx:72
Mother of all ROOT objects.
Definition: TObject.h:37
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
Double_t Log10(Double_t x)
Definition: TMath.h:714