ROOT logo
// @(#)root/eve:$Id: TEveEventManager.cxx 27157 2009-01-15 14:05:12Z brun $
// Authors: Matevz Tadel & Alja Mrak-Tadel: 2006, 2007

/*************************************************************************
 * Copyright (C) 1995-2007, Rene Brun and Fons Rademakers.               *
 * All rights reserved.                                                  *
 *                                                                       *
 * For the licensing terms see $ROOTSYS/LICENSE.                         *
 * For the list of contributors see $ROOTSYS/README/CREDITS.             *
 *************************************************************************/

#include "TEveEventManager.h"

#include "TObjString.h"
#include "TInterpreter.h"

//______________________________________________________________________________
// TEveEventManager
//
// Base class for event management and navigation.

ClassImp(TEveEventManager)

//______________________________________________________________________________
TEveEventManager::TEveEventManager(const char* n, const char* t) :
   TEveElementList(n, t),
   fNewEventCommands()
{
   // Constructor.
}

/******************************************************************************/

//______________________________________________________________________________
void TEveEventManager::AfterNewEventLoaded()
{
   // Virtual function to be called after a new event is loaded.
   // It iterates over the list of registered commands
   // (fNewEventCommands) and executes them in given order.

   for (std::vector<TString>::iterator i = fNewEventCommands.begin(); i != fNewEventCommands.end(); ++i)
   {
      gInterpreter->ProcessLine(*i);
   }
}

//______________________________________________________________________________
void TEveEventManager::AddNewEventCommand(const TString& cmd)
{
   // Register a command to be executed on each new event.

   fNewEventCommands.push_back(cmd);
}

//______________________________________________________________________________
void TEveEventManager::RemoveNewEventCommand(const TString& cmd)
{
   // Remove the first command equal to cmd.

   for (std::vector<TString>::iterator i = fNewEventCommands.begin(); i != fNewEventCommands.end(); ++i)
   {
      if (cmd == *i) {
         fNewEventCommands.erase(i);
         break;
      }
   }
}

//______________________________________________________________________________
void TEveEventManager::ClearNewEventCommands()
{
   // Clear the list of commands to be executed on each new event.

   fNewEventCommands.clear();
}
 TEveEventManager.cxx:1
 TEveEventManager.cxx:2
 TEveEventManager.cxx:3
 TEveEventManager.cxx:4
 TEveEventManager.cxx:5
 TEveEventManager.cxx:6
 TEveEventManager.cxx:7
 TEveEventManager.cxx:8
 TEveEventManager.cxx:9
 TEveEventManager.cxx:10
 TEveEventManager.cxx:11
 TEveEventManager.cxx:12
 TEveEventManager.cxx:13
 TEveEventManager.cxx:14
 TEveEventManager.cxx:15
 TEveEventManager.cxx:16
 TEveEventManager.cxx:17
 TEveEventManager.cxx:18
 TEveEventManager.cxx:19
 TEveEventManager.cxx:20
 TEveEventManager.cxx:21
 TEveEventManager.cxx:22
 TEveEventManager.cxx:23
 TEveEventManager.cxx:24
 TEveEventManager.cxx:25
 TEveEventManager.cxx:26
 TEveEventManager.cxx:27
 TEveEventManager.cxx:28
 TEveEventManager.cxx:29
 TEveEventManager.cxx:30
 TEveEventManager.cxx:31
 TEveEventManager.cxx:32
 TEveEventManager.cxx:33
 TEveEventManager.cxx:34
 TEveEventManager.cxx:35
 TEveEventManager.cxx:36
 TEveEventManager.cxx:37
 TEveEventManager.cxx:38
 TEveEventManager.cxx:39
 TEveEventManager.cxx:40
 TEveEventManager.cxx:41
 TEveEventManager.cxx:42
 TEveEventManager.cxx:43
 TEveEventManager.cxx:44
 TEveEventManager.cxx:45
 TEveEventManager.cxx:46
 TEveEventManager.cxx:47
 TEveEventManager.cxx:48
 TEveEventManager.cxx:49
 TEveEventManager.cxx:50
 TEveEventManager.cxx:51
 TEveEventManager.cxx:52
 TEveEventManager.cxx:53
 TEveEventManager.cxx:54
 TEveEventManager.cxx:55
 TEveEventManager.cxx:56
 TEveEventManager.cxx:57
 TEveEventManager.cxx:58
 TEveEventManager.cxx:59
 TEveEventManager.cxx:60
 TEveEventManager.cxx:61
 TEveEventManager.cxx:62
 TEveEventManager.cxx:63
 TEveEventManager.cxx:64
 TEveEventManager.cxx:65
 TEveEventManager.cxx:66
 TEveEventManager.cxx:67
 TEveEventManager.cxx:68
 TEveEventManager.cxx:69
 TEveEventManager.cxx:70
 TEveEventManager.cxx:71
 TEveEventManager.cxx:72
 TEveEventManager.cxx:73
 TEveEventManager.cxx:74
 TEveEventManager.cxx:75