ROOT logo
// @(#)root/eve:$Id: text_test.C 26717 2008-12-07 22:07:55Z matevz $
// Author: Matevz Tadel

// Demonstrates usage of simple configuration via TEveParamList class.

// Must run in compiled mode for dynamic_cast to work properly.

#if defined(__CINT__) && !defined(__MAKECINT__)
{
   gSystem->CompileMacro("test_paramlist.C");
   test_paramlist();
}
#else

#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)
   {
      TEveParamList* pl = dynamic_cast<TEveParamList*>
         (reinterpret_cast<TQObject*>(gTQSender));

      printf("Change in param-list '%s', parameter '%s'.\n",
             pl->GetElementName(), parameter);
   }

   ClassDef(TParamFollower, 0);
};

void test_paramlist()
{
   TEveManager::Create();

   TEveParamList* x = 0;

   x = new TEveParamList("Top config");
   gEve->AddToListTree(x, 0);

   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");
   gEve->AddToListTree(x, 0);

   x->AddParameter(TEveParamList::FloatConfig_t("MagneticField", 4, -4, 4));
   x->AddParameter(TEveParamList::FloatConfig_t("Temperature", 16, -20, 40));

   new TParamFollower;
}

#endif
 test_paramlist.C:1
 test_paramlist.C:2
 test_paramlist.C:3
 test_paramlist.C:4
 test_paramlist.C:5
 test_paramlist.C:6
 test_paramlist.C:7
 test_paramlist.C:8
 test_paramlist.C:9
 test_paramlist.C:10
 test_paramlist.C:11
 test_paramlist.C:12
 test_paramlist.C:13
 test_paramlist.C:14
 test_paramlist.C:15
 test_paramlist.C:16
 test_paramlist.C:17
 test_paramlist.C:18
 test_paramlist.C:19
 test_paramlist.C:20
 test_paramlist.C:21
 test_paramlist.C:22
 test_paramlist.C:23
 test_paramlist.C:24
 test_paramlist.C:25
 test_paramlist.C:26
 test_paramlist.C:27
 test_paramlist.C:28
 test_paramlist.C:29
 test_paramlist.C:30
 test_paramlist.C:31
 test_paramlist.C:32
 test_paramlist.C:33
 test_paramlist.C:34
 test_paramlist.C:35
 test_paramlist.C:36
 test_paramlist.C:37
 test_paramlist.C:38
 test_paramlist.C:39
 test_paramlist.C:40
 test_paramlist.C:41
 test_paramlist.C:42
 test_paramlist.C:43
 test_paramlist.C:44
 test_paramlist.C:45
 test_paramlist.C:46
 test_paramlist.C:47
 test_paramlist.C:48
 test_paramlist.C:49
 test_paramlist.C:50
 test_paramlist.C:51
 test_paramlist.C:52
 test_paramlist.C:53
 test_paramlist.C:54
 test_paramlist.C:55
 test_paramlist.C:56
 test_paramlist.C:57
 test_paramlist.C:58
 test_paramlist.C:59
 test_paramlist.C:60
 test_paramlist.C:61
 test_paramlist.C:62
 test_paramlist.C:63
 test_paramlist.C:64
 test_paramlist.C:65
 test_paramlist.C:66
 test_paramlist.C:67
 test_paramlist.C:68
thumb