2 // Author: Matevz Tadel 2007
4 /**************************************************************************
5 * Copyright(c) 1998-2008, ALICE Experiment at CERN, all rights reserved. *
6 * See http://aliceinfo.cern.ch/Offline/AliRoot/License.html for *
7 * full copyright notice. *
8 **************************************************************************/
10 #include "AliEveMacro.h"
12 //______________________________________________________________________________
14 // Member fSources is a bitfield, but we do not have a widget
15 // that can show/edit this (a combo-box with a check-box for each
16 // entry). So ... use a single value for now,
20 //______________________________________________________________________________
21 AliEveMacro::AliEveMacro(Int_t src, const TString& tags, const TString& mac,
22 const TString& foo, const TString& args, Bool_t act) :
24 fSources(src), fTags(tags), fMacro (mac),
25 fFunc (foo), fArgs(args), fActive(act),
33 /******************************************************************************/
35 void AliEveMacro::ResetExecState()
37 // Reset exec variables into state as if the macro has not been run.
39 fExecStatus = kNotRun;
44 void AliEveMacro::SetExecNoData()
46 // Set last execution state to 'NoData'.
48 fExecStatus = kNoData;
52 void AliEveMacro::SetExecOK(TEveElement* result)
54 // Set last execution state to 'OK' and register result.
61 void AliEveMacro::SetExecException(const TString& exception)
63 // Set last execution state to 'Exception' and store the exception string.
65 fExecStatus = kException;
66 fExecExcString = exception;
69 void AliEveMacro::SetExecError()
71 // Set last execution state to 'Error'.
76 /******************************************************************************/
78 TString AliEveMacro::FormForExec() const
80 // Return string suitable for execution.
82 return fFunc + "(" + fArgs + ");";
85 TString AliEveMacro::FormForDisplay() const
87 // Return string suitable for display.
89 return TString::Format
90 (" %c %-22s %-30s %-30s %-s", fActive ? 'x' : ' ',
91 fMacro.Data(), fFunc.Data(), fArgs.Data(), fTags.Data());