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);
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);
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);
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 {
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);
81 fDx->Build();
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);
91 fDy->Build();
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);
101 fDz->Build();
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
144
145////////////////////////////////////////////////////////////////////////////////
146/// Slot for changing fD's.
147
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: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:108
@ 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.
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:1109
A composite frame with a border and a title.
Definition TGFrame.h:524
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.
A composite frame that layout their children in vertical way.
Definition TGFrame.h:376
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:94
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:865
TMarker m
Definition textangle.C:8