Logo ROOT  
Reference Guide
Loading...
Searching...
No Matches
TEveProjectionAxesEditor.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
13#include "TEveProjectionAxes.h"
14#include "TEveGValuators.h"
15
16#include "TGComboBox.h"
17#include "TGButton.h"
18#include "TGLabel.h"
19#include "TG3DLine.h"
20
21/** \class TEveProjectionAxesEditor
22\ingroup TEve
23GUI editor for TEveProjectionAxes.
24*/
25
26
27////////////////////////////////////////////////////////////////////////////////
28
30 UInt_t options, Pixel_t back) :
31 TGedFrame(p, width, height, options | kVerticalFrame, back),
32 fM(nullptr),
33
34 fLabMode(nullptr),
35 fAxesMode(nullptr),
36
37 fCenterFrame(nullptr),
38 fDrawCenter(nullptr),
39 fDrawOrigin(nullptr)
40{
41 // Constructor.
42
43 MakeTitle("TEveProjectionAxis");
44 Int_t labw=52;
45
46 {
48
49 TGCompositeFrame *labfr = new TGHorizontalFrame(f, labw, 20, kFixedSize);
50 labfr->AddFrame(new TGLabel(labfr, "Labels:") , new TGLayoutHints(kLHintsLeft | kLHintsBottom));
51 f->AddFrame(labfr, new TGLayoutHints(kLHintsLeft|kLHintsBottom, 0, 1, 1, 1));
52
53 fLabMode = new TGComboBox(f, "Position");
54 fLabMode->AddEntry("Value", 1);
55 fLabMode->AddEntry("Position", 0);
56 fLabMode->GetTextEntry()->SetToolTipText("Set tick-marks on equidistant values/screen position.");
57 TGListBox* lb = fLabMode->GetListBox();
58 lb->Resize(lb->GetWidth(), 2*18);
59 fLabMode->Resize(80, 20);
60 fLabMode->Connect("Selected(Int_t)", "TEveProjectionAxesEditor", this, "DoLabMode(Int_t)");
61 f->AddFrame(fLabMode, new TGLayoutHints(kLHintsTop, 1, 1, 1, 1));
62 AddFrame(f);
63 }
64
65 {
67 TGCompositeFrame *labfr = new TGHorizontalFrame(f, labw, 20, kFixedSize);
68 labfr->AddFrame(new TGLabel(labfr, "Axes:") , new TGLayoutHints(kLHintsLeft | kLHintsBottom));
69 f->AddFrame(labfr, new TGLayoutHints(kLHintsLeft|kLHintsBottom, 0, 1, 1, 1));
70
71
72 fAxesMode = new TGComboBox(f, "All");
73 fAxesMode->AddEntry("Horizontal", TEveProjectionAxes::kHorizontal);
74 fAxesMode->AddEntry("Vertical",TEveProjectionAxes::kVertical);
75 fAxesMode->AddEntry("All", TEveProjectionAxes::kAll);
76 TGListBox* lb = fAxesMode->GetListBox();
77 lb->Resize(lb->GetWidth(), 2*18);
78 fAxesMode->Resize(80, 20);
79 fAxesMode->Connect("Selected(Int_t)", "TEveProjectionAxesEditor", this, "DoAxesMode(Int_t)");
80 f->AddFrame(fAxesMode, new TGLayoutHints(kLHintsTop, 1, 1, 1, 1));
81 AddFrame(f);
82 }
83
84 //______________________________________________________________________________
85
86 // center tab
88
89 TGCompositeFrame *title1 = new TGCompositeFrame(fCenterFrame, 180, 10,
91 kFitWidth |
94 title1->AddFrame(new TGLabel(title1, "Distortion Center"),
95 new TGLayoutHints(kLHintsLeft, 1, 1, 0, 0));
96 title1->AddFrame(new TGHorizontal3DLine(title1),
97 new TGLayoutHints(kLHintsExpandX, 5, 5, 7, 7));
98 fCenterFrame->AddFrame(title1, new TGLayoutHints(kLHintsTop, 0, 0, 2, 0));
99
100
101 {
102
104
105 fDrawOrigin = new TGCheckButton(hf1, "DrawOrigin");
106 hf1->AddFrame(fDrawOrigin, new TGLayoutHints(kLHintsLeft, 2,1,0,4));
107 fDrawOrigin->Connect("Toggled(Bool_t)", "TEveProjectionAxesEditor", this, "DoDrawOrigin()");
108
109
110 fDrawCenter = new TGCheckButton(hf1, "DrawCenter");
111 hf1->AddFrame(fDrawCenter, new TGLayoutHints(kLHintsLeft, 2,1,0,4));
112 fDrawCenter->Connect("Toggled(Bool_t)", "TEveProjectionAxesEditor", this, "DoDrawCenter()");
113
114 fCenterFrame->AddFrame(hf1, new TGLayoutHints(kLHintsTop, 0,0,0,0));
115
116 }
117}
118
119////////////////////////////////////////////////////////////////////////////////
120/// Set model object.
121
123{
124 fM = dynamic_cast<TEveProjectionAxes*>(obj);
125
126 fLabMode->Select(fM->GetLabMode(), kFALSE);
127 fAxesMode->Select(fM->GetAxesMode(), kFALSE);
128 fDrawCenter->SetState(fM->GetDrawCenter() ? kButtonDown : kButtonUp);
129 fDrawOrigin->SetState(fM->GetDrawOrigin() ? kButtonDown : kButtonUp);
130
131}
132
133////////////////////////////////////////////////////////////////////////////////
134/// Slot for setting draw of origin.
135
137{
138 fM->SetDrawOrigin(fDrawOrigin->IsOn());
139 Update();
140}
141
142////////////////////////////////////////////////////////////////////////////////
143/// Slot for setting draw of center.
144
146{
147 fM->SetDrawCenter(fDrawCenter->IsOn());
148 Update();
149}
150
151////////////////////////////////////////////////////////////////////////////////
152/// Slot for setting tick-mark step mode.
153
155{
157 fM->SetLabMode(em);
158 Update();
159}
160
161////////////////////////////////////////////////////////////////////////////////
162/// Slot for setting number of axes.
163
165{
167 fM->SetAxesMode(em);
168 Update();
169}
@ kVerticalFrame
Definition GuiTypes.h:382
@ kFixedWidth
Definition GuiTypes.h:388
@ kFitWidth
Definition GuiTypes.h:387
@ kHorizontalFrame
Definition GuiTypes.h:383
@ kFixedSize
Definition GuiTypes.h:391
@ kOwnBackground
Definition GuiTypes.h:392
ULong_t Pixel_t
Pixel value.
Definition GuiTypes.h:41
#define f(i)
Definition RSha256.hxx:104
int Int_t
Signed integer 4 bytes (int).
Definition RtypesCore.h:59
unsigned int UInt_t
Unsigned integer 4 bytes (unsigned int).
Definition RtypesCore.h:60
constexpr Bool_t kFALSE
Definition RtypesCore.h:108
@ 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
@ kLHintsExpandX
Definition TGLayout.h:30
void SetModel(TObject *obj) override
Set model object.
void DoLabMode(Int_t type)
Slot for setting tick-mark step mode.
void DoAxesMode(Int_t type)
Slot for setting number of axes.
void DoDrawOrigin()
Slot for setting draw of origin.
void DoDrawCenter()
Slot for setting draw of center.
TEveProjectionAxesEditor(const TEveProjectionAxesEditor &)
Axes for non-linear projections.
Selects different options.
Definition TGButton.h:264
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 AddFrame(TGFrame *f, TGLayoutHints *l=nullptr)
Add frame to the composite frame using the specified layout hints.
Definition TGFrame.cxx:1109
TGCompositeFrame(const TGCompositeFrame &)=delete
UInt_t GetWidth() const
Definition TGFrame.h:226
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:387
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.
ROOT GUI Window base class.
Definition TGWindow.h:23
virtual TGVerticalFrame * CreateEditorTabSubFrame(const char *name)
Create a vertical frame to be used by 'owner' in extra tab 'name'.
TGedFrame(const TGedFrame &)=delete
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:42