Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
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(nullptr),
41 fRSEditor(nullptr)
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
82 UInt_t options, Pixel_t back) :
83 TGedFrame(p, width, height, options | kVerticalFrame, back),
84
85 fTC (nullptr),
86 fPtRange (nullptr),
87 fPRange (nullptr),
88 fRSSubEditor(nullptr)
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,
144 kFitWidth |
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
@ kFitWidth
Definition GuiTypes.h:386
@ 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
float Float_t
Definition RtypesCore.h:57
#define ClassImp(name)
Definition Rtypes.h:377
R__EXTERN TEveManager * gEve
@ 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
winID h TVirtualViewer3D TVirtualGLPainter p
Option_t Option_t width
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t height
Composite GUI element for selection of range (label, two number-entries and double-slider).
Float_t GetMin() const
void Build(Bool_t connect=kTRUE) override
Create sub-components (label, number entries, double-slider).
TGDoubleHSlider * GetSlider()
void SetLimits(Int_t min, Int_t max)
Set limits of the represented range for integer values.
Float_t GetMax() const
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.
TEveTrackEditor(const TEveTrackEditor &)
TGTextButton * fRSEditor
void SetModel(TObject *obj) override
Set model object.
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
TEveGDoubleValuator * fPRange
void SetModel(TObject *obj) override
Set model object.
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.
void SetRnrPoints(Bool_t r)
Set rendering of track as points for the list and the elements.
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.
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.
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
Bool_t IsOn() const override
Definition TGButton.h:310
void SetState(EButtonState state, Bool_t emit=kFALSE) override
Set check button state.
The base class for composite widgets (menu bars, list boxes, etc.).
Definition TGFrame.h:287
virtual void AddFrame(TGFrame *f, TGLayoutHints *l=nullptr)
Add frame to the composite frame using the specified layout hints.
Definition TGFrame.cxx:1117
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:385
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.
@ kNESInteger
Style of number entry field.
@ kNESRealTwo
Fixed fraction real, two digit.
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.
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'.
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:41
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)
Returns the common (base-10) logarithm of x.
Definition TMath.h:762