Logo ROOT   6.18/05
Reference Guide
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 "TGNumberEntry.h"
17#include "TGComboBox.h"
18#include "TGLabel.h"
19
20/** \class TEveProjectionManagerEditor
21\ingroup TEve
22GUI editor for TEveProjectionManager class.
23*/
24
26
27////////////////////////////////////////////////////////////////////////////////
28/// Constructor.
29
31 Int_t width, Int_t height,
32 UInt_t options, Pixel_t back) :
33 TGedFrame(p, width, height, options | kVerticalFrame, back),
34 fM(0),
35
36 fType(0),
37 fDistortion(0),
38 fFixR(0), fFixZ(0),
39 fPastFixRFac(0), fPastFixZFac(0),
40 fCurrentDepth(0),
41 fMaxTrackStep(0),
42
43 fCenterX(0),
44 fCenterY(0),
45 fCenterZ(0)
46{
47 MakeTitle("TEveProjection");
48 {
50 TGLabel* lab = new TGLabel(f, "Type");
51 f->AddFrame(lab, new TGLayoutHints(kLHintsLeft|kLHintsBottom, 1, 31, 1, 2));
52 fType = new TGComboBox(f);
56 TGListBox* lb = fType->GetListBox();
57 lb->Resize(lb->GetWidth(), 2*18);
58 fType->Resize(80, 20);
59 fType->Connect("Selected(Int_t)", "TEveProjectionManagerEditor",
60 this, "DoType(Int_t)");
61 f->AddFrame(fType, new TGLayoutHints(kLHintsTop, 1, 1, 2, 4));
62 AddFrame(f);
63 }
64
65 Int_t nel = 6;
66 Int_t labelW = 60;
67 fDistortion = new TEveGValuator(this, "Distortion:", 90, 0);
72 fDistortion->Connect("ValueSet(Double_t)", "TEveProjectionManagerEditor",
73 this, "DoDistortion()");
75
76
77 fFixR = new TEveGValuator(this, "FixedR:", 90, 0);
78 fFixR->SetNELength(nel);
79 fFixR->SetLabelWidth(labelW);
80 fFixR->Build();
82 fFixR->SetToolTip("Radius after which scale is kept constant.");
83 fFixR->Connect("ValueSet(Double_t)", "TEveProjectionManagerEditor",
84 this, "DoFixR()");
85 AddFrame(fFixR, new TGLayoutHints(kLHintsTop, 1, 1, 1, 0));
86
87 fFixZ = new TEveGValuator(this, "FixedZ:", 90, 0);
88 fFixZ->SetNELength(nel);
89 fFixZ->SetLabelWidth(labelW);
90 fFixZ->Build();
92 fFixZ->SetToolTip("Z-coordinate after which scale is kept constant.");
93 fFixZ->Connect("ValueSet(Double_t)", "TEveProjectionManagerEditor",
94 this, "DoFixZ()");
95 AddFrame(fFixZ, new TGLayoutHints(kLHintsTop, 1, 1, 1, 0));
96
97 fPastFixRFac = new TEveGValuator(this, "ScaleR:", 90, 0);
102 fPastFixRFac->SetToolTip("Relative R-scale beyond FixedR.\nExpressed as 10^x.");
103 fPastFixRFac->Connect("ValueSet(Double_t)", "TEveProjectionManagerEditor",
104 this, "DoPastFixRFac()");
106
107 fPastFixZFac = new TEveGValuator(this, "ScaleZ:", 90, 0);
112 fPastFixZFac->SetToolTip("Relative Z-scale beyond FixedZ.\nExpressed as 10^x.");
113 fPastFixZFac->Connect("ValueSet(Double_t)", "TEveProjectionManagerEditor",
114 this, "DoPastFixZFac()");
116
117 fCurrentDepth = new TEveGValuator(this, "CurrentZ:", 90, 0);
122 fCurrentDepth->SetToolTip("Z coordinate of incoming projected object.");
123 fCurrentDepth->Connect("ValueSet(Double_t)", "TEveProjectionManagerEditor",
124 this, "DoCurrentDepth()");
126
127 fMaxTrackStep = new TEveGValuator(this, "TrackStep:", 90, 0);
132 fMaxTrackStep->SetToolTip("Maximum step between two consecutive track-points to avoid artefacts due to projective distortions.\nTaken into account automatically during projection procedure.");
133 fMaxTrackStep->Connect("ValueSet(Double_t)", "TEveProjectionManagerEditor",
134 this, "DoMaxTrackStep()");
136
137 // --------------------------------
138
139 MakeTitle("Distortion centre");
140 fCenterFrame = new TGVerticalFrame(this);
141
142 fCenterX = new TEveGValuator(fCenterFrame, "CenterX:", 90, 0);
143 fCenterX->SetNELength(nel);
144 fCenterX->SetLabelWidth(labelW);
145 fCenterX->Build();
147 fCenterX->SetToolTip("Origin of the projection.");
148 fCenterX->Connect("ValueSet(Double_t)", "TEveProjectionManagerEditor",
149 this, "DoCenter()");
151
152 fCenterY = new TEveGValuator(fCenterFrame, "CenterY:", 90, 0);
153 fCenterY->SetNELength(nel);
154 fCenterY->SetLabelWidth(labelW);
155 fCenterY->Build();
157 fCenterY->SetToolTip("Origin of the projection.");
158 fCenterY->Connect("ValueSet(Double_t)", "TEveProjectionManagerEditor",
159 this, "DoCenter()");
161
162 fCenterZ = new TEveGValuator(fCenterFrame, "CenterZ:", 90, 0);
163 fCenterZ->SetNELength(nel);
164 fCenterZ->SetLabelWidth(labelW);
165 fCenterZ->Build();
167 fCenterZ->SetToolTip("Origin of the projection.");
168 fCenterZ->Connect("ValueSet(Double_t)", "TEveProjectionManagerEditor",
169 this, "DoCenter()");
171
173}
174
175////////////////////////////////////////////////////////////////////////////////
176/// Set model object.
177
179{
180 fM = dynamic_cast<TEveProjectionManager*>(obj);
181
190
194}
195
196////////////////////////////////////////////////////////////////////////////////
197/// Slot for setting of projection type.
198
200{
201 try
202 {
205 Update();
206 }
207 catch (...)
208 {
209 SetModel(fM);
210 throw;
211 }
212}
213
214////////////////////////////////////////////////////////////////////////////////
215/// Slot for setting distortion.
216
218{
220 fM->UpdateName();
222 Update();
223}
224
225////////////////////////////////////////////////////////////////////////////////
226/// Slot for setting fixed radius.
227
229{
232 Update();
233}
234
235////////////////////////////////////////////////////////////////////////////////
236/// Slot for setting fixed z-coordinate.
237
239{
242 Update();
243}
244
245////////////////////////////////////////////////////////////////////////////////
246/// Slot for setting fixed radius.
247
249{
252 Update();
253}
254
255////////////////////////////////////////////////////////////////////////////////
256/// Slot for setting fixed z-coordinate.
257
259{
262 Update();
263}
264
265////////////////////////////////////////////////////////////////////////////////
266/// Slot for setting current depth.
267
269{
272 Update();
273}
274
275////////////////////////////////////////////////////////////////////////////////
276/// Slot for setting fixed z-coordinate.
277
279{
282 Update();
283}
284
285////////////////////////////////////////////////////////////////////////////////
286/// Slot for setting center of distortion.
287
289{
291 Update();
292}
293
ULong_t Pixel_t
Definition: GuiTypes.h:39
PyObject * fType
#define f(i)
Definition: RSha256.hxx:104
int Int_t
Definition: RtypesCore.h:41
unsigned int UInt_t
Definition: RtypesCore.h:42
const Bool_t kFALSE
Definition: RtypesCore.h:88
#define ClassImp(name)
Definition: Rtypes.h:365
include TDocParser_001 C image html pict1_TDocParser_001 png width
Definition: TDocParser.cxx:121
@ kVerticalFrame
Definition: TGFrame.h:59
@ kLHintsLeft
Definition: TGLayout.h:31
@ kLHintsBottom
Definition: TGLayout.h:36
@ kLHintsTop
Definition: TGLayout.h:34
int type
Definition: TGX11.cxx:120
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...
void SetCurrentDepth(Float_t d)
Float_t GetCurrentDepth() const
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
virtual void AddEntry(TGString *s, Int_t id)
Definition: TGComboBox.h:106
virtual TGListBox * GetListBox() const
Definition: TGComboBox.h:130
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...
Definition: TGComboBox.cxx:443
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 Resize(UInt_t w=0, UInt_t h=0)
Resize the frame.
Definition: TGFrame.cxx:587
UInt_t GetWidth() const
Definition: TGFrame.h:271
virtual void Resize(UInt_t w, UInt_t h)
Resize the listbox widget.
Definition: TGListBox.cxx:1419
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