Logo ROOT   6.18/05
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
34Editor 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
77Editor 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);
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);
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()");
138}
139
140////////////////////////////////////////////////////////////////////////////////
141/// Create tab for control of path-mark display.
142
144{
146
147 TGCompositeFrame *title1 = new TGCompositeFrame(fRefs, 145, 10,
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;
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
@ kButton1Down
Definition: Buttons.h:17
ULong_t Pixel_t
Definition: GuiTypes.h:39
#define f(i)
Definition: RSha256.hxx:104
int Int_t
Definition: RtypesCore.h:41
unsigned int UInt_t
Definition: RtypesCore.h:42
float Float_t
Definition: RtypesCore.h:53
#define ClassImp(name)
Definition: Rtypes.h:365
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
@ kVerticalFrame
Definition: TGFrame.h:59
@ kFixedWidth
Definition: TGFrame.h:65
@ kHorizontalFrame
Definition: TGFrame.h:60
@ kOwnBackground
Definition: TGFrame.h:69
@ kLHintsLeft
Definition: TGLayout.h:31
@ kLHintsTop
Definition: TGLayout.h:34
@ kLHintsExpandX
Definition: TGLayout.h:37
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:1044
void SetRnrPoints(Bool_t r)
Set rendering of track as points for the list and the elements.
Definition: TEveTrack.cxx:772
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:999
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:740
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
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:1200
TGCompositeFrame(const TGCompositeFrame &)
virtual void AddFrame(TGFrame *f, TGLayoutHints *l=0)
Add frame to the composite frame using the specified layout hints.
Definition: TGFrame.cxx:1099
virtual void SetWidth(UInt_t w)
Definition: TGFrame.h:293
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:349
virtual TVirtualPad * GetPad() const
Definition: TGedEditor.h:89
virtual void SetGedEditor(TGedEditor *ed)
Definition: TGedFrame.h:86
TGedEditor * fGedEditor
Definition: TGedFrame.h:54
virtual TGVerticalFrame * CreateEditorTabSubFrame(const char *name)
Create a vertical frame to be used by 'owner' in extra tab 'name'.
Definition: TGedFrame.cxx:123
virtual void MakeTitle(const char *title)
Create attribute frame title.
Definition: TGedFrame.cxx:96
virtual void Update()
Update the current pad when an attribute is changed via GUI.
Definition: TGedFrame.cxx:73
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:867
Double_t Log10(Double_t x)
Definition: TMath.h:752