ROOT  6.06/09
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; }
43  void SetAlignRight(Bool_t a) { fAlignRight = a; }
44  void SetShowSlider(Bool_t s=kTRUE) { fShowSlider = s; }
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 
90  void SetSliderNewLine(Bool_t nl) { fSliderNewLine = nl; }
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);
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 
174  void GetValues(Float_t& v0, Float_t& v1, Float_t& v2) const
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; }
192  void SetNELength(Int_t l) { fNELength = l; }
193  void SetNEHeight(Int_t h) { fNEHeight = h; }
194 
195  void SetLimits(Int_t min, Int_t max);
198 
199  ClassDef(TEveGTriVecValuator, 0); // Composite GUI element for setting three numerical values (label, three number-entries).
200 };
201 
202 #endif
void SetValue(Int_t i, Float_t v)
TGNumberEntry * GetEntry()
void SetLabelWidth(Int_t w)
Composite GUI element for setting three numerical values (label, three number-entries).
static Vc_ALWAYS_INLINE int_v min(const int_v &x, const int_v &y)
Definition: vector.h:433
void MaxEntryCallback()
Callback for change in high number-entry.
const Double_t * v1
Definition: TArcBall.cxx:33
void SetLimits(Int_t min, Int_t max)
Set limits for all three number-entries, integer values.
void SetNELength(Int_t l)
void ValueSet()
Emit "ValueSet()" signal.
float Float_t
Definition: RtypesCore.h:53
virtual void SetValue(Float_t v, Bool_t emit=kFALSE)
Set value, optionally emit signal.
TGNumberEntry * GetMinEntry()
Float_t GetLimitMax() const
void GetLimits(Float_t &min, Float_t &max) const
void SliderCallback()
Callback for change in slider position.
TH1 * h
Definition: legend2.C:5
void GetValues(Float_t v[3]) const
void SetLimits(Int_t min, Int_t max)
Set limits of the represented range for integer values.
int Int_t
Definition: RtypesCore.h:41
bool Bool_t
Definition: RtypesCore.h:59
TArc * a
Definition: textangle.C:12
const Bool_t kFALSE
Definition: Rtypes.h:92
TEveGValuator * GetValuator(Int_t i) const
virtual void Build(Bool_t connect=kTRUE)=0
void SetToolTip(const char *tip)
Set the tooltip of the number-entry.
void SetAlignRight(Bool_t a)
TGNumberEntry * fEntry
Float_t GetLimitMin() const
void GetValues(Float_t &v0, Float_t &v1, Float_t &v2) const
TGDoubleHSlider * GetSlider()
TGNumberEntry * fMinEntry
Composite GUI element for single value selection (supports label, number-entry and slider)...
void SetSliderNewLine(Bool_t nl)
Float_t GetValue() const
TEveGValuator * fVal[3]
void SliderCallback()
Callback for change in slider position / width.
void SetValues(Float_t v0, Float_t v1, Float_t v2)
virtual Double_t GetNumMin() const
TEveGTriVecValuator & operator=(const TEveGTriVecValuator &)
void Build(Bool_t vertical, const char *lab0, const char *lab1, const char *lab2)
Create sub-components (label, number entries).
void SetNEHeight(Int_t h)
void SetNEHeight(Int_t h)
TEveGDoubleValuator & operator=(const TEveGDoubleValuator &)
TEveGValuator(const TEveGValuator &)
virtual ~TEveGTriVecValuator()
void GetValues(Float_t &min, Float_t &max) const
void SetShowSlider(Bool_t s=kTRUE)
void ValueSet(Double_t)
Emit "ValueSet(Double_t)" signal.
virtual ~TEveGDoubleValuator()
SVector< double, 2 > v
Definition: Dict.h:5
void SetNELength(Int_t l)
TGNumberEntry * fMaxEntry
void ValueSet()
Emit "ValueSet()" signal.
Base class for composite GUI elements for setting of numeric values.
virtual ~TEveGValuatorBase()
unsigned int UInt_t
Definition: RtypesCore.h:42
virtual ~TEveGValuator()
void SetEnabled(Bool_t state)
Set enabled state of the whole widget.
ClassDef(TEveGTriVecValuator, 0)
Float_t GetLimitMin() const
TLine * l
Definition: textangle.C:4
Float_t GetMin() const
virtual Double_t GetNumMax() const
TEveGValuatorBase(const TEveGValuatorBase &)
void SetValues(Double_t v[3])
void SetValues(Float_t v[3])
void SetValues(Float_t min, Float_t max, Bool_t emit=kFALSE)
Set min/max values, optionally emit signal.
virtual void Build(Bool_t connect=kTRUE)
Create sub-components (label, number entry, slider).
void GetValues(Double_t v[3]) const
virtual void Build(Bool_t connect=kTRUE)
Create sub-components (label, number entries, double-slider).
double Double_t
Definition: RtypesCore.h:55
TGHSlider * GetSlider()
TGLabel * GetLabel()
TEveGValuatorBase & operator=(const TEveGValuatorBase &)
static Vc_ALWAYS_INLINE int_v max(const int_v &x, const int_v &y)
Definition: vector.h:440
#define name(a, b)
Definition: linkTestLib0.cpp:5
ClassDef(TEveGDoubleValuator, 0)
ClassDef(TEveGValuatorBase, 0)
Float_t GetValue(Int_t i) const
Float_t GetMax() const
Int_t CalcSliderPos(Float_t v)
Return slider position for given value.
void EntryCallback()
Callback for change in number-entry.
TGHSlider * fSlider
void SetLabelWidth(Int_t w)
TEveGDoubleValuator(const TEveGDoubleValuator &)
TGDoubleHSlider * fSlider
TEveGTriVecValuator(const TEveGTriVecValuator &)
virtual Double_t GetNumber() const
Composite GUI element for selection of range (label, two number-entries and double-slider).
ClassDef(TEveGValuator, 0)
void SetLimits(Int_t min, Int_t max)
Set limits of the represented value for integer values.
TEveGValuator & operator=(const TEveGValuator &)
const Bool_t kTRUE
Definition: Rtypes.h:91
Bool_t fSliderNewLine
Float_t GetLimitMax() const
TGNumberEntry * GetMaxEntry()
void MinEntryCallback()
Callback for change in low number-entry.