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
22
23////////////////////////////////////////////////////////////////////////////////
24/// Constructor.
25
28 fM (nullptr),
29 fNx(nullptr), fNy(nullptr), fNz(nullptr),
30 fDx(nullptr), fDy(nullptr), fDz(nullptr)
31{
32 Int_t labelW = 15;
33
35
36 {
37 TGGroupFrame* f = new TGGroupFrame(hf, "NumRows", kVerticalFrame);
38 f->SetWidth(30);
39 hf->AddFrame(f, new TGLayoutHints(kLHintsTop, 1, 1, 1, 0));
40
41 fNx = new TEveGValuator(f,"X:", 200, 0);
42 fNx->SetNELength(3);
43 fNx->SetLabelWidth(labelW);
45 fNx->Build();
46 fNx->SetLimits(1, 15);
47 fNx->Connect("ValueSet(Double_t)",
48 "TEveGridStepperSubEditor", this, "DoNs()");
49 f->AddFrame(fNx, new TGLayoutHints(kLHintsTop, 1, 1, 1, 1));
50
51 fNy = new TEveGValuator(f,"Y:", 200, 0);
52 fNy->SetNELength(3);
53 fNy->SetLabelWidth(labelW);
55 fNy->Build();
56 fNy->SetLimits(1, 15);
57 fNy->Connect("ValueSet(Double_t)",
58 "TEveGridStepperSubEditor", this, "DoNs()");
59 f->AddFrame(fNy, new TGLayoutHints(kLHintsTop, 1, 1, 1, 1));
60
61 fNz = new TEveGValuator(f,"Z:", 200, 0);
62 fNz->SetNELength(3);
63 fNz->SetLabelWidth(labelW);
65 fNz->Build();
66 fNz->SetLimits(1, 15);
67 fNz->Connect("ValueSet(Double_t)",
68 "TEveGridStepperSubEditor", this, "DoNs()");
69 f->AddFrame(fNz, new TGLayoutHints(kLHintsTop, 1, 1, 1, 1));
70
71 //AddFrame(f, new TGLayoutHints(kLHintsExpandX, 2, 0, 0, 0));
72 }
73 {
74 TGGroupFrame* f = new TGGroupFrame(hf, "Step", kVerticalFrame);
75 f->SetWidth(130);
76 hf->AddFrame(f, new TGLayoutHints(kLHintsTop, 1, 1, 1, 0));
77
78 fDx = new TEveGValuator(f,"X:", 200, 0);
79 fDx->SetNELength(5);
80 fDx->SetLabelWidth(labelW);
82 fDx->Build();
84 fDx->Connect("ValueSet(Double_t)",
85 "TEveGridStepperSubEditor", this, "DoDs()");
86 f->AddFrame(fDx, new TGLayoutHints(kLHintsTop, 1, 1, 1, 1));
87
88 fDy = new TEveGValuator(f,"Y:", 200, 0);
89 fDy->SetNELength(5);
90 fDy->SetLabelWidth(labelW);
92 fDy->Build();
94 fDy->Connect("ValueSet(Double_t)",
95 "TEveGridStepperSubEditor", this, "DoDs()");
96 f->AddFrame(fDy, new TGLayoutHints(kLHintsTop, 1, 1, 1, 1));
97
98 fDz = new TEveGValuator(f,"Z:", 200, 0);
99 fDz->SetNELength(5);
100 fDz->SetLabelWidth(labelW);
102 fDz->Build();
104 fDz->Connect("ValueSet(Double_t)",
105 "TEveGridStepperSubEditor", this, "DoDs()");
106 f->AddFrame(fDz, new TGLayoutHints(kLHintsTop, 1, 1, 1, 1));
107
108 //AddFrame(f, new TGLayoutHints(kLHintsExpandX, 2, 0, 0, 0));
109 }
110 AddFrame(hf, new TGLayoutHints(kLHintsExpandX, 2, 0, 0, 0));
111}
112
113////////////////////////////////////////////////////////////////////////////////
114/// Set model object.
115
117{
118 fM = m;
119
120 fNx->SetValue(fM->fNx);
121 fNy->SetValue(fM->fNy);
122 fNz->SetValue(fM->fNz);
123
124 fDx->SetValue(fM->fDx);
125 fDy->SetValue(fM->fDy);
126 fDz->SetValue(fM->fDz);
127}
128
129////////////////////////////////////////////////////////////////////////////////
130/// Emit Changed signal.
131
133{
134 Emit("Changed()");
135}
136
137////////////////////////////////////////////////////////////////////////////////
138/// Slot for changing fN's.
139
141{
143 Changed();
144}
145
146////////////////////////////////////////////////////////////////////////////////
147/// Slot for changing fD's.
148
150{
152 Changed();
153}
154
155/** \class TEveGridStepperEditor
156\ingroup TEve
157Editor for TEveGridStepper class.
158*/
159
161
162////////////////////////////////////////////////////////////////////////////////
163/// Constructor.
164
166 UInt_t options, Pixel_t back) :
167 TGedFrame(p, width, height, options | kVerticalFrame, back),
168 fM (nullptr),
169 fSE (nullptr)
170{
171 MakeTitle("TEveGridStepper");
172
173 fSE = new TEveGridStepperSubEditor(this);
174 AddFrame(fSE, new TGLayoutHints(kLHintsTop, 2, 0, 2, 2));
175 fSE->Connect("Changed()", "TEveGridStepperEditor", this, "Update()");
176}
177
178////////////////////////////////////////////////////////////////////////////////
179/// Set model object.
180
182{
183 fM = dynamic_cast<TEveGridStepper*>(obj);
184 fSE->SetModel(fM);
185}
@ 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:101
#define ClassImp(name)
Definition Rtypes.h:377
@ kLHintsTop
Definition TGLayout.h:27
@ kLHintsExpandX
Definition TGLayout.h:30
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 height
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 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.
Editor for TEveGridStepper class.
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.
void SetDs(Float_t dx, Float_t dy, Float_t dz=0)
void SetNs(Int_t nx, Int_t ny, Int_t nz=1)
virtual void AddFrame(TGFrame *f, TGLayoutHints *l=nullptr)
Add frame to the composite frame using the specified layout hints.
Definition TGFrame.cxx:1117
A composite frame with a border and a title.
Definition TGFrame.h:522
A composite frame that layout their children in horizontal way.
Definition TGFrame.h:385
This class describes layout hints used by the layout classes.
Definition TGLayout.h:50
@ kNESRealOne
Fixed fraction real, one 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
Mother of all ROOT objects.
Definition TObject.h:41
void Emit(const char *signal, const T &arg)
Activate signal with single parameter.
Definition TQObject.h:164
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
TMarker m
Definition textangle.C:8