Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
paramlist.C File Reference

Detailed Description

Demonstrates usage of simple configuration via TEveParamList class.

#include "TEveManager.h"
#include "TEveParamList.h"
#include "TQObject.h"
class TParamFollower
{
public:
TParamFollower()
{
TQObject::Connect("TEveParamList", "ParamChanged(char*)",
"TParamFollower", this, "OnParamChanged(char*)");
}
virtual ~TParamFollower()
{
TQObject::Disconnect("TParamFollower", "ParamChanged(char*)",
this, "OnParamChanged(char*)");
}
void OnParamChanged(const char* parameter)
{
auto pl = dynamic_cast<TEveParamList*> (reinterpret_cast<TQObject*>(gTQSender));
printf("Change in param-list '%s', parameter '%s'.\n", pl->GetElementName(), parameter);
}
ClassDef(TParamFollower, 0);
};
ClassImp(TParamFollower)
void paramlist()
{
x = new TEveParamList("Top config");
x->AddParameter(TEveParamList::FloatConfig_t("Pepe", 20, 0, 110));
x->AddParameter(TEveParamList::IntConfig_t("Dima", 100, 0, 110));
x->AddParameter(TEveParamList::BoolConfig_t("Chris", 1));
x = new TEveParamList("Another config");
x->AddParameter(TEveParamList::FloatConfig_t("MagneticField", 4, -4, 4));
x->AddParameter(TEveParamList::FloatConfig_t("Temperature", 16, -20, 40));
new TParamFollower;
}
#define ClassDef(name, id)
Definition Rtypes.h:325
#define ClassImp(name)
Definition Rtypes.h:364
R__EXTERN TEveManager * gEve
R__EXTERN void * gTQSender
Definition TQObject.h:46
TGListTreeItem * AddToListTree(TEveElement *re, Bool_t open, TGListTree *lt=0)
static TEveManager * Create(Bool_t map_window=kTRUE, Option_t *opt="FIV")
If global TEveManager* gEve is not set initialize it.
Collection of named parameters.
This is the ROOT implementation of the Qt object communication mechanism (see also http://www....
Definition TQObject.h:48
Bool_t Connect(const char *signal, const char *receiver_class, void *receiver, const char *slot)
Non-static method is used to connect from the signal of this object to the receiver slot.
Definition TQObject.cxx:866
Bool_t Disconnect(const char *signal=0, void *receiver=0, const char *slot=0)
Disconnects signal of this object from slot of receiver.
Double_t x[n]
Definition legend1.C:17
Author
Matevz Tadel

Definition in file paramlist.C.