Logo ROOT   6.08/07
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 
72  Int_t CalcSliderPos(Float_t v);
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 
129  TGDoubleHSlider* GetSlider() { return fSlider; }
130  TGNumberEntry* GetMinEntry() { return fMinEntry; }
131  TGNumberEntry* GetMaxEntry() { return fMaxEntry; }
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:
156  TEveGValuator* fVal[3];
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 
181  void SetValues(Float_t v0, Float_t v1, Float_t v2)
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);
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
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).
Float_t GetLimitMin() const
void GetValues(Float_t &min, Float_t &max) const
void SetNELength(Int_t l)
float Float_t
Definition: RtypesCore.h:53
virtual void SetValue(Float_t v, Bool_t emit=kFALSE)
Set value, optionally emit signal.
TGNumberEntry * GetMinEntry()
TH1 * h
Definition: legend2.C:5
Float_t GetLimitMax() const
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
virtual void Build(Bool_t connect=kTRUE)=0
void SetAlignRight(Bool_t a)
TGNumberEntry * fEntry
TGDoubleHSlider * GetSlider()
TGNumberEntry * fMinEntry
Composite GUI element for single value selection (supports label, number-entry and slider)...
void SetSliderNewLine(Bool_t nl)
#define ClassDef(name, id)
Definition: Rtypes.h:254
Float_t GetMax() const
void SetValues(Float_t v0, Float_t v1, Float_t v2)
TEveGValuator * GetValuator(Int_t i) const
void GetLimits(Float_t &min, Float_t &max) const
void SetNEHeight(Int_t h)
void SetNEHeight(Int_t h)
virtual Double_t GetNumMin() const
virtual ~TEveGTriVecValuator()
void SetShowSlider(Bool_t s=kTRUE)
virtual ~TEveGDoubleValuator()
Float_t GetLimitMax() const
SVector< double, 2 > v
Definition: Dict.h:5
void SetNELength(Int_t l)
PyObject * fValue
TGNumberEntry * fMaxEntry
Base class for composite GUI elements for setting of numeric values.
virtual ~TEveGValuatorBase()
unsigned int UInt_t
Definition: RtypesCore.h:42
Float_t GetValue(Int_t i) const
virtual ~TEveGValuator()
TLine * l
Definition: textangle.C:4
TEveGValuatorBase(const TEveGValuatorBase &)
void SetValues(Double_t v[3])
void SetValues(Float_t v[3])
void GetValues(Double_t v[3]) const
double Double_t
Definition: RtypesCore.h:55
TGHSlider * GetSlider()
virtual Double_t GetNumber() const
TGLabel * GetLabel()
TEveGValuatorBase & operator=(const TEveGValuatorBase &)
void GetValues(Float_t &v0, Float_t &v1, Float_t &v2) const
Float_t GetMin() const
virtual Double_t GetNumMax() const
void GetValues(Float_t v[3]) const
TGHSlider * fSlider
void SetLabelWidth(Int_t w)
TGDoubleHSlider * fSlider
Composite GUI element for selection of range (label, two number-entries and double-slider).
Float_t GetLimitMin() const
const Bool_t kTRUE
Definition: Rtypes.h:91
Bool_t fSliderNewLine
TGNumberEntry * GetMaxEntry()
char name[80]
Definition: TGX11.cxx:109
Float_t GetValue() const