Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
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
25 public TNamed,
26 public TQObject
27{
28 friend class TEveParamListEditor;
29
30public:
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
46 {
50
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
60 {
63
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
71private:
72 TEveParamList(const TEveParamList&); // Not implemented
73 TEveParamList& operator=(const TEveParamList&); // Not implemented
74
75protected:
80
81public:
82 TEveParamList(const char* n="TEveParamList", const char* t="", Bool_t doColor=kFALSE);
83 ~TEveParamList() override {}
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
93 FloatConfig_t GetFloatParameter(const TString& name);
94 IntConfig_t GetIntParameter (const TString& name);
96
97 void ParamChanged(const char* name); // *SIGNAL*
98
99 ClassDefOverride(TEveParamList, 0); // Eve element to store generic configuration information.
100};
101
102
103//==============================================================================
104//==============================================================================
105// TEveParamListEditor
106//==============================================================================
107
108#include "TGedFrame.h"
109
110class TGButton;
111class TGCheckButton;
112class TGNumberEntry;
113class TGColorSelect;
114
115class TEveGValuator;
117
118class TEveParamList;
119
120class TGNumberEntry;
121
123{
124private:
125 TEveParamListEditor(const TEveParamListEditor&); // Not implemented
127
128protected:
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
137public:
138 TEveParamListEditor(const TGWindow *p = nullptr, Int_t width=170, Int_t height=30,
141
142 void SetModel(TObject* obj) override;
143
144 // Declare callback/slot methods
145 void DoIntUpdate();
146 void DoFloatUpdate();
147 void DoBoolUpdate();
148
149 ClassDefOverride(TEveParamListEditor, 0); // GUI editor for TEveParamList.
150};
151#endif
@ kChildFrame
Definition GuiTypes.h:379
ULong_t Pixel_t
Pixel value.
Definition GuiTypes.h:40
bool Bool_t
Definition RtypesCore.h:63
short Color_t
Definition RtypesCore.h:85
float Float_t
Definition RtypesCore.h:57
constexpr Bool_t kFALSE
Definition RtypesCore.h:94
#define ClassDefOverride(name, id)
Definition Rtypes.h:346
winID h TVirtualViewer3D TVirtualGLPainter p
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void value
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
char name[80]
Definition TGX11.cxx:110
Base class for TEveUtil visualization elements, providing hierarchy management, rendering control and...
Definition TEveElement.h:36
Composite GUI element for selection of range (label, two number-entries and double-slider).
Composite GUI element for single value selection (supports label, number-entry and slider).
GUI editor for TEveParamList.
TGVerticalFrame * fParamFrame
virtual void InitModel(TObject *obj)
Initialize widgets when a new object is selected.
std::vector< TGCheckButton * > fBoolParameters
std::vector< TGNumberEntry * > fIntParameters
void DoFloatUpdate()
Slot for float parameter update.
TEveParamListEditor(const TEveParamListEditor &)
void SetModel(TObject *obj) override
Set model object.
void DoIntUpdate()
Slot for integer parameter update.
void DoBoolUpdate()
Slot for bool parameter update.
TEveParamList * fM
TEveParamListEditor & operator=(const TEveParamListEditor &)
std::vector< TGNumberEntry * > fFloatParameters
~TEveParamListEditor() override
Collection of named parameters.
std::vector< BoolConfig_t > BoolConfigVec_t
BoolConfigVec_t::iterator BoolConfigVec_i
void AddParameter(const FloatConfig_t &parameter)
std::vector< FloatConfig_t > FloatConfigVec_t
const FloatConfigVec_t & GetFloatParameters()
const BoolConfigVec_t & GetBoolParameters()
IntConfigVec_t::const_iterator IntConfigVec_ci
~TEveParamList() override
void AddParameter(const BoolConfig_t &parameter)
TEveParamList(const TEveParamList &)
BoolConfigVec_t::const_iterator BoolConfigVec_ci
TEveParamList & operator=(const TEveParamList &)
IntConfigVec_t fIntParameters
FloatConfigVec_t::const_iterator FloatConfigVec_ci
void ParamChanged(const char *name)
Emit ParamChanged() signal.
IntConfig_t GetIntParameter(const TString &name)
Get config-struct for int parameter 'name'.
std::vector< IntConfig_t > IntConfigVec_t
FloatConfigVec_t::iterator FloatConfigVec_i
BoolConfigVec_t fBoolParameters
Bool_t GetBoolParameter(const TString &name)
Get value for bool parameter 'name'.
FloatConfigVec_t fFloatParameters
IntConfigVec_t::iterator IntConfigVec_i
FloatConfig_t GetFloatParameter(const TString &name)
Get config-struct for float parameter 'name'.
void AddParameter(const IntConfig_t &parameter)
const IntConfigVec_t & GetIntParameters()
A button abstract base class.
Definition TGButton.h:68
Selects different options.
Definition TGButton.h:264
Like a checkbutton but instead of the check mark there is color area with a little down arrow.
static Pixel_t GetDefaultFrameBackground()
Get default frame background.
Definition TGFrame.cxx:683
TGNumberEntry is a number entry input widget with up/down buttons.
A composite frame that layout their children in vertical way.
Definition TGFrame.h:374
ROOT GUI Window base class.
Definition TGWindow.h:23
Base frame for implementing GUI - a service class.
Definition TGedFrame.h:27
The TNamed class is the base class for all named ROOT classes.
Definition TNamed.h:29
Mother of all ROOT objects.
Definition TObject.h:41
This is the ROOT implementation of the Qt object communication mechanism (see also http://www....
Definition TQObject.h:48
Basic string class.
Definition TString.h:139
const Int_t n
Definition legend1.C:16
BoolConfig_t(TString name, Bool_t value)
FloatConfig_t(TString name, Double_t value, Double_t min, Double_t max, Bool_t selector=kFALSE)
IntConfig_t(TString name, Int_t value, Int_t min, Int_t max, Bool_t selector=kFALSE)