Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
TEveProjectionManagerEditor.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
14#include "TEveGValuators.h"
15
16#include "TGComboBox.h"
17#include "TGLabel.h"
18
19/** \class TEveProjectionManagerEditor
20\ingroup TEve
21GUI editor for TEveProjectionManager class.
22*/
23
25
26////////////////////////////////////////////////////////////////////////////////
27/// Constructor.
28
30 Int_t width, Int_t height,
31 UInt_t options, Pixel_t back) :
32 TGedFrame(p, width, height, options | kVerticalFrame, back),
33 fM(0),
34
35 fType(0),
36 fDistortion(0),
37 fFixR(0), fFixZ(0),
38 fPastFixRFac(0), fPastFixZFac(0),
39 fCurrentDepth(0),
40 fMaxTrackStep(0),
41
42 fCenterX(0),
43 fCenterY(0),
44 fCenterZ(0)
45{
46 MakeTitle("TEveProjection");
47 {
49 TGLabel* lab = new TGLabel(f, "Type");
50 f->AddFrame(lab, new TGLayoutHints(kLHintsLeft|kLHintsBottom, 1, 31, 1, 2));
51 fType = new TGComboBox(f);
59 TGListBox* lb = fType->GetListBox();
60 lb->Resize(lb->GetWidth(), 2*18);
61 fType->Resize(80, 20);
62 fType->Connect("Selected(Int_t)", "TEveProjectionManagerEditor",
63 this, "DoType(Int_t)");
64 f->AddFrame(fType, new TGLayoutHints(kLHintsTop, 1, 1, 2, 4));
65 AddFrame(f);
66 }
67
68 Int_t nel = 6;
69 Int_t labelW = 60;
70 fDistortion = new TEveGValuator(this, "Distortion:", 90, 0);
75 fDistortion->Connect("ValueSet(Double_t)", "TEveProjectionManagerEditor",
76 this, "DoDistortion()");
78
79
80 fFixR = new TEveGValuator(this, "FixedR:", 90, 0);
81 fFixR->SetNELength(nel);
82 fFixR->SetLabelWidth(labelW);
83 fFixR->Build();
85 fFixR->SetToolTip("Radius after which scale is kept constant.");
86 fFixR->Connect("ValueSet(Double_t)", "TEveProjectionManagerEditor",
87 this, "DoFixR()");
88 AddFrame(fFixR, new TGLayoutHints(kLHintsTop, 1, 1, 1, 0));
89
90 fFixZ = new TEveGValuator(this, "FixedZ:", 90, 0);
91 fFixZ->SetNELength(nel);
92 fFixZ->SetLabelWidth(labelW);
93 fFixZ->Build();
95 fFixZ->SetToolTip("Z-coordinate after which scale is kept constant.");
96 fFixZ->Connect("ValueSet(Double_t)", "TEveProjectionManagerEditor",
97 this, "DoFixZ()");
98 AddFrame(fFixZ, new TGLayoutHints(kLHintsTop, 1, 1, 1, 0));
99
100 fPastFixRFac = new TEveGValuator(this, "ScaleR:", 90, 0);
105 fPastFixRFac->SetToolTip("Relative R-scale beyond FixedR.\nExpressed as 10^x.");
106 fPastFixRFac->Connect("ValueSet(Double_t)", "TEveProjectionManagerEditor",
107 this, "DoPastFixRFac()");
109
110 fPastFixZFac = new TEveGValuator(this, "ScaleZ:", 90, 0);
115 fPastFixZFac->SetToolTip("Relative Z-scale beyond FixedZ.\nExpressed as 10^x.");
116 fPastFixZFac->Connect("ValueSet(Double_t)", "TEveProjectionManagerEditor",
117 this, "DoPastFixZFac()");
119
120 fCurrentDepth = new TEveGValuator(this, "CurrentZ:", 90, 0);
125 fCurrentDepth->SetToolTip("Z coordinate of incoming projected object.");
126 fCurrentDepth->Connect("ValueSet(Double_t)", "TEveProjectionManagerEditor",
127 this, "DoCurrentDepth()");
129
130 fMaxTrackStep = new TEveGValuator(this, "TrackStep:", 90, 0);
135 fMaxTrackStep->SetToolTip("Maximum step between two consecutive track-points to avoid artefacts due to projective distortions.\nTaken into account automatically during projection procedure.");
136 fMaxTrackStep->Connect("ValueSet(Double_t)", "TEveProjectionManagerEditor",
137 this, "DoMaxTrackStep()");
139
140 // --------------------------------
141
142 MakeTitle("Distortion centre");
143 fCenterFrame = new TGVerticalFrame(this);
144
145 fCenterX = new TEveGValuator(fCenterFrame, "CenterX:", 90, 0);
146 fCenterX->SetNELength(nel);
147 fCenterX->SetLabelWidth(labelW);
148 fCenterX->Build();
150 fCenterX->SetToolTip("Origin of the projection.");
151 fCenterX->Connect("ValueSet(Double_t)", "TEveProjectionManagerEditor",
152 this, "DoCenter()");
154
155 fCenterY = new TEveGValuator(fCenterFrame, "CenterY:", 90, 0);
156 fCenterY->SetNELength(nel);
157 fCenterY->SetLabelWidth(labelW);
158 fCenterY->Build();
160 fCenterY->SetToolTip("Origin of the projection.");
161 fCenterY->Connect("ValueSet(Double_t)", "TEveProjectionManagerEditor",
162 this, "DoCenter()");
164
165 fCenterZ = new TEveGValuator(fCenterFrame, "CenterZ:", 90, 0);
166 fCenterZ->SetNELength(nel);
167 fCenterZ->SetLabelWidth(labelW);
168 fCenterZ->Build();
170 fCenterZ->SetToolTip("Origin of the projection.");
171 fCenterZ->Connect("ValueSet(Double_t)", "TEveProjectionManagerEditor",
172 this, "DoCenter()");
174
176}
177
178////////////////////////////////////////////////////////////////////////////////
179/// Set model object.
180
182{
183 fM = dynamic_cast<TEveProjectionManager*>(obj);
184
193
197}
198
199////////////////////////////////////////////////////////////////////////////////
200/// Slot for setting of projection type.
201
203{
204 try
205 {
208 Update();
209 }
210 catch (...)
211 {
212 SetModel(fM);
213 throw;
214 }
215}
216
217////////////////////////////////////////////////////////////////////////////////
218/// Slot for setting distortion.
219
221{
223 fM->UpdateName();
225 Update();
226}
227
228////////////////////////////////////////////////////////////////////////////////
229/// Slot for setting fixed radius.
230
232{
235 Update();
236}
237
238////////////////////////////////////////////////////////////////////////////////
239/// Slot for setting fixed z-coordinate.
240
242{
245 Update();
246}
247
248////////////////////////////////////////////////////////////////////////////////
249/// Slot for setting fixed radius.
250
252{
255 Update();
256}
257
258////////////////////////////////////////////////////////////////////////////////
259/// Slot for setting fixed z-coordinate.
260
262{
265 Update();
266}
267
268////////////////////////////////////////////////////////////////////////////////
269/// Slot for setting current depth.
270
272{
275 Update();
276}
277
278////////////////////////////////////////////////////////////////////////////////
279/// Slot for setting fixed z-coordinate.
280
282{
285 Update();
286}
287
288////////////////////////////////////////////////////////////////////////////////
289/// Slot for setting center of distortion.
290
292{
294 Update();
295}
296
@ kVerticalFrame
Definition GuiTypes.h:381
ULong_t Pixel_t
Pixel value.
Definition GuiTypes.h:40
#define f(i)
Definition RSha256.hxx:104
const Bool_t kFALSE
Definition RtypesCore.h:101
#define ClassImp(name)
Definition Rtypes.h:364
include TDocParser_001 C image html pict1_TDocParser_001 png width
@ kLHintsLeft
Definition TGLayout.h:24
@ kLHintsBottom
Definition TGLayout.h:29
@ kLHintsTop
Definition TGLayout.h:27
int type
Definition TGX11.cxx:121
void SetLabelWidth(Int_t w)
void SetNELength(Int_t l)
Composite GUI element for single value selection (supports label, number-entry and slider).
void SetToolTip(const char *tip)
Set the tooltip of the number-entry.
void SetLimits(Int_t min, Int_t max)
Set limits of the represented value for integer values.
virtual void Build(Bool_t connect=kTRUE)
Create sub-components (label, number entry, slider).
Float_t GetValue() const
virtual void SetValue(Float_t v, Bool_t emit=kFALSE)
Set value, optionally emit signal.
GUI editor for TEveProjectionManager class.
void DoPastFixZFac()
Slot for setting fixed z-coordinate.
void DoCurrentDepth()
Slot for setting current depth.
void DoType(Int_t type)
Slot for setting of projection type.
TEveProjectionManagerEditor(const TEveProjectionManagerEditor &)
void DoMaxTrackStep()
Slot for setting fixed z-coordinate.
void DoCenter()
Slot for setting center of distortion.
virtual void SetModel(TObject *obj)
Set model object.
void DoDistortion()
Slot for setting distortion.
void DoFixZ()
Slot for setting fixed z-coordinate.
void DoFixR()
Slot for setting fixed radius.
void DoPastFixRFac()
Slot for setting fixed radius.
Manager class for steering of projections and managing projected objects.
void SetCenter(Float_t x, Float_t y, Float_t z)
Set projection center and rebuild projected scene.
virtual void UpdateName()
Updates name to have consistent information with projection.
void SetProjection(TEveProjection::EPType_e type)
Set projection type and distortion.
virtual void ProjectChildren()
Project all children recursively, update bounding-box and notify TEveManger about the scenes that hav...
TEveProjection * GetProjection()
void SetDistortion(Float_t d)
Set distortion.
void SetPastFixRFac(Float_t x)
Set 2's-exponent for relative scaling beyond FixR.
Float_t GetFixZ() const
Float_t GetFixR() const
void SetFixR(Float_t x)
Set fixed radius.
void SetPastFixZFac(Float_t x)
Set 2's-exponent for relative scaling beyond FixZ.
void SetMaxTrackStep(Float_t x)
Float_t GetPastFixRFac() const
EPType_e GetType() const
Float_t GetDistortion() const
Float_t GetPastFixZFac() const
void SetFixZ(Float_t x)
Set fixed radius.
Float_t GetMaxTrackStep() const
A combobox (also known as a drop down listbox) allows the selection of one item out of a list of item...
Definition TGComboBox.h:47
virtual void AddEntry(TGString *s, Int_t id)
Definition TGComboBox.h:86
virtual TGListBox * GetListBox() const
Definition TGComboBox.h:110
virtual void Select(Int_t id, Bool_t emit=kTRUE)
Make the selected item visible in the combo box window and emit signals according to the second param...
virtual void AddFrame(TGFrame *f, TGLayoutHints *l=0)
Add frame to the composite frame using the specified layout hints.
Definition TGFrame.cxx:1117
virtual void Resize(UInt_t w=0, UInt_t h=0)
Resize the frame.
Definition TGFrame.cxx:605
UInt_t GetWidth() const
Definition TGFrame.h:224
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
A listbox is a box, possibly with scrollbar, containing entries.
Definition TGListBox.h:221
virtual void Resize(UInt_t w, UInt_t h)
Resize the listbox widget.
@ kNESRealOne
Fixed fraction real, one digit.
@ kNESRealThree
Fixed fraction real, three digit.
@ kNESRealTwo
Fixed fraction real, two digit.
A composite frame that layout their children in vertical way.
Definition TGFrame.h:375
ROOT GUI Window base class.
Definition TGWindow.h:23
Base frame for implementing GUI - a service class.
Definition TGedFrame.h:27
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