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
31 UInt_t options, Pixel_t back) :
32 TGedFrame(p, width, height, options | kVerticalFrame, back),
33 fM(nullptr),
34
35 fType(nullptr),
36 fDistortion(nullptr),
37 fFixR(nullptr), fFixZ(nullptr),
38 fPastFixRFac(nullptr), fPastFixZFac(nullptr),
39 fCurrentDepth(nullptr),
40 fMaxTrackStep(nullptr),
41
42 fCenterX(nullptr),
43 fCenterY(nullptr),
44 fCenterZ(nullptr)
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
constexpr Bool_t kFALSE
Definition RtypesCore.h:94
#define ClassImp(name)
Definition Rtypes.h:382
@ kLHintsLeft
Definition TGLayout.h:24
@ kLHintsBottom
Definition TGLayout.h:29
@ kLHintsTop
Definition TGLayout.h:27
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 WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h Atom_t Int_t ULong_t ULong_t unsigned char prop_list Atom_t Atom_t Atom_t Time_t type
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t height
void SetLabelWidth(Int_t w)
void SetNELength(Int_t l)
Composite GUI element for single value selection (supports label, number-entry and slider).
void Build(Bool_t connect=kTRUE) override
Create sub-components (label, number entry, 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.
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 SetModel(TObject *obj) override
Set model object.
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.
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=nullptr)
Add frame to the composite frame using the specified layout hints.
Definition TGFrame.cxx:1117
void Resize(UInt_t w=0, UInt_t h=0) override
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:385
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
void Resize(UInt_t w, UInt_t h) override
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:374
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