Logo ROOT  
Reference Guide
TEveGValuators.h
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 
12 #ifndef ROOT_TEveGValuators
13 #define ROOT_TEveGValuators
14 
15 #include "TGNumberEntry.h"
16 
17 class TGLabel;
18 class TGHSlider;
19 class TGDoubleHSlider;
20 
22 {
23  TEveGValuatorBase(const TEveGValuatorBase&); // Not implemented
24  TEveGValuatorBase& operator=(const TEveGValuatorBase&); // Not implemented
25 
26 protected:
30 
31  Int_t fNELength; // Number-entry length (in characters)
32  Int_t fNEHeight; // Number-entry height (in pixels)
33 
35 
36 public:
37  TEveGValuatorBase(const TGWindow *p, const char* title, UInt_t w, UInt_t h, Int_t widgetId=-1);
38  virtual ~TEveGValuatorBase() {}
39 
40  virtual void Build(Bool_t connect=kTRUE) = 0;
41 
42  void SetLabelWidth(Int_t w) { fLabelWidth = w; }
45 
46  void SetNELength(Int_t l) { fNELength = l; }
47  void SetNEHeight(Int_t h) { fNEHeight = h; }
48 
49  TGLabel* GetLabel() {return fLabel;}
50 
51  ClassDef(TEveGValuatorBase, 0); // Base class for composite GUI elements for setting of numeric values.
52 };
53 
54 
55 /******************************************************************************/
56 
58 {
59  TEveGValuator(const TEveGValuator&); // Not implemented
60  TEveGValuator& operator=(const TEveGValuator&); // Not implemented
61 
62 protected:
66 
71 
73 
74 public:
75  TEveGValuator(const TGWindow *p, const char* title, UInt_t w, UInt_t h, Int_t widgetId=-1);
76  virtual ~TEveGValuator() {}
77 
78  virtual void Build(Bool_t connect=kTRUE);
79 
80  Float_t GetValue() const { return fValue; }
81  virtual void SetValue(Float_t v, Bool_t emit=kFALSE);
82 
83  void SliderCallback();
84  void EntryCallback();
85  void ValueSet(Double_t); //*SIGNAL*
86 
87  TGHSlider* GetSlider() { return fSlider; }
88  TGNumberEntry* GetEntry() { return fEntry; }
89 
91 
92  void GetLimits(Float_t& min, Float_t& max) const { min = fMin; max = fMax; }
93  Float_t GetLimitMin() const { return fMin; }
94  Float_t GetLimitMax() const { return fMax; }
95  void SetLimits(Int_t min, Int_t max);
96  void SetLimits(Float_t min, Float_t max, Int_t npos,
98 
99  void SetToolTip(const char* tip);
100  void SetEnabled(Bool_t state);
101 
102  ClassDef(TEveGValuator, 0); // Composite GUI element for single value selection (supports label, number-entry and slider).
103 };
104 
105 
106 /******************************************************************************/
107 
109 {
110  TEveGDoubleValuator(const TEveGDoubleValuator&); // Not implemented
111  TEveGDoubleValuator& operator=(const TEveGDoubleValuator&); // Not implemented
112 
113 protected:
117 
118 public:
119  TEveGDoubleValuator(const TGWindow *p, const char* title, UInt_t w, UInt_t h, Int_t widgetId=-1);
120  virtual ~TEveGDoubleValuator() {}
121 
122  virtual void Build(Bool_t connect=kTRUE);
123 
124  void MinEntryCallback();
125  void MaxEntryCallback();
126  void SliderCallback();
127  void ValueSet(); //*SIGNAL*
128 
132 
133  void SetLimits(Int_t min, Int_t max);
135  void SetValues(Float_t min, Float_t max, Bool_t emit=kFALSE);
136 
137  void GetValues(Float_t& min, Float_t& max) const
138  { min = fMinEntry->GetNumber(); max = fMaxEntry->GetNumber(); }
139  Float_t GetMin() const { return fMinEntry->GetNumber(); }
140  Float_t GetMax() const { return fMaxEntry->GetNumber(); }
141  Float_t GetLimitMin() const { return fMinEntry->GetNumMin(); }
142  Float_t GetLimitMax() const { return fMaxEntry->GetNumMax(); }
143 
144  ClassDef(TEveGDoubleValuator, 0); // Composite GUI element for selection of range (label, two number-entries and double-slider).
145 };
146 
147 
148 /******************************************************************************/
149 
151 {
152  TEveGTriVecValuator(const TEveGTriVecValuator&); // Not implemented
153  TEveGTriVecValuator& operator=(const TEveGTriVecValuator&); // Not implemented
154 
155 protected:
157 
158  // Weed-size vars from TEveGValuator; copied.
160  Int_t fNELength; // Number-entry length (in characters)
161  Int_t fNEHeight; // Number-entry height (in pixels)
162 
163 public:
164  TEveGTriVecValuator(const TGWindow *p, const char* name, UInt_t w, UInt_t h, Int_t widgetId=-1);
165  virtual ~TEveGTriVecValuator() {}
166 
167  void Build(Bool_t vertical, const char* lab0, const char* lab1, const char* lab2);
168 
169  TEveGValuator* GetValuator(Int_t i) const { return fVal[i]; }
170 
171  Float_t GetValue(Int_t i) const { return fVal[i]->GetValue(); }
172  void SetValue(Int_t i, Float_t v) { fVal[i]->SetValue(v); }
173 
175  { v0 = GetValue(0); v1 = GetValue(1); v2 = GetValue(2); }
176  void GetValues(Float_t v[3]) const
177  { v[0] = GetValue(0); v[1] = GetValue(1); v[2] = GetValue(2); }
178  void GetValues(Double_t v[3]) const
179  { v[0] = GetValue(0); v[1] = GetValue(1); v[2] = GetValue(2); }
180 
182  { SetValue(0, v0); SetValue(1, v1); SetValue(2, v2); }
183  void SetValues(Float_t v[3])
184  { SetValue(0, v[0]); SetValue(1, v[1]); SetValue(2, v[2]); }
186  { SetValue(0, v[0]); SetValue(1, v[1]); SetValue(2, v[2]); }
187 
188  void ValueSet(); //*SIGNAL*
189 
190  // Weed-size vars from TEveGValuator; copied.
191  void SetLabelWidth(Int_t w) { fLabelWidth = w; }
194 
195  void SetLimits(Int_t min, Int_t max);
196  void SetLimits(Float_t min, Float_t max,
198 
199  ClassDef(TEveGTriVecValuator, 0); // Composite GUI element for setting three numerical values (label, three number-entries).
200 };
201 
202 #endif
l
auto * l
Definition: textangle.C:4
TEveGValuator::ValueSet
void ValueSet(Double_t)
Emit "ValueSet(Double_t)" signal.
Definition: TEveGValuators.cxx:198
TEveGTriVecValuator::~TEveGTriVecValuator
virtual ~TEveGTriVecValuator()
Definition: TEveGValuators.h:165
TEveGValuatorBase
Base class for composite GUI elements for setting of numeric values.
Definition: TEveGValuators.h:22
TGWindow
Definition: TGWindow.h:31
kTRUE
const Bool_t kTRUE
Definition: RtypesCore.h:91
v0
@ v0
Definition: rootcling_impl.cxx:3636
TEveGTriVecValuator::SetValues
void SetValues(Float_t v0, Float_t v1, Float_t v2)
Definition: TEveGValuators.h:181
TEveGTriVecValuator
Composite GUI element for setting three numerical values (label, three number-entries).
Definition: TEveGValuators.h:151
TEveGTriVecValuator::GetValuator
TEveGValuator * GetValuator(Int_t i) const
Definition: TEveGValuators.h:169
TEveGDoubleValuator::operator=
TEveGDoubleValuator & operator=(const TEveGDoubleValuator &)
TEveGTriVecValuator::Build
void Build(Bool_t vertical, const char *lab0, const char *lab1, const char *lab2)
Create sub-components (label, number entries).
Definition: TEveGValuators.cxx:437
TEveGTriVecValuator::SetValues
void SetValues(Double_t v[3])
Definition: TEveGValuators.h:185
TEveGValuator::EntryCallback
void EntryCallback()
Callback for change in number-entry.
Definition: TEveGValuators.cxx:175
TEveGValuator::fSlider
TGHSlider * fSlider
Definition: TEveGValuators.h:70
TEveGValuator
Composite GUI element for single value selection (supports label, number-entry and slider).
Definition: TEveGValuators.h:58
TEveGValuator::TEveGValuator
TEveGValuator(const TEveGValuator &)
TGLabel
Definition: TGLabel.h:32
TEveGDoubleValuator::~TEveGDoubleValuator
virtual ~TEveGDoubleValuator()
Definition: TEveGValuators.h:120
TGHSlider
Definition: TGSlider.h:154
Float_t
float Float_t
Definition: RtypesCore.h:57
TGeant4Unit::s
static constexpr double s
Definition: TGeant4SystemOfUnits.h:162
TEveGValuator::GetSlider
TGHSlider * GetSlider()
Definition: TEveGValuators.h:87
Int_t
int Int_t
Definition: RtypesCore.h:45
TGWidget
Definition: TGWidget.h:55
TEveGValuator::fMax
Float_t fMax
Definition: TEveGValuators.h:65
TEveGDoubleValuator::GetMin
Float_t GetMin() const
Definition: TEveGValuators.h:139
TEveGValuatorBase::fLabel
TGLabel * fLabel
Definition: TEveGValuators.h:34
TEveGDoubleValuator::GetMaxEntry
TGNumberEntry * GetMaxEntry()
Definition: TEveGValuators.h:131
TEveGTriVecValuator::GetValues
void GetValues(Float_t &v0, Float_t &v1, Float_t &v2) const
Definition: TEveGValuators.h:174
TEveGValuator::GetValue
Float_t GetValue() const
Definition: TEveGValuators.h:80
TEveGValuatorBase::Build
virtual void Build(Bool_t connect=kTRUE)=0
TGNumberFormat::kNESRealTwo
@ kNESRealTwo
Definition: TGNumberEntry.h:36
TEveGValuator::~TEveGValuator
virtual ~TEveGValuator()
Definition: TEveGValuators.h:76
TEveGValuatorBase::SetAlignRight
void SetAlignRight(Bool_t a)
Definition: TEveGValuators.h:43
TEveGTriVecValuator::operator=
TEveGTriVecValuator & operator=(const TEveGTriVecValuator &)
TEveGTriVecValuator::SetLabelWidth
void SetLabelWidth(Int_t w)
Definition: TEveGValuators.h:191
TEveGDoubleValuator::fMinEntry
TGNumberEntry * fMinEntry
Definition: TEveGValuators.h:114
Bool_t
bool Bool_t
Definition: RtypesCore.h:63
v
@ v
Definition: rootcling_impl.cxx:3635
TEveGTriVecValuator::GetValues
void GetValues(Float_t v[3]) const
Definition: TEveGValuators.h:176
bool
TEveGDoubleValuator::Build
virtual void Build(Bool_t connect=kTRUE)
Create sub-components (label, number entries, double-slider).
Definition: TEveGValuators.cxx:264
TEveGTriVecValuator::TEveGTriVecValuator
TEveGTriVecValuator(const TEveGTriVecValuator &)
TEveGValuator::Build
virtual void Build(Bool_t connect=kTRUE)
Create sub-components (label, number entry, slider).
Definition: TEveGValuators.cxx:74
TEveGValuatorBase::SetNEHeight
void SetNEHeight(Int_t h)
Definition: TEveGValuators.h:47
TEveGTriVecValuator::ValueSet
void ValueSet()
Emit "ValueSet()" signal.
Definition: TEveGValuators.cxx:462
TEveGValuatorBase::fAlignRight
Bool_t fAlignRight
Definition: TEveGValuators.h:28
TEveGValuator::SetLimits
void SetLimits(Int_t min, Int_t max)
Set limits of the represented value for integer values.
Definition: TEveGValuators.cxx:151
TEveGDoubleValuator::GetLimitMin
Float_t GetLimitMin() const
Definition: TEveGValuators.h:141
TEveGDoubleValuator::fMaxEntry
TGNumberEntry * fMaxEntry
Definition: TEveGValuators.h:115
TEveGDoubleValuator::MinEntryCallback
void MinEntryCallback()
Callback for change in low number-entry.
Definition: TEveGValuators.cxx:360
TGDoubleHSlider
Definition: TGDoubleSlider.h:180
TEveGDoubleValuator::SetLimits
void SetLimits(Int_t min, Int_t max)
Set limits of the represented range for integer values.
Definition: TEveGValuators.cxx:330
TEveGValuatorBase::TEveGValuatorBase
TEveGValuatorBase(const TEveGValuatorBase &)
TEveGValuator::GetEntry
TGNumberEntry * GetEntry()
Definition: TEveGValuators.h:88
h
#define h(i)
Definition: RSha256.hxx:106
TEveGValuator::CalcSliderPos
Int_t CalcSliderPos(Float_t v)
Return slider position for given value.
Definition: TEveGValuators.cxx:167
a
auto * a
Definition: textangle.C:12
TEveGTriVecValuator::SetValues
void SetValues(Float_t v[3])
Definition: TEveGValuators.h:183
kFALSE
const Bool_t kFALSE
Definition: RtypesCore.h:92
TEveGValuatorBase::SetShowSlider
void SetShowSlider(Bool_t s=kTRUE)
Definition: TEveGValuators.h:44
TEveGValuator::fMin
Float_t fMin
Definition: TEveGValuators.h:64
TEveGValuatorBase::GetLabel
TGLabel * GetLabel()
Definition: TEveGValuators.h:49
TEveGTriVecValuator::SetNELength
void SetNELength(Int_t l)
Definition: TEveGValuators.h:192
TEveGDoubleValuator::SetValues
void SetValues(Float_t min, Float_t max, Bool_t emit=kFALSE)
Set min/max values, optionally emit signal.
Definition: TEveGValuators.cxx:394
TEveGValuatorBase::SetNELength
void SetNELength(Int_t l)
Definition: TEveGValuators.h:46
TEveGValuator::SetValue
virtual void SetValue(Float_t v, Bool_t emit=kFALSE)
Set value, optionally emit signal.
Definition: TEveGValuators.cxx:206
TEveGDoubleValuator
Composite GUI element for selection of range (label, two number-entries and double-slider).
Definition: TEveGValuators.h:109
TEveGValuator::operator=
TEveGValuator & operator=(const TEveGValuator &)
TEveGDoubleValuator::TEveGDoubleValuator
TEveGDoubleValuator(const TEveGDoubleValuator &)
TEveGValuatorBase::fNELength
Int_t fNELength
Definition: TEveGValuators.h:31
TEveGValuator::fSliderNewLine
Bool_t fSliderNewLine
Definition: TEveGValuators.h:67
TEveGDoubleValuator::GetMax
Float_t GetMax() const
Definition: TEveGValuators.h:140
TEveGValuator::SliderCallback
void SliderCallback()
Callback for change in slider position.
Definition: TEveGValuators.cxx:187
TEveGDoubleValuator::GetSlider
TGDoubleHSlider * GetSlider()
Definition: TEveGValuators.h:129
unsigned int
TEveGTriVecValuator::fVal
TEveGValuator * fVal[3]
Definition: TEveGValuators.h:156
TEveGValuatorBase::operator=
TEveGValuatorBase & operator=(const TEveGValuatorBase &)
TEveGDoubleValuator::ValueSet
void ValueSet()
Emit "ValueSet()" signal.
Definition: TEveGValuators.cxx:406
TEveGTriVecValuator::SetValue
void SetValue(Int_t i, Float_t v)
Definition: TEveGValuators.h:172
TEveGValuatorBase::fLabelWidth
UInt_t fLabelWidth
Definition: TEveGValuators.h:27
TEveGDoubleValuator::fSlider
TGDoubleHSlider * fSlider
Definition: TEveGValuators.h:116
TEveGValuator::GetLimitMin
Float_t GetLimitMin() const
Definition: TEveGValuators.h:93
TEveGDoubleValuator::GetMinEntry
TGNumberEntry * GetMinEntry()
Definition: TEveGValuators.h:130
TEveGValuator::SetToolTip
void SetToolTip(const char *tip)
Set the tooltip of the number-entry.
Definition: TEveGValuators.cxx:221
TEveGTriVecValuator::fNEHeight
Int_t fNEHeight
Definition: TEveGValuators.h:161
v1
@ v1
Definition: rootcling_impl.cxx:3637
Double_t
double Double_t
Definition: RtypesCore.h:59
TEveGValuator::fSliderDivs
Int_t fSliderDivs
Definition: TEveGValuators.h:68
TEveGValuatorBase::~TEveGValuatorBase
virtual ~TEveGValuatorBase()
Definition: TEveGValuators.h:38
TEveGValuator::GetLimits
void GetLimits(Float_t &min, Float_t &max) const
Definition: TEveGValuators.h:92
TEveGTriVecValuator::SetNEHeight
void SetNEHeight(Int_t h)
Definition: TEveGValuators.h:193
TEveGTriVecValuator::SetLimits
void SetLimits(Int_t min, Int_t max)
Set limits for all three number-entries, integer values.
Definition: TEveGValuators.cxx:470
TEveGValuator::fEntry
TGNumberEntry * fEntry
Definition: TEveGValuators.h:69
TEveGDoubleValuator::GetLimitMax
Float_t GetLimitMax() const
Definition: TEveGValuators.h:142
v2
@ v2
Definition: rootcling_impl.cxx:3638
ClassDef
#define ClassDef(name, id)
Definition: Rtypes.h:325
TEveGValuatorBase::SetLabelWidth
void SetLabelWidth(Int_t w)
Definition: TEveGValuators.h:42
TEveGValuator::SetSliderNewLine
void SetSliderNewLine(Bool_t nl)
Definition: TEveGValuators.h:90
name
char name[80]
Definition: TGX11.cxx:110
TEveGDoubleValuator::GetValues
void GetValues(Float_t &min, Float_t &max) const
Definition: TEveGValuators.h:137
TEveGDoubleValuator::SliderCallback
void SliderCallback()
Callback for change in slider position / width.
Definition: TEveGValuators.cxx:382
TGNumberEntry.h
TGNumberEntry::GetNumber
virtual Double_t GetNumber() const
Definition: TGNumberEntry.h:206
TEveGValuator::GetLimitMax
Float_t GetLimitMax() const
Definition: TEveGValuators.h:94
TEveGTriVecValuator::fNELength
Int_t fNELength
Definition: TEveGValuators.h:160
TGNumberEntry
Definition: TGNumberEntry.h:157
TEveGTriVecValuator::GetValue
Float_t GetValue(Int_t i) const
Definition: TEveGValuators.h:171
TEveGValuator::SetEnabled
void SetEnabled(Bool_t state)
Set enabled state of the whole widget.
Definition: TEveGValuators.cxx:229
TGCompositeFrame
Definition: TGFrame.h:324
TEveGValuatorBase::fNEHeight
Int_t fNEHeight
Definition: TEveGValuators.h:32
TEveGDoubleValuator::MaxEntryCallback
void MaxEntryCallback()
Callback for change in high number-entry.
Definition: TEveGValuators.cxx:371
TGNumberFormat::EStyle
EStyle
Definition: TGNumberEntry.h:33
TGNumberEntry::GetNumMax
virtual Double_t GetNumMax() const
Definition: TGNumberEntry.h:245
TEveGValuatorBase::fShowSlider
Bool_t fShowSlider
Definition: TEveGValuators.h:29
TEveGValuator::fValue
Float_t fValue
Definition: TEveGValuators.h:63
TGNumberEntry::GetNumMin
virtual Double_t GetNumMin() const
Definition: TGNumberEntry.h:242
TEveGTriVecValuator::fLabelWidth
UInt_t fLabelWidth
Definition: TEveGValuators.h:159
TEveGTriVecValuator::GetValues
void GetValues(Double_t v[3]) const
Definition: TEveGValuators.h:178
int