Logo ROOT  
Reference Guide
Loading...
Searching...
No Matches
TEveGridStepperEditor.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
13#include "TEveGridStepper.h"
14#include "TEveGValuators.h"
15
16/** \class TEveGridStepperSubEditor
17\ingroup TEve
18Sub-editor for TEveGridStepper class.
19*/
20
21
22////////////////////////////////////////////////////////////////////////////////
23/// Constructor.
24
27 fM (nullptr),
28 fNx(nullptr), fNy(nullptr), fNz(nullptr),
29 fDx(nullptr), fDy(nullptr), fDz(nullptr)
30{
31 Int_t labelW = 15;
32
34
35 {
36 TGGroupFrame* f = new TGGroupFrame(hf, "NumRows", kVerticalFrame);
37 f->SetWidth(30);
38 hf->AddFrame(f, new TGLayoutHints(kLHintsTop, 1, 1, 1, 0));
39
40 fNx = new TEveGValuator(f,"X:", 200, 0);
41 fNx->SetNELength(3);
42 fNx->SetLabelWidth(labelW);
43 fNx->SetShowSlider(kFALSE);
44 fNx->Build();
45 fNx->SetLimits(1, 15);
46 fNx->Connect("ValueSet(Double_t)",
47 "TEveGridStepperSubEditor", this, "DoNs()");
48 f->AddFrame(fNx, new TGLayoutHints(kLHintsTop, 1, 1, 1, 1));
49
50 fNy = new TEveGValuator(f,"Y:", 200, 0);
51 fNy->SetNELength(3);
52 fNy->SetLabelWidth(labelW);
53 fNy->SetShowSlider(kFALSE);
54 fNy->Build();
55 fNy->SetLimits(1, 15);
56 fNy->Connect("ValueSet(Double_t)",
57 "TEveGridStepperSubEditor", this, "DoNs()");
58 f->AddFrame(fNy, new TGLayoutHints(kLHintsTop, 1, 1, 1, 1));
59
60 fNz = new TEveGValuator(f,"Z:", 200, 0);
61 fNz->SetNELength(3);
62 fNz->SetLabelWidth(labelW);
63 fNz->SetShowSlider(kFALSE);
64 fNz->Build();
65 fNz->SetLimits(1, 15);
66 fNz->Connect("ValueSet(Double_t)",
67 "TEveGridStepperSubEditor", this, "DoNs()");
68 f->AddFrame(fNz, new TGLayoutHints(kLHintsTop, 1, 1, 1, 1));
69
70 //AddFrame(f, new TGLayoutHints(kLHintsExpandX, 2, 0, 0, 0));
71 }
72 {
73 TGGroupFrame* f = new TGGroupFrame(hf, "Step", kVerticalFrame);
74 f->SetWidth(130);
75 hf->AddFrame(f, new TGLayoutHints(kLHintsTop, 1, 1, 1, 0));
76
77 fDx = new TEveGValuator(f,"X:", 200, 0);
78 fDx->SetNELength(5);
79 fDx->SetLabelWidth(labelW);
80 fDx->SetShowSlider(kFALSE);
81 fDx->Build();
82 fDx->SetLimits(0.1, 100, 101, TGNumberFormat::kNESRealOne);
83 fDx->Connect("ValueSet(Double_t)",
84 "TEveGridStepperSubEditor", this, "DoDs()");
85 f->AddFrame(fDx, new TGLayoutHints(kLHintsTop, 1, 1, 1, 1));
86
87 fDy = new TEveGValuator(f,"Y:", 200, 0);
88 fDy->SetNELength(5);
89 fDy->SetLabelWidth(labelW);
90 fDy->SetShowSlider(kFALSE);
91 fDy->Build();
92 fDy->SetLimits(0.1, 100, 101, TGNumberFormat::kNESRealOne);
93 fDy->Connect("ValueSet(Double_t)",
94 "TEveGridStepperSubEditor", this, "DoDs()");
95 f->AddFrame(fDy, new TGLayoutHints(kLHintsTop, 1, 1, 1, 1));
96
97 fDz = new TEveGValuator(f,"Z:", 200, 0);
98 fDz->SetNELength(5);
99 fDz->SetLabelWidth(labelW);
100 fDz->SetShowSlider(kFALSE);
101 fDz->Build();
102 fDz->SetLimits(0.1, 100, 101, TGNumberFormat::kNESRealOne);
103 fDz->Connect("ValueSet(Double_t)",
104 "TEveGridStepperSubEditor", this, "DoDs()");
105 f->AddFrame(fDz, new TGLayoutHints(kLHintsTop, 1, 1, 1, 1));
106
107 //AddFrame(f, new TGLayoutHints(kLHintsExpandX, 2, 0, 0, 0));
108 }
109 AddFrame(hf, new TGLayoutHints(kLHintsExpandX, 2, 0, 0, 0));
110}
111
112////////////////////////////////////////////////////////////////////////////////
113/// Set model object.
114
116{
117 fM = m;
118
119 fNx->SetValue(fM->fNx);
120 fNy->SetValue(fM->fNy);
121 fNz->SetValue(fM->fNz);
122
123 fDx->SetValue(fM->fDx);
124 fDy->SetValue(fM->fDy);
125 fDz->SetValue(fM->fDz);
126}
127
128////////////////////////////////////////////////////////////////////////////////
129/// Emit Changed signal.
130
132{
133 Emit("Changed()");
134}
135
136////////////////////////////////////////////////////////////////////////////////
137/// Slot for changing fN's.
138
140{
141 fM->SetNs((Int_t)fNx->GetValue(), (Int_t)fNy->GetValue(), (Int_t)fNz->GetValue());
142 Changed();
143}
144
145////////////////////////////////////////////////////////////////////////////////
146/// Slot for changing fD's.
147
149{
150 fM->SetDs(fDx->GetValue(), fDy->GetValue(), fDz->GetValue());
151 Changed();
152}
153
154/** \class TEveGridStepperEditor
155\ingroup TEve
156Editor for TEveGridStepper class.
157*/
158
159
160////////////////////////////////////////////////////////////////////////////////
161/// Constructor.
162
164 UInt_t options, Pixel_t back) :
165 TGedFrame(p, width, height, options | kVerticalFrame, back),
166 fM (nullptr),
167 fSE (nullptr)
168{
169 MakeTitle("TEveGridStepper");
170
171 fSE = new TEveGridStepperSubEditor(this);
172 AddFrame(fSE, new TGLayoutHints(kLHintsTop, 2, 0, 2, 2));
173 fSE->Connect("Changed()", "TEveGridStepperEditor", this, "Update()");
174}
175
176////////////////////////////////////////////////////////////////////////////////
177/// Set model object.
178
180{
181 fM = dynamic_cast<TEveGridStepper*>(obj);
182 fSE->SetModel(fM);
183}
@ kVerticalFrame
Definition GuiTypes.h:382
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
@ kLHintsTop
Definition TGLayout.h:27
@ kLHintsExpandX
Definition TGLayout.h:30
Composite GUI element for single value selection (supports label, number-entry and slider).
void SetModel(TObject *obj) override
Set model object.
TEveGridStepperSubEditor * fSE
TEveGridStepperEditor(const TEveGridStepperEditor &)
Sub-editor for TEveGridStepper class.
void Changed()
Emit Changed signal.
void DoNs()
Slot for changing fN's.
void DoDs()
Slot for changing fD's.
TEveGridStepperSubEditor(const TEveGridStepperSubEditor &)
void SetModel(TEveGridStepper *m)
Set model object.
Provide discrete position coordinates for placement of objects on regular grids.
virtual void AddFrame(TGFrame *f, TGLayoutHints *l=nullptr)
Add frame to the composite frame using the specified layout hints.
Definition TGFrame.cxx:1109
A composite frame with a border and a title.
Definition TGFrame.h:532
A composite frame that layout their children in horizontal way.
Definition TGFrame.h:387
This class describes layout hints used by the layout classes.
Definition TGLayout.h:50
@ kNESRealOne
Fixed fraction real, one digit.
TGVerticalFrame(const TGWindow *p=nullptr, UInt_t w=1, UInt_t h=1, UInt_t options=kChildFrame, Pixel_t back=GetDefaultFrameBackground())
Definition TGFrame.h:378
ROOT GUI Window base class.
Definition TGWindow.h:23
TGedFrame(const TGedFrame &)=delete
virtual void MakeTitle(const char *title)
Create attribute frame title.
Definition TGedFrame.cxx:94
Mother of all ROOT objects.
Definition TObject.h:42
void Emit(const char *signal, const T &arg)
Activate signal with single parameter.
Definition TQObject.h:164
TMarker m
Definition textangle.C:8