Logo ROOT   6.18/05
Reference Guide
TEveEventManager.cxx
Go to the documentation of this file.
1// @(#)root/eve:$Id$
2// Authors: Matevz Tadel & Alja Mrak-Tadel: 2006, 2007
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#include "TEveEventManager.h"
13
14#include "TObjString.h"
15#include "TInterpreter.h"
16
17/** \class TEveEventManager
18\ingroup TEve
19Base class for event management and navigation.
20*/
21
23
24////////////////////////////////////////////////////////////////////////////////
25/// Constructor.
26
27TEveEventManager::TEveEventManager(const char* n, const char* t) :
29 fNewEventCommands()
30{
31}
32
33////////////////////////////////////////////////////////////////////////////////
34/// Virtual function to be called after a new event is loaded.
35/// It iterates over the list of registered commands
36/// (fNewEventCommands) and executes them in given order.
37
39{
40 for (std::vector<TString>::iterator i = fNewEventCommands.begin(); i != fNewEventCommands.end(); ++i)
41 {
42 gInterpreter->ProcessLine(*i);
43 }
44}
45
46////////////////////////////////////////////////////////////////////////////////
47/// Register a command to be executed on each new event.
48
50{
51 fNewEventCommands.push_back(cmd);
52}
53
54////////////////////////////////////////////////////////////////////////////////
55/// Remove the first command equal to cmd.
56
58{
59 for (std::vector<TString>::iterator i = fNewEventCommands.begin(); i != fNewEventCommands.end(); ++i)
60 {
61 if (cmd == *i) {
62 fNewEventCommands.erase(i);
63 break;
64 }
65 }
66}
67
68////////////////////////////////////////////////////////////////////////////////
69/// Clear the list of commands to be executed on each new event.
70
72{
73 fNewEventCommands.clear();
74}
#define ClassImp(name)
Definition: Rtypes.h:365
#define gInterpreter
Definition: TInterpreter.h:553
A list of TEveElements.
Definition: TEveElement.h:431
Base class for event management and navigation.
virtual void AddNewEventCommand(const TString &cmd)
Register a command to be executed on each new event.
virtual void ClearNewEventCommands()
Clear the list of commands to be executed on each new event.
TEveEventManager(const char *n="TEveEventManager", const char *t="")
Constructor.
virtual void AfterNewEventLoaded()
Virtual function to be called after a new event is loaded.
virtual void RemoveNewEventCommand(const TString &cmd)
Remove the first command equal to cmd.
std::vector< TString > fNewEventCommands
Basic string class.
Definition: TString.h:131
const Int_t n
Definition: legend1.C:16