Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
TEveCaloLegoEditor.cxx
Go to the documentation of this file.
1// @(#)root/eve:$Id$
2// Author: Matevz Tadel 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 "TEveCaloLegoEditor.h"
13#include "TEveCalo.h"
14#include "TEveGValuators.h"
15#include "TGComboBox.h"
16
17#include "TColor.h"
18#include "TGColorSelect.h"
19#include "TGLabel.h"
20#include "TG3DLine.h"
21
22/** \class TEveCaloLegoEditor
23\ingroup TEve
24GUI editor for TEveCaloLego.
25*/
26
27
28////////////////////////////////////////////////////////////////////////////////
29/// Constructor.
30
32 UInt_t options, Pixel_t back) :
33 TGedFrame(p, width, height, options | kVerticalFrame, back),
34 fM(nullptr),
35 fGridColor(nullptr),
36 fFontColor(nullptr),
37 fPlaneColor(nullptr),
38 fTransparency(nullptr),
39
40 fProjection(nullptr),
41 f2DMode(nullptr),
42 fBoxMode(nullptr),
43
44 fCell2DTextMin(nullptr),
45
46 fRebinFrame(nullptr),
47 fAutoRebin(nullptr),
48 fPixelsPerBin(nullptr),
49 fNormalizeRebin(nullptr)
50
51{
52 MakeTitle("TEveCaloLego");
53
54 { // grid color
56 TGLabel* lab = new TGLabel(f, "GridColor:");
57 f->AddFrame(lab, new TGLayoutHints(kLHintsLeft|kLHintsBottom, 1, 10, 1, 1));
58
59 fGridColor = new TGColorSelect(f, 0, -1);
60 f->AddFrame(fGridColor, new TGLayoutHints(kLHintsLeft|kLHintsTop, 3, 1, 0, 1));
61 fGridColor->Connect("ColorSelected(Pixel_t)", "TEveCaloLegoEditor", this, "DoGridColor(Pixel_t)");
62
63 AddFrame(f, new TGLayoutHints(kLHintsTop, 1, 1, 1, 0));
64 }
65 // axis
66 {
67 // font color
69 TGLabel* lab = new TGLabel(f, "FontColor:");
70 f->AddFrame(lab, new TGLayoutHints(kLHintsLeft|kLHintsBottom, 1, 8, 1, 1));
71
72 fFontColor = new TGColorSelect(f, 0, -1);
73 f->AddFrame(fFontColor, new TGLayoutHints(kLHintsLeft|kLHintsTop, 3, 1, 0, 1));
74 fFontColor->Connect("ColorSelected(Pixel_t)", "TEveCaloLegoEditor", this, "DoFontColor(Pixel_t)");
75
76 AddFrame(f, new TGLayoutHints(kLHintsTop, 1, 1, 1, 0));
77 }
78 {
79 // plane color
81 TGLabel* lab = new TGLabel(f, "PlaneColor:");
82 f->AddFrame(lab, new TGLayoutHints(kLHintsLeft|kLHintsBottom, 1, 1, 1, 1));
83
84 fPlaneColor = new TGColorSelect(f, 0, -1);
85 f->AddFrame(fPlaneColor, new TGLayoutHints(kLHintsLeft|kLHintsTop, 3, 1, 0, 1));
86 fPlaneColor->Connect("ColorSelected(Pixel_t)", "TEveCaloLegoEditor", this, "DoPlaneColor(Pixel_t)");
87
88 fTransparency = new TGNumberEntry(f, 0., 2, -1,
92 fTransparency->GetNumberEntry()->SetToolTipText("Transparency: 0 is opaque, 100 fully transparent.");
93 f->AddFrame(fTransparency, new TGLayoutHints(kLHintsLeft, 0, 0, 0, 0));
94 fTransparency->Connect("ValueSet(Long_t)","TEveCaloLegoEditor", this, "DoTransparency()");
95
96 AddFrame(f, new TGLayoutHints(kLHintsTop, 1, 1, 1, 0));
97 }
98
99 Int_t lw = 80;
100
101 fProjection = MakeLabeledCombo("Project:", 1);
105 fProjection->Connect("Selected(Int_t)", "TEveCaloLegoEditor", this, "DoProjection()");
106
107 f2DMode = MakeLabeledCombo("2DMode:", 4);
111 f2DMode->Connect("Selected(Int_t)", "TEveCaloLegoEditor", this, "Do2DMode()");
112
113 fBoxMode = MakeLabeledCombo("Box:", 4);
117 fBoxMode->Connect("Selected(Int_t)", "TEveCaloLegoEditor", this, "DoBoxMode()");
118
119 fCell2DTextMin = new TEveGValuator(this, "Cell2DTexMin:", 90, 0);
124 fCell2DTextMin->SetLimits(1, 1000);
125 fCell2DTextMin->SetToolTip("Draw cell values above N pixels.");
126 fCell2DTextMin->Connect("ValueSet(Double_t)", "TEveCaloLegoEditor", this, "DoCell2DTextMin()");
128
130}
131
132////////////////////////////////////////////////////////////////////////////////
133
135{
137
138 fAutoRebin = new TGCheckButton(fRebinFrame, "AutoRebin");
140 fAutoRebin->Connect("Toggled(Bool_t)", "TEveCaloLegoEditor", this, "DoAutoRebin()");
141
142 fNormalizeRebin = new TGCheckButton(fRebinFrame, "NormalizeRebin");
144 fNormalizeRebin->Connect("Toggled(Bool_t)", "TEveCaloLegoEditor", this, "DoNormalize()");
145
146 fPixelsPerBin = new TEveGValuator(fRebinFrame, "PixelsPerBin:", 90, 0);
151 fPixelsPerBin->SetLimits(1, 50);
152 fPixelsPerBin->SetToolTip("Number of labels along the Z axis.");
153 fPixelsPerBin->Connect("ValueSet(Double_t)", "TEveCaloLegoEditor", this, "DoPixelsPerBin()");
155}
156
157////////////////////////////////////////////////////////////////////////////////
158/// Helper function. Creates TGComboBox with fixed size TGLabel.
159
161{
162 UInt_t labelW = 60;
163 UInt_t labelH = 20;
165 // label
167 TGLabel* label = new TGLabel(labfr, name);
168 labfr->AddFrame(label, new TGLayoutHints(kLHintsLeft | kLHintsBottom));
169 hf->AddFrame(labfr, new TGLayoutHints(kLHintsLeft));
170 // combo
173 combo->Resize(90, 20);
174 hf->AddFrame(combo, clh);
175
176 AddFrame(hf, new TGLayoutHints(kLHintsTop, 1, 1, 1, off));
177 return combo;
178}
179
180////////////////////////////////////////////////////////////////////////////////
181/// Set model object.
182
203
204////////////////////////////////////////////////////////////////////////////////
205/// Slot for GridColor.
206
212
213////////////////////////////////////////////////////////////////////////////////
214/// Slot for FontColor.
215
221
222////////////////////////////////////////////////////////////////////////////////
223/// Slot for PlaneColor.
224
230
231////////////////////////////////////////////////////////////////////////////////
232/// Slot for setting limit in pixels in which cell value is rendered.
233
239
240
241////////////////////////////////////////////////////////////////////////////////
242/// Slot for projection.
243
249
250////////////////////////////////////////////////////////////////////////////////
251/// Slot for projection.
252
258
259////////////////////////////////////////////////////////////////////////////////
260/// Slot for projection.
261
267
268////////////////////////////////////////////////////////////////////////////////
269/// Slot for Transparency.
270
276
277////////////////////////////////////////////////////////////////////////////////
278/// Slot for PixelsPerBin.
279
285
286////////////////////////////////////////////////////////////////////////////////
287
293
294////////////////////////////////////////////////////////////////////////////////
295
@ kVerticalFrame
Definition GuiTypes.h:381
@ kFixedSize
Definition GuiTypes.h:390
ULong_t Pixel_t
Pixel value.
Definition GuiTypes.h:40
#define f(i)
Definition RSha256.hxx:104
short Color_t
Color number (short)
Definition RtypesCore.h:99
char Char_t
Character 1 byte (char)
Definition RtypesCore.h:51
constexpr Bool_t kFALSE
Definition RtypesCore.h:108
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
@ kButtonDown
Definition TGButton.h:54
@ kButtonUp
Definition TGButton.h:53
@ kLHintsLeft
Definition TGLayout.h:24
@ kLHintsBottom
Definition TGLayout.h:29
@ kLHintsTop
Definition TGLayout.h:27
winID h TVirtualViewer3D TVirtualGLPainter p
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void pixel
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
char name[80]
Definition TGX11.cxx:110
static ULong_t Number2Pixel(Int_t ci)
Static method that given a color index number, returns the corresponding pixel value.
Definition TColor.cxx:2445
static Int_t GetColor(const char *hexcolor)
Static method returning color number for color specified by hex color string of form: "#rrggbb",...
Definition TColor.cxx:1926
TGCheckButton * fAutoRebin
TGVerticalFrame * fRebinFrame
TEveCaloLegoEditor(const TEveCaloLegoEditor &)
TGColorSelect * fPlaneColor
TGNumberEntry * fTransparency
void DoProjection()
Slot for projection.
TEveGValuator * fCell2DTextMin
TGCheckButton * fNormalizeRebin
void DoBoxMode()
Slot for projection.
void DoFontColor(Pixel_t color)
Slot for FontColor.
void Do2DMode()
Slot for projection.
void SetModel(TObject *obj) override
Set model object.
void DoTransparency()
Slot for Transparency.
TGColorSelect * fFontColor
void DoCell2DTextMin()
Slot for setting limit in pixels in which cell value is rendered.
TEveGValuator * fPixelsPerBin
void DoGridColor(Pixel_t color)
Slot for GridColor.
void DoPlaneColor(Pixel_t color)
Slot for PlaneColor.
void DoPixelsPerBin()
Slot for PixelsPerBin.
TGColorSelect * fGridColor
TGComboBox * MakeLabeledCombo(const char *name, Int_t off)
Helper function. Creates TGComboBox with fixed size TGLabel.
Visualization of calorimeter data as eta/phi histogram.
Definition TEveCalo.h:251
Bool_t GetNormalizeRebin() const
Definition TEveCalo.h:322
void Set2DMode(E2DMode_e p)
Definition TEveCalo.h:328
Int_t GetPixelsPerBin() const
Definition TEveCalo.h:316
Color_t GetFontColor() const
Definition TEveCalo.h:301
void SetProjection(EProjection_e p)
Definition TEveCalo.h:326
void SetFontColor(Color_t ci)
Definition TEveCalo.h:302
void SetAutoRebin(Bool_t s)
Definition TEveCalo.h:320
void SetDrawNumberCellPixels(Int_t x)
Definition TEveCalo.h:347
void SetPlaneColor(Color_t ci)
Definition TEveCalo.h:308
void SetBoxMode(EBoxMode_e p)
Definition TEveCalo.h:337
void SetPixelsPerBin(Int_t bw)
Definition TEveCalo.h:317
void SetNormalizeRebin(Bool_t s)
Definition TEveCalo.h:323
Color_t GetPlaneColor() const
Definition TEveCalo.h:307
EProjection_e GetProjection() const
Definition TEveCalo.h:325
Char_t GetPlaneTransparency() const
Definition TEveCalo.h:310
Int_t GetDrawNumberCellPixels()
Definition TEveCalo.h:346
void SetGridColor(Color_t ci)
Definition TEveCalo.h:305
E2DMode_e Get2DMode()
Definition TEveCalo.h:329
Bool_t GetAutoRebin() const
Definition TEveCalo.h:319
Color_t GetGridColor() const
Definition TEveCalo.h:304
void SetPlaneTransparency(Char_t t)
Definition TEveCalo.h:311
EBoxMode_e GetBoxMode()
Definition TEveCalo.h:338
void SetLabelWidth(Int_t w)
void SetShowSlider(Bool_t s=kTRUE)
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.
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.
Like a checkbutton but instead of the check mark there is color area with a little down arrow.
void SetColor(Pixel_t color, Bool_t emit=kTRUE)
Set color.
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 Int_t GetSelected() const
Definition TGComboBox.h:114
virtual void AddEntry(TGString *s, Int_t id)
Definition TGComboBox.h:86
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...
The base class for composite widgets (menu bars, list boxes, etc.).
Definition TGFrame.h:289
virtual void AddFrame(TGFrame *f, TGLayoutHints *l=nullptr)
Add frame to the composite frame using the specified layout hints.
Definition TGFrame.cxx:1109
virtual void SetHeight(UInt_t h)
Definition TGFrame.h:249
A composite frame that layout their children in horizontal way.
Definition TGFrame.h:387
This class handles GUI labels.
Definition TGLabel.h:24
This class describes layout hints used by the layout classes.
Definition TGLayout.h:50
TGNumberEntry is a number entry input widget with up/down buttons.
TGNumberEntryField * GetNumberEntry() const
Get the number entry field.
virtual Double_t GetNumber() const
virtual void SetNumber(Double_t val, Bool_t emit=kTRUE)
@ kNEANonNegative
Non-negative number.
@ kNESInteger
Style of number entry field.
@ kNELLimitMinMax
Both lower and upper limits.
virtual void SetToolTipText(const char *text, Long_t delayms=500)
Set tool tip text associated with this text entry.
ROOT GUI Window base class.
Definition TGWindow.h:23
Base frame for implementing GUI - a service class.
Definition TGedFrame.h:27
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:94
virtual void Update()
Update the current pad when an attribute is changed via GUI.
Definition TGedFrame.cxx:71
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:865