Logo ROOT  
Reference Guide
TEveParamList.h
Go to the documentation of this file.
1 // @(#)root/eve:$Id$
2 // Author: Dmytro Kovalskyi, 28.2.2008
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_TEveParamList
13 #define ROOT_TEveParamList
14 
15 #include "TEveElement.h"
16 #include "TQObject.h"
17 #include <vector>
18 
19 //==============================================================================
20 //==============================================================================
21 // TEveParamList
22 //==============================================================================
23 
24 class TEveParamList : public TEveElement,
25  public TNamed,
26  public TQObject
27 {
28  friend class TEveParamListEditor;
29 
30 public:
31  struct FloatConfig_t
32  {
36 
38  fValue(value), fMin(min), fMax(max), fName(name), fSelector(selector) {}
40  };
41  typedef std::vector<FloatConfig_t> FloatConfigVec_t;
42  typedef FloatConfigVec_t::iterator FloatConfigVec_i;
43  typedef FloatConfigVec_t::const_iterator FloatConfigVec_ci;
44 
45  struct IntConfig_t
46  {
50 
51  IntConfig_t(TString name, Int_t value, Int_t min, Int_t max, Bool_t selector=kFALSE) :
52  fValue(value), fMin(min), fMax(max), fName(name), fSelector(selector) {}
53  IntConfig_t() : fValue(0), fMin(0), fMax(0), fName(""), fSelector(kFALSE) {}
54  };
55  typedef std::vector<IntConfig_t> IntConfigVec_t;
56  typedef IntConfigVec_t::iterator IntConfigVec_i;
57  typedef IntConfigVec_t::const_iterator IntConfigVec_ci;
58 
59  struct BoolConfig_t
60  {
63 
64  BoolConfig_t(TString name, Bool_t value): fValue(value), fName(name) {}
66  };
67  typedef std::vector<BoolConfig_t> BoolConfigVec_t;
68  typedef BoolConfigVec_t::iterator BoolConfigVec_i;
69  typedef BoolConfigVec_t::const_iterator BoolConfigVec_ci;
70 
71 private:
72  TEveParamList(const TEveParamList&); // Not implemented
73  TEveParamList& operator=(const TEveParamList&); // Not implemented
74 
75 protected:
80 
81 public:
82  TEveParamList(const char* n="TEveParamList", const char* t="", Bool_t doColor=kFALSE);
83  virtual ~TEveParamList() {}
84 
85  void AddParameter(const FloatConfig_t& parameter) { fFloatParameters.push_back(parameter); }
86  void AddParameter(const IntConfig_t& parameter) { fIntParameters.push_back(parameter); }
87  void AddParameter(const BoolConfig_t& parameter) { fBoolParameters.push_back(parameter); }
88 
92 
96 
97  void ParamChanged(const char* name); // *SIGNAL*
98 
99  ClassDef(TEveParamList, 0); // Eve element to store generic configuration information.
100 };
101 
102 
103 //==============================================================================
104 //==============================================================================
105 // TEveParamListEditor
106 //==============================================================================
107 
108 #include "TGedFrame.h"
109 
110 class TGButton;
111 class TGCheckButton;
112 class TGNumberEntry;
113 class TGColorSelect;
114 
115 class TEveGValuator;
116 class TEveGDoubleValuator;
117 
118 class TEveParamList;
119 
120 class TGNumberEntry;
121 
123 {
124 private:
125  TEveParamListEditor(const TEveParamListEditor&); // Not implemented
126  TEveParamListEditor& operator=(const TEveParamListEditor&); // Not implemented
127 
128 protected:
129  TEveParamList *fM; // Model object.
131  std::vector<TGNumberEntry*> fIntParameters;
132  std::vector<TGNumberEntry*> fFloatParameters;
133  std::vector<TGCheckButton*> fBoolParameters;
134 
135  virtual void InitModel(TObject* obj);
136 
137 public:
138  TEveParamListEditor(const TGWindow* p=0, Int_t width=170, Int_t height=30,
140  virtual ~TEveParamListEditor() {}
141 
142  virtual void SetModel(TObject* obj);
143 
144  // Declare callback/slot methods
145  void DoIntUpdate();
146  void DoFloatUpdate();
147  void DoBoolUpdate();
148 
149  ClassDef(TEveParamListEditor, 0); // GUI editor for TEveParamList.
150 };
151 #endif
TEveParamList::BoolConfig_t::fValue
Bool_t fValue
Definition: TEveParamList.h:67
TEveParamList::FloatConfig_t::fSelector
Bool_t fSelector
Definition: TEveParamList.h:41
n
const Int_t n
Definition: legend1.C:16
TEveParamList::operator=
TEveParamList & operator=(const TEveParamList &)
TGWindow
Definition: TGWindow.h:31
TEveElement
Definition: TEveElement.h:35
TEveParamList::fIntParameters
IntConfigVec_t fIntParameters
Definition: TEveParamList.h:84
TEveParamList
Definition: TEveParamList.h:24
TEveParamList::FloatConfigVec_t
std::vector< FloatConfig_t > FloatConfigVec_t
Definition: TEveParamList.h:47
TEveParamListEditor::~TEveParamListEditor
virtual ~TEveParamListEditor()
Definition: TEveParamList.h:140
TEveParamList::AddParameter
void AddParameter(const FloatConfig_t &parameter)
Definition: TEveParamList.h:91
TEveParamList::ParamChanged
void ParamChanged(const char *name)
Emit ParamChanged() signal.
Definition: TEveParamList.cxx:80
TEveParamList::fColor
Color_t fColor
Definition: TEveParamList.h:82
TEveParamList::fFloatParameters
FloatConfigVec_t fFloatParameters
Definition: TEveParamList.h:83
Pixel_t
ULong_t Pixel_t
Definition: GuiTypes.h:39
TEveParamList::IntConfig_t
Definition: TEveParamList.h:51
TEveParamListEditor::fParamFrame
TGVerticalFrame * fParamFrame
Definition: TEveParamList.h:130
TEveGValuator
Definition: TEveGValuators.h:57
TEveParamList::FloatConfig_t
Definition: TEveParamList.h:37
TEveParamListEditor::DoBoolUpdate
void DoBoolUpdate()
Slot for bool parameter update.
Definition: TEveParamList.cxx:248
TEveParamList::BoolConfigVec_ci
BoolConfigVec_t::const_iterator BoolConfigVec_ci
Definition: TEveParamList.h:75
Float_t
float Float_t
Definition: RtypesCore.h:57
width
include TDocParser_001 C image html pict1_TDocParser_001 png width
Definition: TDocParser.cxx:121
TEveParamList::FloatConfig_t::FloatConfig_t
FloatConfig_t()
Definition: TEveParamList.h:45
TEveParamList::IntConfigVec_ci
IntConfigVec_t::const_iterator IntConfigVec_ci
Definition: TEveParamList.h:63
TEveParamList::IntConfig_t::fValue
Int_t fValue
Definition: TEveParamList.h:53
TEveElement.h
TGFrame::GetDefaultFrameBackground
static Pixel_t GetDefaultFrameBackground()
Get default frame background.
Definition: TGFrame.cxx:668
TEveParamList::FloatConfig_t::fMin
Float_t fMin
Definition: TEveParamList.h:39
TEveParamList::IntConfig_t::fMax
Int_t fMax
Definition: TEveParamList.h:53
TString
Definition: TString.h:136
TEveParamList::IntConfigVec_t
std::vector< IntConfig_t > IntConfigVec_t
Definition: TEveParamList.h:61
TEveParamList::GetBoolParameter
Bool_t GetBoolParameter(const TString &name)
Get value for bool parameter 'name'.
Definition: TEveParamList.cxx:67
TEveParamListEditor::operator=
TEveParamListEditor & operator=(const TEveParamListEditor &)
Color_t
short Color_t
Definition: RtypesCore.h:83
TEveParamListEditor::fFloatParameters
std::vector< TGNumberEntry * > fFloatParameters
Definition: TEveParamList.h:132
TEveParamList::IntConfig_t::IntConfig_t
IntConfig_t()
Definition: TEveParamList.h:59
bool
TEveParamList::GetIntParameter
IntConfig_t GetIntParameter(const TString &name)
Get config-struct for int parameter 'name'.
Definition: TEveParamList.cxx:54
TEveParamList::FloatConfig_t::fName
TString fName
Definition: TEveParamList.h:40
TEveParamListEditor::DoIntUpdate
void DoIntUpdate()
Slot for integer parameter update.
Definition: TEveParamList.cxx:220
TGCheckButton
Definition: TGButton.h:264
TEveParamListEditor::fM
TEveParamList * fM
Definition: TEveParamList.h:129
TQObject.h
TQObject
Definition: TQObject.h:48
TEveParamList::GetBoolParameters
const BoolConfigVec_t & GetBoolParameters()
Definition: TEveParamList.h:97
TEveParamList::IntConfig_t::fSelector
Bool_t fSelector
Definition: TEveParamList.h:55
TEveParamList::BoolConfig_t::BoolConfig_t
BoolConfig_t()
Definition: TEveParamList.h:71
TEveParamList::GetFloatParameter
FloatConfig_t GetFloatParameter(const TString &name)
Get config-struct for float parameter 'name'.
Definition: TEveParamList.cxx:41
TGedFrame.h
TEveParamList::~TEveParamList
virtual ~TEveParamList()
Definition: TEveParamList.h:89
TGVerticalFrame
Definition: TGFrame.h:412
TNamed
Definition: TNamed.h:29
TEveParamList::IntConfig_t::fMin
Int_t fMin
Definition: TEveParamList.h:53
kFALSE
const Bool_t kFALSE
Definition: RtypesCore.h:92
TEveParamList::FloatConfigVec_i
FloatConfigVec_t::iterator FloatConfigVec_i
Definition: TEveParamList.h:48
TEveParamList::GetFloatParameters
const FloatConfigVec_t & GetFloatParameters()
Definition: TEveParamList.h:95
TEveParamList::TEveParamList
TEveParamList(const TEveParamList &)
TEveParamList::IntConfig_t::fName
TString fName
Definition: TEveParamList.h:54
TEveGDoubleValuator
Definition: TEveGValuators.h:108
TEveParamListEditor
Definition: TEveParamList.h:122
TEveParamList::BoolConfig_t
Definition: TEveParamList.h:65
TEveParamListEditor::SetModel
virtual void SetModel(TObject *obj)
Set model object.
Definition: TEveParamList.cxx:203
TEveParamListEditor::fIntParameters
std::vector< TGNumberEntry * > fIntParameters
Definition: TEveParamList.h:131
unsigned int
TEveParamList::FloatConfigVec_ci
FloatConfigVec_t::const_iterator FloatConfigVec_ci
Definition: TEveParamList.h:49
TEveParamListEditor::InitModel
virtual void InitModel(TObject *obj)
Initialize widgets when a new object is selected.
Definition: TEveParamList.cxx:117
TGedFrame
Definition: TGedFrame.h:33
TEveParamList::BoolConfigVec_t
std::vector< BoolConfig_t > BoolConfigVec_t
Definition: TEveParamList.h:73
Double_t
double Double_t
Definition: RtypesCore.h:59
TObject
Definition: TObject.h:37
ClassDef
#define ClassDef(name, id)
Definition: Rtypes.h:325
name
char name[80]
Definition: TGX11.cxx:110
TEveParamListEditor::TEveParamListEditor
TEveParamListEditor(const TEveParamListEditor &)
TGColorSelect
Definition: TGColorSelect.h:127
TEveParamList::BoolConfigVec_i
BoolConfigVec_t::iterator BoolConfigVec_i
Definition: TEveParamList.h:74
TEveParamList::fBoolParameters
BoolConfigVec_t fBoolParameters
Definition: TEveParamList.h:85
TGNumberEntry
Definition: TGNumberEntry.h:156
TGButton
Definition: TGButton.h:68
TEveParamList::FloatConfig_t::fValue
Float_t fValue
Definition: TEveParamList.h:39
TEveParamListEditor::DoFloatUpdate
void DoFloatUpdate()
Slot for float parameter update.
Definition: TEveParamList.cxx:234
TEveParamList::GetIntParameters
const IntConfigVec_t & GetIntParameters()
Definition: TEveParamList.h:96
TEveParamList::BoolConfig_t::fName
TString fName
Definition: TEveParamList.h:68
TEveParamList::FloatConfig_t::fMax
Float_t fMax
Definition: TEveParamList.h:39
TEveParamListEditor::fBoolParameters
std::vector< TGCheckButton * > fBoolParameters
Definition: TEveParamList.h:133
kChildFrame
@ kChildFrame
Definition: GuiTypes.h:379
int
TEveParamList::IntConfigVec_i
IntConfigVec_t::iterator IntConfigVec_i
Definition: TEveParamList.h:62