Geant4  10.02.p03
G4UImanager Class Reference

#include <G4UImanager.hh>

Inheritance diagram for G4UImanager:
Collaboration diagram for G4UImanager:

Public Member Functions

 ~G4UImanager ()
 
G4String GetCurrentValues (const char *aCommand)
 
void AddNewCommand (G4UIcommand *newCommand)
 
void RemoveCommand (G4UIcommand *aCommand)
 
void ExecuteMacroFile (const char *fileName)
 
void Loop (const char *macroFile, const char *variableName, G4double initialValue, G4double finalValue, G4double stepSize=1.0)
 
void Foreach (const char *macroFile, const char *variableName, const char *candidates)
 
G4int ApplyCommand (const char *aCommand)
 
G4int ApplyCommand (const G4String &aCommand)
 
void StoreHistory (const char *fileName="G4history.macro")
 
void StoreHistory (G4bool historySwitch, const char *fileName="G4history.macro")
 
void ListCommands (const char *direc)
 
void SetAlias (const char *aliasLine)
 
void RemoveAlias (const char *aliasName)
 
void ListAlias ()
 
G4String SolveAlias (const char *aCmd)
 
void CreateHTML (const char *dir="/")
 
void LoopS (const char *valueList)
 
void ForeachS (const char *valueList)
 
virtual G4bool Notify (G4ApplicationState requestedState)
 
G4String GetCurrentStringValue (const char *aCommand, G4int parameterNumber=1, G4bool reGet=true)
 
G4int GetCurrentIntValue (const char *aCommand, G4int parameterNumber=1, G4bool reGet=true)
 
G4double GetCurrentDoubleValue (const char *aCommand, G4int parameterNumber=1, G4bool reGet=true)
 
G4String GetCurrentStringValue (const char *aCommand, const char *aParameterName, G4bool reGet=true)
 
G4int GetCurrentIntValue (const char *aCommand, const char *aParameterName, G4bool reGet=true)
 
G4double GetCurrentDoubleValue (const char *aCommand, const char *aParameterName, G4bool reGet=true)
 
void SetPauseAtBeginOfEvent (G4bool vl)
 
G4bool GetPauseAtBeginOfEvent () const
 
void SetPauseAtEndOfEvent (G4bool vl)
 
G4bool GetPauseAtEndOfEvent () const
 
G4UIcommandTreeGetTree () const
 
G4UIsessionGetSession () const
 
G4UIsessionGetG4UIWindow () const
 
void SetSession (G4UIsession *const value)
 
void SetG4UIWindow (G4UIsession *const value)
 
void SetCoutDestination (G4UIsession *const value)
 
void SetVerboseLevel (G4int val)
 
G4int GetVerboseLevel () const
 
G4int GetNumberOfHistory () const
 
G4String GetPreviousCommand (G4int i) const
 
void SetMaxHistSize (G4int mx)
 
G4int GetMaxHistSize () const
 
void SetMacroSearchPath (const G4String &path)
 
const G4StringGetMacroSearchPath () const
 
void ParseMacroSearchPath ()
 
G4String FindMacroPath (const G4String &fname) const
 
void SetMasterUIManager (G4bool val)
 
void SetIgnoreCmdNotFound (G4bool val)
 
std::vector< G4String > * GetCommandStack ()
 
void RegisterBridge (G4UIbridge *brg)
 
void SetUpForAThread (G4int tId)
 
void SetUpForSpecialThread (G4String aPrefix)
 
G4int GetThreadID () const
 
void SetCoutFileName (const G4String &fileN="G4cout.txt", G4bool ifAppend=true)
 
void SetCerrFileName (const G4String &fileN="G4cerr.txt", G4bool ifAppend=true)
 
void SetThreadPrefixString (const G4String &s="W")
 
void SetThreadUseBuffer (G4bool flg=true)
 
void SetThreadIgnore (G4int tid=0)
 
void SetThreadIgnoreInit (G4bool flg=true)
 
G4MTcoutDestinationGetThreadCout ()
 
- Public Member Functions inherited from G4VStateDependent
 G4VStateDependent (G4bool bottom=false)
 
virtual ~G4VStateDependent ()
 
G4int operator== (const G4VStateDependent &right) const
 
G4int operator!= (const G4VStateDependent &right) const
 

Static Public Member Functions

static G4UImanagerGetUIpointer ()
 
static G4UImanagerGetMasterUIpointer ()
 

Protected Member Functions

 G4UImanager ()
 

Private Member Functions

 G4UImanager (const G4UImanager &right)
 
const G4UImanageroperator= (const G4UImanager &right)
 
G4int operator== (const G4UImanager &right) const
 
G4int operator!= (const G4UImanager &right) const
 
void AddWorkerCommand (G4UIcommand *newCommand)
 
void RemoveWorkerCommand (G4UIcommand *aCommand)
 
void PauseSession (const char *msg)
 
void CreateMessenger ()
 
G4UIcommandTreeFindDirectory (const char *dirName)
 

Private Attributes

G4UIcommandTreetreeTop
 
G4UIsessionsession
 
G4UIsessiong4UIWindow
 
G4UIcontrolMessengerUImessenger
 
G4UnitsMessengerUnitsMessenger
 
G4LocalThreadCoutMessengerCoutMessenger
 
G4String savedParameters
 
G4UIcommandsavedCommand
 
G4int verboseLevel
 
std::ofstream historyFile
 
G4bool saveHistory
 
std::vector< G4StringhistVec
 
G4UIaliasListaliasList
 
G4int maxHistSize
 
G4bool pauseAtBeginOfEvent
 
G4bool pauseAtEndOfEvent
 
G4String searchPath
 
std::vector< G4StringsearchDirs
 
G4bool isMaster
 
std::vector< G4UIbridge * > * bridges
 
G4bool ignoreCmdNotFound
 
G4bool stackCommandsForBroadcast
 
std::vector< G4String > * commandStack
 
G4int threadID
 
G4MTcoutDestinationthreadCout
 

Static Private Attributes

static G4ThreadLocal G4UImanagerfUImanager = 0
 
static G4ThreadLocal G4bool fUImanagerHasBeenKilled = false
 
static G4UImanagerfMasterUImanager = 0
 
static G4int igThreadID = -1
 

Detailed Description

Definition at line 56 of file G4UImanager.hh.

Constructor & Destructor Documentation

◆ G4UImanager() [1/2]

G4UImanager::G4UImanager ( )
protected

Definition at line 74 of file G4UImanager.cc.

75  : G4VStateDependent(true),
77  isMaster(false),bridges(0),
79  threadID(-1), threadCout(0)
80 {
81  savedCommand = 0;
82  treeTop = new G4UIcommandTree("/");
84  G4String nullString;
85  savedParameters = nullString;
86  verboseLevel = 0;
87  saveHistory = false;
88  session = NULL;
89  g4UIWindow = NULL;
91  pauseAtBeginOfEvent = false;
92  pauseAtEndOfEvent = false;
93  maxHistSize = 20;
94  searchPath="";
95  commandStack = new std::vector<G4String>;
96 }
G4UIcommand * savedCommand
Definition: G4UImanager.hh:158
G4bool isMaster
Definition: G4UImanager.hh:251
G4LocalThreadCoutMessenger * CoutMessenger
Definition: G4UImanager.hh:156
G4int verboseLevel
Definition: G4UImanager.hh:159
G4UIcontrolMessenger * UImessenger
Definition: G4UImanager.hh:154
G4String savedParameters
Definition: G4UImanager.hh:157
G4UIcommandTree * treeTop
Definition: G4UImanager.hh:151
G4int maxHistSize
Definition: G4UImanager.hh:164
G4bool stackCommandsForBroadcast
Definition: G4UImanager.hh:254
G4bool saveHistory
Definition: G4UImanager.hh:161
G4UIaliasList * aliasList
Definition: G4UImanager.hh:163
G4MTcoutDestination * threadCout
Definition: G4UImanager.hh:284
std::vector< G4UIbridge * > * bridges
Definition: G4UImanager.hh:252
G4UIsession * g4UIWindow
Definition: G4UImanager.hh:153
G4UnitsMessenger * UnitsMessenger
Definition: G4UImanager.hh:155
G4int threadID
Definition: G4UImanager.hh:283
G4bool pauseAtEndOfEvent
Definition: G4UImanager.hh:166
G4bool ignoreCmdNotFound
Definition: G4UImanager.hh:253
std::vector< G4String > * commandStack
Definition: G4UImanager.hh:255
G4String searchPath
Definition: G4UImanager.hh:167
void SetCoutDestination(G4UIsession *const value)
Definition: G4UImanager.cc:618
G4UIsession * session
Definition: G4UImanager.hh:152
G4VStateDependent(G4bool bottom=false)
G4bool pauseAtBeginOfEvent
Definition: G4UImanager.hh:165
Here is the call graph for this function:
Here is the caller graph for this function:

◆ ~G4UImanager()

G4UImanager::~G4UImanager ( )

Definition at line 105 of file G4UImanager.cc.

106 {
107  if(bridges)
108  {
109  std::vector<G4UIbridge*>::iterator itr = bridges->begin();
110  for(;itr!=bridges->end();itr++)
111  { delete *itr; }
112  delete bridges;
113  }
114  SetCoutDestination(NULL);
115  histVec.clear();
116  if(saveHistory) historyFile.close();
117  delete CoutMessenger;
118  delete UnitsMessenger;
119  delete UImessenger;
120  delete treeTop;
121  delete aliasList;
123  fUImanager = NULL;
124  if(commandStack)
125  {
126  commandStack->clear();
127  delete commandStack;
128  }
129  if(threadID >= 0)
130  {
131  if(threadCout) delete threadCout;
133  threadID = -1;
134  }
135 }
static G4ThreadLocal G4UImanager * fUImanager
Definition: G4UImanager.hh:148
G4LocalThreadCoutMessenger * CoutMessenger
Definition: G4UImanager.hh:156
G4UIcontrolMessenger * UImessenger
Definition: G4UImanager.hh:154
G4UIcommandTree * treeTop
Definition: G4UImanager.hh:151
std::ofstream historyFile
Definition: G4UImanager.hh:160
G4bool saveHistory
Definition: G4UImanager.hh:161
G4UIaliasList * aliasList
Definition: G4UImanager.hh:163
G4MTcoutDestination * threadCout
Definition: G4UImanager.hh:284
std::vector< G4UIbridge * > * bridges
Definition: G4UImanager.hh:252
G4UnitsMessenger * UnitsMessenger
Definition: G4UImanager.hh:155
std::vector< G4String > histVec
Definition: G4UImanager.hh:162
G4int threadID
Definition: G4UImanager.hh:283
std::vector< G4String > * commandStack
Definition: G4UImanager.hh:255
void SetCoutDestination(G4UIsession *const value)
Definition: G4UImanager.cc:618
static G4ThreadLocal G4bool fUImanagerHasBeenKilled
Definition: G4UImanager.hh:149
void G4iosFinalization()
Definition: G4ios.cc:86
Here is the call graph for this function:

◆ G4UImanager() [2/2]

G4UImanager::G4UImanager ( const G4UImanager right)
private

Definition at line 137 of file G4UImanager.cc.

138  : G4VStateDependent(true)
139 {
140  UImessenger = ui.UImessenger;
141  UnitsMessenger = ui.UnitsMessenger;
142  aliasList = ui.aliasList;
143  g4UIWindow = ui.g4UIWindow;
144  savedCommand= ui.savedCommand;
145  session = ui.session;
146  treeTop = ui.treeTop;
147  verboseLevel = ui.verboseLevel;
148  saveHistory = ui.saveHistory;
149  CoutMessenger = 0;
150  maxHistSize = ui.maxHistSize;
151  pauseAtBeginOfEvent = ui.pauseAtBeginOfEvent;
152  pauseAtEndOfEvent = ui.pauseAtEndOfEvent;
153  isMaster = ui.isMaster;
154  bridges = ui.bridges;
155  ignoreCmdNotFound = ui.ignoreCmdNotFound;
156  stackCommandsForBroadcast = ui.stackCommandsForBroadcast;
157  commandStack = ui.commandStack;
158  threadID = ui.threadID;
159  threadCout = ui.threadCout;
160  CreateMessenger();
161 }
G4UIcommand * savedCommand
Definition: G4UImanager.hh:158
G4bool isMaster
Definition: G4UImanager.hh:251
G4LocalThreadCoutMessenger * CoutMessenger
Definition: G4UImanager.hh:156
G4int verboseLevel
Definition: G4UImanager.hh:159
G4UIcontrolMessenger * UImessenger
Definition: G4UImanager.hh:154
void CreateMessenger()
Definition: G4UImanager.cc:98
G4UIcommandTree * treeTop
Definition: G4UImanager.hh:151
G4int maxHistSize
Definition: G4UImanager.hh:164
G4bool stackCommandsForBroadcast
Definition: G4UImanager.hh:254
G4bool saveHistory
Definition: G4UImanager.hh:161
G4UIaliasList * aliasList
Definition: G4UImanager.hh:163
G4MTcoutDestination * threadCout
Definition: G4UImanager.hh:284
std::vector< G4UIbridge * > * bridges
Definition: G4UImanager.hh:252
G4UIsession * g4UIWindow
Definition: G4UImanager.hh:153
G4UnitsMessenger * UnitsMessenger
Definition: G4UImanager.hh:155
G4int threadID
Definition: G4UImanager.hh:283
G4bool pauseAtEndOfEvent
Definition: G4UImanager.hh:166
G4bool ignoreCmdNotFound
Definition: G4UImanager.hh:253
std::vector< G4String > * commandStack
Definition: G4UImanager.hh:255
G4UIsession * session
Definition: G4UImanager.hh:152
G4VStateDependent(G4bool bottom=false)
G4bool pauseAtBeginOfEvent
Definition: G4UImanager.hh:165
Here is the call graph for this function:

Member Function Documentation

◆ AddNewCommand()

void G4UImanager::AddNewCommand ( G4UIcommand newCommand)

Definition at line 268 of file G4UImanager.cc.

269 {
270  treeTop->AddNewCommand( newCommand );
272  { fMasterUImanager->AddWorkerCommand(newCommand); }
273 }
G4UIcommandTree * treeTop
Definition: G4UImanager.hh:151
static G4UImanager * fMasterUImanager
Definition: G4UImanager.hh:150
void AddNewCommand(G4UIcommand *newCommand, G4bool workerThreadOnly=false)
void AddWorkerCommand(G4UIcommand *newCommand)
Definition: G4UImanager.cc:275
G4int G4GetThreadId()
Definition: G4Threading.cc:134
Here is the call graph for this function:
Here is the caller graph for this function:

◆ AddWorkerCommand()

void G4UImanager::AddWorkerCommand ( G4UIcommand newCommand)
private

Definition at line 275 of file G4UImanager.cc.

276 {
277  treeTop->AddNewCommand( newCommand, true );
278 }
G4UIcommandTree * treeTop
Definition: G4UImanager.hh:151
void AddNewCommand(G4UIcommand *newCommand, G4bool workerThreadOnly=false)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ ApplyCommand() [1/2]

G4int G4UImanager::ApplyCommand ( const char *  aCommand)

Definition at line 446 of file G4UImanager.cc.

447 {
448  G4String aCommand = SolveAlias(aCmd);
449  if(aCommand.isNull()) return fAliasNotFound;
450  if(verboseLevel) G4cout << aCommand << G4endl;
451  G4String commandString;
452  G4String commandParameter;
453 
454  G4int i = aCommand.index(" ");
455  if( i != G4int(std::string::npos) )
456  {
457  commandString = aCommand(0,i);
458  commandParameter = aCommand(i+1,aCommand.length()-(i+1));
459  }
460  else
461  {
462  commandString = aCommand;
463  }
464 
465  // remove doubled slash
466  G4int len = commandString.length();
467  G4int ll = 0;
468  G4String a1;
469  G4String a2;
470  while(ll<len-1)
471  {
472  if(commandString(ll,2)=="//")
473  {
474  if(ll==0)
475  { commandString.remove(ll,1); }
476  else
477  {
478  a1 = commandString(0,ll);
479  a2 = commandString(ll+1,len-ll-1);
480  commandString = a1+a2;
481  }
482  len--;
483  }
484  else
485  { ll++; }
486  }
487 
488  if(isMaster&&bridges)
489  {
490  std::vector<G4UIbridge*>::iterator itr = bridges->begin();
491  for(;itr!=bridges->end();itr++)
492  {
493  G4int leng = (*itr)->DirLength();
494  if(commandString(0,leng)==(*itr)->DirName())
495  { return (*itr)->LocalUI()->ApplyCommand(commandString+" "+commandParameter); }
496  }
497  }
498 
499  G4UIcommand * targetCommand = treeTop->FindPath( commandString );
500  if( targetCommand == NULL )
501  {
503  {
505  { commandStack->push_back(commandString+" "+commandParameter); }
506  return fCommandSucceeded;
507  }
508  else
509  { return fCommandNotFound; }
510  }
511 
512  if(stackCommandsForBroadcast && targetCommand->ToBeBroadcasted())
513  { commandStack->push_back(commandString+" "+commandParameter); }
514 
515  if(!(targetCommand->IsAvailable()))
516  { return fIllegalApplicationState; }
517 
518  if(saveHistory) historyFile << aCommand << G4endl;
519  if( G4int(histVec.size()) >= maxHistSize )
520  { histVec.erase(histVec.begin()); }
521  histVec.push_back(aCommand);
522 
523  return targetCommand->DoIt( commandParameter );
524 }
G4bool IsAvailable()
Definition: G4UIcommand.cc:289
G4bool isMaster
Definition: G4UImanager.hh:251
G4String & remove(str_size)
G4int verboseLevel
Definition: G4UImanager.hh:159
G4UIcommandTree * treeTop
Definition: G4UImanager.hh:151
static const G4double a1
G4bool ToBeBroadcasted() const
Definition: G4UIcommand.hh:186
std::ofstream historyFile
Definition: G4UImanager.hh:160
G4int maxHistSize
Definition: G4UImanager.hh:164
G4bool stackCommandsForBroadcast
Definition: G4UImanager.hh:254
str_size index(const char *, G4int pos=0) const
int G4int
Definition: G4Types.hh:78
G4bool saveHistory
Definition: G4UImanager.hh:161
G4GLOB_DLL std::ostream G4cout
std::vector< G4UIbridge * > * bridges
Definition: G4UImanager.hh:252
G4UIcommand * FindPath(const char *commandPath) const
std::vector< G4String > histVec
Definition: G4UImanager.hh:162
G4bool ignoreCmdNotFound
Definition: G4UImanager.hh:253
std::vector< G4String > * commandStack
Definition: G4UImanager.hh:255
G4String SolveAlias(const char *aCmd)
Definition: G4UImanager.cc:391
#define G4endl
Definition: G4ios.hh:61
virtual G4int DoIt(G4String parameterList)
Definition: G4UIcommand.cc:122
static const G4double a2
G4bool isNull() const
Here is the call graph for this function:

◆ ApplyCommand() [2/2]

G4int G4UImanager::ApplyCommand ( const G4String aCommand)

Definition at line 439 of file G4UImanager.cc.

440 {
441  return ApplyCommand(aCmd.data());
442 }
G4int ApplyCommand(const char *aCommand)
Definition: G4UImanager.cc:446
Here is the call graph for this function:

◆ CreateHTML()

void G4UImanager::CreateHTML ( const char *  dir = "/")

Definition at line 655 of file G4UImanager.cc.

656 {
658  if(tr!=0)
659  { tr->CreateHTML(); }
660  else
661  { G4cerr << "Directory <" << dir << "> is not found." << G4endl; }
662 }
TDirectory * dir
#define G4endl
Definition: G4ios.hh:61
G4UIcommandTree * FindDirectory(const char *dirName)
Definition: G4UImanager.cc:560
G4GLOB_DLL std::ostream G4cerr
Here is the call graph for this function:
Here is the caller graph for this function:

◆ CreateMessenger()

void G4UImanager::CreateMessenger ( )
private

Definition at line 98 of file G4UImanager.cc.

Here is the caller graph for this function:

◆ ExecuteMacroFile()

void G4UImanager::ExecuteMacroFile ( const char *  fileName)

Definition at line 292 of file G4UImanager.cc.

293 {
294  G4UIsession* batchSession = new G4UIbatch(fileName,session);
295  session = batchSession;
296  G4UIsession* previousSession = session->SessionStart();
297  delete session;
298  session = previousSession;
299 }
virtual G4UIsession * SessionStart()
Definition: G4UIsession.cc:38
G4UIsession * session
Definition: G4UImanager.hh:152
Here is the call graph for this function:
Here is the caller graph for this function:

◆ FindDirectory()

G4UIcommandTree * G4UImanager::FindDirectory ( const char *  dirName)
private

Definition at line 560 of file G4UImanager.cc.

561 {
562  G4String aDirName = dirName;
563  G4String targetDir = aDirName.strip(G4String::both);
564  if( targetDir( targetDir.length()-1 ) != '/' )
565  { targetDir += "/"; }
566  G4UIcommandTree* comTree = treeTop;
567  if( targetDir == "/" )
568  { return comTree; }
569  G4int idx = 1;
570  while( idx < G4int(targetDir.length())-1 )
571  {
572  G4int i = targetDir.index("/",idx);
573  G4String targetDirString = targetDir(0,i+1);
574  comTree = comTree->GetTree(targetDirString);
575  if( comTree == NULL )
576  { return NULL; }
577  idx = i+1;
578  }
579  return comTree;
580 }
G4String strip(G4int strip_Type=trailing, char c=' ')
G4UIcommandTree * treeTop
Definition: G4UImanager.hh:151
str_size index(const char *, G4int pos=0) const
int G4int
Definition: G4Types.hh:78
G4UIcommandTree * GetTree(G4int i)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ FindMacroPath()

G4String G4UImanager::FindMacroPath ( const G4String fname) const

Definition at line 694 of file G4UImanager.cc.

695 {
696  G4String macrofile = fname;
697 
698  for (size_t i = 0; i < searchDirs.size(); i++) {
699  G4String fullpath = searchDirs[i] + "/" + fname;
700  if ( FileFound(fullpath) ) {
701  macrofile = fullpath;
702  break;
703  }
704  }
705 
706  return macrofile;
707 }
static G4bool FileFound(const G4String &fname)
Definition: G4UImanager.cc:682
std::vector< G4String > searchDirs
Definition: G4UImanager.hh:168
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Foreach()

void G4UImanager::Foreach ( const char *  macroFile,
const char *  variableName,
const char *  candidates 
)

Definition at line 374 of file G4UImanager.cc.

376 {
377  G4String candidatesString = candidates;
378  G4Tokenizer parameterToken( candidatesString );
379  G4String cd;
380  while(!((cd=parameterToken()).isNull()))
381  {
382  G4String vl = variableName;
383  vl += " ";
384  vl += cd;
385  SetAlias(vl);
386  ExecuteMacroFile(FindMacroPath(macroFile));
387  }
388 }
void ExecuteMacroFile(const char *fileName)
Definition: G4UImanager.cc:292
void SetAlias(const char *aliasLine)
Definition: G4UImanager.cc:624
static const G4double cd
G4String FindMacroPath(const G4String &fname) const
Definition: G4UImanager.cc:694
Here is the call graph for this function:
Here is the caller graph for this function:

◆ ForeachS()

void G4UImanager::ForeachS ( const char *  valueList)

Definition at line 345 of file G4UImanager.cc.

346 {
347  G4String vl = valueList;
348  G4Tokenizer parameterToken(vl);
349  G4String mf = parameterToken();
350  G4String vn = parameterToken();
351  G4String c1 = parameterToken();
352  G4String ca;
353  while(!((ca=parameterToken()).isNull()))
354  {
355  c1 += " ";
356  c1 += ca;
357  }
358 
359  G4String aliasValue = c1;
360  if(aliasValue(0)=='"')
361  {
362  G4String strippedValue;
363  if(aliasValue(aliasValue.length()-1)=='"')
364  { strippedValue = aliasValue(1,aliasValue.length()-2); }
365  else
366  { strippedValue = aliasValue(1,aliasValue.length()-1); }
367  aliasValue = strippedValue;
368  }
369 
370 // Foreach(mf,vn,c1);
371  Foreach(mf,vn,aliasValue);
372 }
void Foreach(const char *macroFile, const char *variableName, const char *candidates)
Definition: G4UImanager.cc:374
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetCommandStack()

std::vector< G4String > * G4UImanager::GetCommandStack ( )

Definition at line 709 of file G4UImanager.cc.

710 {
711  std::vector<G4String>* returnValue = commandStack;
712  commandStack = new std::vector<G4String>;
713  return returnValue;
714 }
std::vector< G4String > * commandStack
Definition: G4UImanager.hh:255
Here is the caller graph for this function:

◆ GetCurrentDoubleValue() [1/2]

G4double G4UImanager::GetCurrentDoubleValue ( const char *  aCommand,
G4int  parameterNumber = 1,
G4bool  reGet = true 
)

Definition at line 256 of file G4UImanager.cc.

258 {
259  G4String targetParameter =
260  GetCurrentStringValue( aCommand, parameterNumber, reGet );
261  G4double value;
262  const char* t = targetParameter;
263  std::istringstream is(t);
264  is >> value;
265  return value;
266 }
G4String GetCurrentStringValue(const char *aCommand, G4int parameterNumber=1, G4bool reGet=true)
Definition: G4UImanager.cc:182
double G4double
Definition: G4Types.hh:76
Here is the call graph for this function:

◆ GetCurrentDoubleValue() [2/2]

G4double G4UImanager::GetCurrentDoubleValue ( const char *  aCommand,
const char *  aParameterName,
G4bool  reGet = true 
)

Definition at line 244 of file G4UImanager.cc.

246 {
247  G4String targetParameter =
248  GetCurrentStringValue( aCommand, aParameterName, reGet );
249  G4double value;
250  const char* t = targetParameter;
251  std::istringstream is(t);
252  is >> value;
253  return value;
254 }
G4String GetCurrentStringValue(const char *aCommand, G4int parameterNumber=1, G4bool reGet=true)
Definition: G4UImanager.cc:182
double G4double
Definition: G4Types.hh:76
Here is the call graph for this function:

◆ GetCurrentIntValue() [1/2]

G4int G4UImanager::GetCurrentIntValue ( const char *  aCommand,
G4int  parameterNumber = 1,
G4bool  reGet = true 
)

Definition at line 232 of file G4UImanager.cc.

234 {
235  G4String targetParameter =
236  GetCurrentStringValue( aCommand, parameterNumber, reGet );
237  G4int value;
238  const char* t = targetParameter;
239  std::istringstream is(t);
240  is >> value;
241  return value;
242 }
G4String GetCurrentStringValue(const char *aCommand, G4int parameterNumber=1, G4bool reGet=true)
Definition: G4UImanager.cc:182
int G4int
Definition: G4Types.hh:78
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetCurrentIntValue() [2/2]

G4int G4UImanager::GetCurrentIntValue ( const char *  aCommand,
const char *  aParameterName,
G4bool  reGet = true 
)

Definition at line 220 of file G4UImanager.cc.

222 {
223  G4String targetParameter =
224  GetCurrentStringValue( aCommand, aParameterName, reGet );
225  G4int value;
226  const char* t = targetParameter;
227  std::istringstream is(t);
228  is >> value;
229  return value;
230 }
G4String GetCurrentStringValue(const char *aCommand, G4int parameterNumber=1, G4bool reGet=true)
Definition: G4UImanager.cc:182
int G4int
Definition: G4Types.hh:78
Here is the call graph for this function:

◆ GetCurrentStringValue() [1/2]

G4String G4UImanager::GetCurrentStringValue ( const char *  aCommand,
G4int  parameterNumber = 1,
G4bool  reGet = true 
)

Definition at line 182 of file G4UImanager.cc.

184 {
185  if(reGet || savedCommand == NULL)
186  {
187  savedParameters = GetCurrentValues( aCommand );
188  }
189  G4Tokenizer savedToken( savedParameters );
190  G4String token;
191  for(G4int i_thParameter=0;i_thParameter<parameterNumber;i_thParameter++)
192  {
193  token = savedToken();
194  if( token.isNull() ) return G4String();
195  if( token[(size_t)0] == '"' )
196  {
197  token.append(" ");
198  token.append(savedToken("\""));
199  }
200  }
201  return token;
202 }
G4UIcommand * savedCommand
Definition: G4UImanager.hh:158
G4String savedParameters
Definition: G4UImanager.hh:157
int G4int
Definition: G4Types.hh:78
G4String GetCurrentValues(const char *aCommand)
Definition: G4UImanager.cc:170
G4String & append(const G4String &)
G4bool isNull() const
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetCurrentStringValue() [2/2]

G4String G4UImanager::GetCurrentStringValue ( const char *  aCommand,
const char *  aParameterName,
G4bool  reGet = true 
)

Definition at line 204 of file G4UImanager.cc.

206 {
207  if(reGet || savedCommand == NULL)
208  {
209  G4String parameterValues = GetCurrentValues( aCommand );
210  }
211  for(G4int i=0;i<savedCommand->GetParameterEntries();i++)
212  {
213  if( aParameterName ==
215  return GetCurrentStringValue(aCommand,i+1,false);
216  }
217  return G4String();
218 }
G4UIcommand * savedCommand
Definition: G4UImanager.hh:158
G4String GetCurrentStringValue(const char *aCommand, G4int parameterNumber=1, G4bool reGet=true)
Definition: G4UImanager.cc:182
G4UIparameter * GetParameter(G4int i) const
Definition: G4UIcommand.hh:145
int G4int
Definition: G4Types.hh:78
G4String GetParameterName() const
G4String GetCurrentValues(const char *aCommand)
Definition: G4UImanager.cc:170
G4int GetParameterEntries() const
Definition: G4UIcommand.hh:143
Here is the call graph for this function:

◆ GetCurrentValues()

G4String G4UImanager::GetCurrentValues ( const char *  aCommand)

Definition at line 170 of file G4UImanager.cc.

171 {
172  G4String theCommand = aCommand;
173  savedCommand = treeTop->FindPath( theCommand );
174  if( savedCommand == NULL )
175  {
176  G4cerr << "command not found" << G4endl;
177  return G4String();
178  }
179  return savedCommand->GetCurrentValue();
180 }
G4UIcommand * savedCommand
Definition: G4UImanager.hh:158
G4UIcommandTree * treeTop
Definition: G4UImanager.hh:151
G4UIcommand * FindPath(const char *commandPath) const
#define G4endl
Definition: G4ios.hh:61
G4String GetCurrentValue()
Definition: G4UIcommand.cc:234
G4GLOB_DLL std::ostream G4cerr
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetG4UIWindow()

G4UIsession* G4UImanager::GetG4UIWindow ( ) const
inline

Definition at line 210 of file G4UImanager.hh.

211  { return g4UIWindow; }
G4UIsession * g4UIWindow
Definition: G4UImanager.hh:153
Here is the caller graph for this function:

◆ GetMacroSearchPath()

const G4String& G4UImanager::GetMacroSearchPath ( ) const
inline

Definition at line 245 of file G4UImanager.hh.

246  { return searchPath; }
G4String searchPath
Definition: G4UImanager.hh:167
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetMasterUIpointer()

G4UImanager * G4UImanager::GetMasterUIpointer ( )
static

Definition at line 71 of file G4UImanager.cc.

72 { return fMasterUImanager; }
static G4UImanager * fMasterUImanager
Definition: G4UImanager.hh:150
Here is the caller graph for this function:

◆ GetMaxHistSize()

G4int G4UImanager::GetMaxHistSize ( ) const
inline

Definition at line 240 of file G4UImanager.hh.

241  { return maxHistSize; }
G4int maxHistSize
Definition: G4UImanager.hh:164
Here is the caller graph for this function:

◆ GetNumberOfHistory()

G4int G4UImanager::GetNumberOfHistory ( ) const
inline

Definition at line 229 of file G4UImanager.hh.

230  { return histVec.size(); }
std::vector< G4String > histVec
Definition: G4UImanager.hh:162
Here is the caller graph for this function:

◆ GetPauseAtBeginOfEvent()

G4bool G4UImanager::GetPauseAtBeginOfEvent ( ) const
inline

Definition at line 194 of file G4UImanager.hh.

195  { return pauseAtBeginOfEvent; }
G4bool pauseAtBeginOfEvent
Definition: G4UImanager.hh:165
Here is the caller graph for this function:

◆ GetPauseAtEndOfEvent()

G4bool G4UImanager::GetPauseAtEndOfEvent ( ) const
inline

Definition at line 198 of file G4UImanager.hh.

199  { return pauseAtEndOfEvent; }
G4bool pauseAtEndOfEvent
Definition: G4UImanager.hh:166
Here is the caller graph for this function:

◆ GetPreviousCommand()

G4String G4UImanager::GetPreviousCommand ( G4int  i) const
inline

Definition at line 231 of file G4UImanager.hh.

232  {
233  G4String st;
234  if(i>=0 && i<G4int(histVec.size()))
235  { st = histVec[i]; }
236  return st;
237  }
int G4int
Definition: G4Types.hh:78
std::vector< G4String > histVec
Definition: G4UImanager.hh:162
Here is the caller graph for this function:

◆ GetSession()

G4UIsession* G4UImanager::GetSession ( ) const
inline

Definition at line 208 of file G4UImanager.hh.

209  { return session; }
G4UIsession * session
Definition: G4UImanager.hh:152
Here is the caller graph for this function:

◆ GetThreadCout()

G4MTcoutDestination* G4UImanager::GetThreadCout ( )
inline

Definition at line 294 of file G4UImanager.hh.

294 {return threadCout;};
G4MTcoutDestination * threadCout
Definition: G4UImanager.hh:284

◆ GetThreadID()

G4int G4UImanager::GetThreadID ( ) const
inline

Definition at line 279 of file G4UImanager.hh.

280  { return threadID; }
G4int threadID
Definition: G4UImanager.hh:283

◆ GetTree()

G4UIcommandTree* G4UImanager::GetTree ( ) const
inline

Definition at line 206 of file G4UImanager.hh.

207  { return treeTop; }
G4UIcommandTree * treeTop
Definition: G4UImanager.hh:151
Here is the caller graph for this function:

◆ GetUIpointer()

G4UImanager * G4UImanager::GetUIpointer ( )
static

Definition at line 58 of file G4UImanager.cc.

59 {
60  if(!fUImanager)
61  {
63  {
64  fUImanager = new G4UImanager;
66  }
67  }
68  return fUImanager;
69 }
static G4ThreadLocal G4UImanager * fUImanager
Definition: G4UImanager.hh:148
void CreateMessenger()
Definition: G4UImanager.cc:98
static G4ThreadLocal G4bool fUImanagerHasBeenKilled
Definition: G4UImanager.hh:149
Here is the call graph for this function:

◆ GetVerboseLevel()

G4int G4UImanager::GetVerboseLevel ( ) const
inline

Definition at line 227 of file G4UImanager.hh.

228  { return verboseLevel; }
G4int verboseLevel
Definition: G4UImanager.hh:159
Here is the caller graph for this function:

◆ ListAlias()

void G4UImanager::ListAlias ( )

Definition at line 650 of file G4UImanager.cc.

651 {
652  aliasList->List();
653 }
G4UIaliasList * aliasList
Definition: G4UImanager.hh:163
Here is the call graph for this function:
Here is the caller graph for this function:

◆ ListCommands()

void G4UImanager::ListCommands ( const char *  direc)

Definition at line 551 of file G4UImanager.cc.

552 {
553  G4UIcommandTree* comTree = FindDirectory(direct);
554  if(comTree)
555  { comTree->List(); }
556  else
557  { G4cout << direct << " is not found." << G4endl; }
558 }
void List() const
G4GLOB_DLL std::ostream G4cout
#define G4endl
Definition: G4ios.hh:61
G4UIcommandTree * FindDirectory(const char *dirName)
Definition: G4UImanager.cc:560
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Loop()

void G4UImanager::Loop ( const char *  macroFile,
const char *  variableName,
G4double  initialValue,
G4double  finalValue,
G4double  stepSize = 1.0 
)

Definition at line 321 of file G4UImanager.cc.

323 {
324  G4String cd;
325  if (stepSize > 0) {
326  for(G4double d=initialValue;d<=finalValue;d+=stepSize)
327  {
328  std::ostringstream os;
329  os << d;
330  cd += os.str();
331  cd += " ";
332  }
333  } else {
334  for(G4double d=initialValue;d>=finalValue;d+=stepSize)
335  {
336  std::ostringstream os;
337  os << d;
338  cd += os.str();
339  cd += " ";
340  }
341  }
342  Foreach(macroFile,variableName,cd);
343 }
void Foreach(const char *macroFile, const char *variableName, const char *candidates)
Definition: G4UImanager.cc:374
Float_t d
static const G4double cd
double G4double
Definition: G4Types.hh:76
Here is the call graph for this function:
Here is the caller graph for this function:

◆ LoopS()

void G4UImanager::LoopS ( const char *  valueList)

Definition at line 301 of file G4UImanager.cc.

302 {
303  G4String vl = valueList;
304  G4Tokenizer parameterToken(vl);
305  G4String mf = parameterToken();
306  G4String vn = parameterToken();
307  G4String c1 = parameterToken();
308  c1 += " ";
309  c1 += parameterToken();
310  c1 += " ";
311  c1 += parameterToken();
312  const char* t1 = c1;
313  std::istringstream is(t1);
314  G4double d1;
315  G4double d2;
316  G4double d3;
317  is >> d1 >> d2 >> d3;
318  Loop(mf,vn,d1,d2,d3);
319 }
static const G4double d3
TTree * t1
Definition: plottest35.C:26
static const G4double d1
void Loop(const char *macroFile, const char *variableName, G4double initialValue, G4double finalValue, G4double stepSize=1.0)
Definition: G4UImanager.cc:321
double G4double
Definition: G4Types.hh:76
static const G4double d2
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Notify()

G4bool G4UImanager::Notify ( G4ApplicationState  requestedState)
virtual

Implements G4VStateDependent.

Definition at line 582 of file G4UImanager.cc.

583 {
584  //G4cout << G4StateManager::GetStateManager()->GetStateString(requestedState) << " <--- " << G4StateManager::GetStateManager()->GetStateString(G4StateManager::GetStateManager()->GetPreviousState()) << G4endl;
586  {
587  if(requestedState==G4State_EventProc &&
589  { PauseSession("BeginOfEvent"); }
590  }
592  {
593  if(requestedState==G4State_GeomClosed &&
594  G4StateManager::GetStateManager()->GetPreviousState()==G4State_EventProc)
595  { PauseSession("EndOfEvent"); }
596  }
597  return true;
598 }
static G4StateManager * GetStateManager()
void PauseSession(const char *msg)
Definition: G4UImanager.cc:546
G4bool pauseAtEndOfEvent
Definition: G4UImanager.hh:166
G4bool pauseAtBeginOfEvent
Definition: G4UImanager.hh:165
Here is the call graph for this function:

◆ operator!=()

G4int G4UImanager::operator!= ( const G4UImanager right) const
private

Definition at line 167 of file G4UImanager.cc.

168 { return (this!=&right); }

◆ operator=()

const G4UImanager & G4UImanager::operator= ( const G4UImanager right)
private

Definition at line 163 of file G4UImanager.cc.

164 { return right; }

◆ operator==()

G4int G4UImanager::operator== ( const G4UImanager right) const
private

Definition at line 165 of file G4UImanager.cc.

166 { return (this==&right); }

◆ ParseMacroSearchPath()

void G4UImanager::ParseMacroSearchPath ( )

Definition at line 664 of file G4UImanager.cc.

665 {
666  searchDirs.clear();
667 
668  size_t idxfirst = 0;
669  size_t idxend = 0;
670  G4String pathstring = "";
671  while( (idxend = searchPath.index(':', idxfirst)) != G4String::npos) {
672  pathstring = searchPath.substr(idxfirst, idxend-idxfirst);
673  if(pathstring.size() != 0) searchDirs.push_back(pathstring);
674  idxfirst = idxend + 1;
675  }
676 
677  pathstring = searchPath.substr(idxfirst, searchPath.size()-idxfirst);
678  if(pathstring.size() != 0) searchDirs.push_back(pathstring);
679 }
str_size index(const char *, G4int pos=0) const
std::vector< G4String > searchDirs
Definition: G4UImanager.hh:168
G4String searchPath
Definition: G4UImanager.hh:167
Here is the call graph for this function:
Here is the caller graph for this function:

◆ PauseSession()

void G4UImanager::PauseSession ( const char *  msg)
private

Definition at line 546 of file G4UImanager.cc.

547 {
549 }
virtual void PauseSessionStart(const G4String &Prompt)
Definition: G4UIsession.cc:40
G4UIsession * session
Definition: G4UImanager.hh:152
Here is the call graph for this function:
Here is the caller graph for this function:

◆ RegisterBridge()

void G4UImanager::RegisterBridge ( G4UIbridge brg)

Definition at line 716 of file G4UImanager.cc.

717 {
718  if(brg->LocalUI()==this)
719  {
720  G4Exception("G4UImanager::RegisterBridge()","UI7002",FatalException,
721  "G4UIBridge cannot bridge between same object.");
722  }
723  else
724  { bridges->push_back(brg); }
725 }
G4UImanager * LocalUI() const
Definition: G4UIbridge.hh:72
std::vector< G4UIbridge * > * bridges
Definition: G4UImanager.hh:252
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
Definition: G4Exception.cc:41
Here is the call graph for this function:
Here is the caller graph for this function:

◆ RemoveAlias()

void G4UImanager::RemoveAlias ( const char *  aliasName)

Definition at line 643 of file G4UImanager.cc.

644 {
645  G4String aL = aliasName;
646  G4String targetAlias = aL.strip(G4String::both);
647  aliasList->RemoveAlias(targetAlias);
648 }
G4String strip(G4int strip_Type=trailing, char c=' ')
G4UIaliasList * aliasList
Definition: G4UImanager.hh:163
void RemoveAlias(const char *aliasName)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ RemoveCommand()

void G4UImanager::RemoveCommand ( G4UIcommand aCommand)

Definition at line 280 of file G4UImanager.cc.

281 {
282  treeTop->RemoveCommand( aCommand );
284  { fMasterUImanager->RemoveWorkerCommand(aCommand); }
285 }
G4UIcommandTree * treeTop
Definition: G4UImanager.hh:151
static G4UImanager * fMasterUImanager
Definition: G4UImanager.hh:150
void RemoveWorkerCommand(G4UIcommand *aCommand)
Definition: G4UImanager.cc:287
void RemoveCommand(G4UIcommand *aCommand, G4bool workerThreadOnly=false)
G4int G4GetThreadId()
Definition: G4Threading.cc:134
Here is the call graph for this function:
Here is the caller graph for this function:

◆ RemoveWorkerCommand()

void G4UImanager::RemoveWorkerCommand ( G4UIcommand aCommand)
private

Definition at line 287 of file G4UImanager.cc.

288 {
289  treeTop->RemoveCommand( aCommand, true );
290 }
G4UIcommandTree * treeTop
Definition: G4UImanager.hh:151
void RemoveCommand(G4UIcommand *aCommand, G4bool workerThreadOnly=false)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ SetAlias()

void G4UImanager::SetAlias ( const char *  aliasLine)

Definition at line 624 of file G4UImanager.cc.

625 {
626  G4String aLine = aliasLine;
627  G4int i = aLine.index(" ");
628  G4String aliasName = aLine(0,i);
629  G4String aliasValue = aLine(i+1,aLine.length()-(i+1));
630  if(aliasValue(0)=='"')
631  {
632  G4String strippedValue;
633  if(aliasValue(aliasValue.length()-1)=='"')
634  { strippedValue = aliasValue(1,aliasValue.length()-2); }
635  else
636  { strippedValue = aliasValue(1,aliasValue.length()-1); }
637  aliasValue = strippedValue;
638  }
639 
640  aliasList->ChangeAlias(aliasName,aliasValue);
641 }
str_size index(const char *, G4int pos=0) const
int G4int
Definition: G4Types.hh:78
G4UIaliasList * aliasList
Definition: G4UImanager.hh:163
void ChangeAlias(const char *aliasName, const char *aliasValue)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ SetCerrFileName()

void G4UImanager::SetCerrFileName ( const G4String fileN = "G4cerr.txt",
G4bool  ifAppend = true 
)

Definition at line 760 of file G4UImanager.cc.

761 {
762  // for sequential mode, ignore this method.
763  if(threadID<0) return;
764 
765  if(fileN == "**Screen**")
766  { threadCout->SetCerrFileName(fileN,ifAppend); }
767  else
768  {
769  std::stringstream fn;
770  fn<<"G4W_"<<threadID<<"_"<<fileN;
771  threadCout->SetCerrFileName(fn.str(),ifAppend);
772  }
773 }
void SetCerrFileName(const G4String &fileN="G4cerr.txt", G4bool ifAppend=true)
G4MTcoutDestination * threadCout
Definition: G4UImanager.hh:284
G4int threadID
Definition: G4UImanager.hh:283
Here is the call graph for this function:
Here is the caller graph for this function:

◆ SetCoutDestination()

void G4UImanager::SetCoutDestination ( G4UIsession *const  value)

Definition at line 618 of file G4UImanager.cc.

619 {
620  G4coutbuf.SetDestination(value);
621  G4cerrbuf.SetDestination(value);
622 }
G4strstreambuf G4coutbuf
Definition: G4ios.cc:82
void SetDestination(G4coutDestination *dest)
G4strstreambuf G4cerrbuf
Definition: G4ios.cc:83
Here is the call graph for this function:
Here is the caller graph for this function:

◆ SetCoutFileName()

void G4UImanager::SetCoutFileName ( const G4String fileN = "G4cout.txt",
G4bool  ifAppend = true 
)

Definition at line 745 of file G4UImanager.cc.

746 {
747  // for sequential mode, ignore this method.
748  if(threadID<0) return;
749 
750  if(fileN == "**Screen**")
751  { threadCout->SetCoutFileName(fileN,ifAppend); }
752  else
753  {
754  std::stringstream fn;
755  fn<<"G4W_"<<threadID<<"_"<<fileN;
756  threadCout->SetCoutFileName(fn.str(),ifAppend);
757  }
758 }
void SetCoutFileName(const G4String &fileN="G4cout.txt", G4bool ifAppend=true)
G4MTcoutDestination * threadCout
Definition: G4UImanager.hh:284
G4int threadID
Definition: G4UImanager.hh:283
Here is the call graph for this function:
Here is the caller graph for this function:

◆ SetG4UIWindow()

void G4UImanager::SetG4UIWindow ( G4UIsession *const  value)
inline

Definition at line 215 of file G4UImanager.hh.

216  { g4UIWindow = value; }
G4UIsession * g4UIWindow
Definition: G4UImanager.hh:153
Here is the call graph for this function:

◆ SetIgnoreCmdNotFound()

void G4UImanager::SetIgnoreCmdNotFound ( G4bool  val)
inline

Definition at line 269 of file G4UImanager.hh.

270  { ignoreCmdNotFound = val; }
G4bool ignoreCmdNotFound
Definition: G4UImanager.hh:253
Here is the call graph for this function:
Here is the caller graph for this function:

◆ SetMacroSearchPath()

void G4UImanager::SetMacroSearchPath ( const G4String path)
inline

Definition at line 243 of file G4UImanager.hh.

244  { searchPath = path; }
G4String searchPath
Definition: G4UImanager.hh:167
Here is the caller graph for this function:

◆ SetMasterUIManager()

void G4UImanager::SetMasterUIManager ( G4bool  val)
inline

Definition at line 258 of file G4UImanager.hh.

259  {
260  isMaster = val;
261  //ignoreCmdNotFound = val;
263  if(val&&!bridges)
264  {
265  bridges = new std::vector<G4UIbridge*>;
266  fMasterUImanager = this;
267  }
268  }
G4bool isMaster
Definition: G4UImanager.hh:251
static G4UImanager * fMasterUImanager
Definition: G4UImanager.hh:150
G4bool stackCommandsForBroadcast
Definition: G4UImanager.hh:254
std::vector< G4UIbridge * > * bridges
Definition: G4UImanager.hh:252
Here is the caller graph for this function:

◆ SetMaxHistSize()

void G4UImanager::SetMaxHistSize ( G4int  mx)
inline

Definition at line 238 of file G4UImanager.hh.

239  { maxHistSize = mx; }
G4int maxHistSize
Definition: G4UImanager.hh:164
Here is the caller graph for this function:

◆ SetPauseAtBeginOfEvent()

void G4UImanager::SetPauseAtBeginOfEvent ( G4bool  vl)
inline

Definition at line 192 of file G4UImanager.hh.

193  { pauseAtBeginOfEvent = vl; }
G4bool pauseAtBeginOfEvent
Definition: G4UImanager.hh:165
Here is the caller graph for this function:

◆ SetPauseAtEndOfEvent()

void G4UImanager::SetPauseAtEndOfEvent ( G4bool  vl)
inline

Definition at line 196 of file G4UImanager.hh.

197  { pauseAtEndOfEvent = vl; }
G4bool pauseAtEndOfEvent
Definition: G4UImanager.hh:166
Here is the caller graph for this function:

◆ SetSession()

void G4UImanager::SetSession ( G4UIsession *const  value)
inline

Definition at line 213 of file G4UImanager.hh.

214  { session = value; }
G4UIsession * session
Definition: G4UImanager.hh:152
Here is the caller graph for this function:

◆ SetThreadIgnore()

void G4UImanager::SetThreadIgnore ( G4int  tid = 0)

Definition at line 789 of file G4UImanager.cc.

790 {
791  // for sequential mode, ignore this method.
792  if(threadID<0)
793  {
794  igThreadID = tid;
795  return;
796  }
798 }
static G4int igThreadID
Definition: G4UImanager.hh:285
G4MTcoutDestination * threadCout
Definition: G4UImanager.hh:284
void SetIgnoreCout(G4int tid=0)
G4int threadID
Definition: G4UImanager.hh:283
Here is the call graph for this function:
Here is the caller graph for this function:

◆ SetThreadIgnoreInit()

void G4UImanager::SetThreadIgnoreInit ( G4bool  flg = true)

Definition at line 800 of file G4UImanager.cc.

801 {
802  // for sequential mode, ignore this method.
803  if(threadID<0) { return; }
805 }
void SetIgnoreInit(G4bool val=true)
G4MTcoutDestination * threadCout
Definition: G4UImanager.hh:284
G4int threadID
Definition: G4UImanager.hh:283
Here is the call graph for this function:
Here is the caller graph for this function:

◆ SetThreadPrefixString()

void G4UImanager::SetThreadPrefixString ( const G4String s = "W")

Definition at line 775 of file G4UImanager.cc.

776 {
777  // for sequential mode, ignore this method.
778  if(threadID<0) return;
780 }
void SetPrefixString(const G4String &wd="G4WT")
G4MTcoutDestination * threadCout
Definition: G4UImanager.hh:284
G4int threadID
Definition: G4UImanager.hh:283
Here is the call graph for this function:
Here is the caller graph for this function:

◆ SetThreadUseBuffer()

void G4UImanager::SetThreadUseBuffer ( G4bool  flg = true)

Definition at line 782 of file G4UImanager.cc.

783 {
784  // for sequential mode, ignore this method.
785  if(threadID<0) return;
787 }
G4MTcoutDestination * threadCout
Definition: G4UImanager.hh:284
void EnableBuffering(G4bool flag=true)
G4int threadID
Definition: G4UImanager.hh:283
Here is the call graph for this function:
Here is the caller graph for this function:

◆ SetUpForAThread()

void G4UImanager::SetUpForAThread ( G4int  tId)

Definition at line 727 of file G4UImanager.cc.

728 {
729  threadID = tId;
733 }
static G4int igThreadID
Definition: G4UImanager.hh:285
G4MTcoutDestination * threadCout
Definition: G4UImanager.hh:284
void SetIgnoreCout(G4int tid=0)
G4int threadID
Definition: G4UImanager.hh:283
void G4iosInitialization()
Definition: G4ios.cc:85
Here is the call graph for this function:
Here is the caller graph for this function:

◆ SetUpForSpecialThread()

void G4UImanager::SetUpForSpecialThread ( G4String  aPrefix)

Definition at line 735 of file G4UImanager.cc.

736 {
743 }
static G4int igThreadID
Definition: G4UImanager.hh:285
void G4SetThreadId(G4int aNewValue)
Definition: G4Threading.cc:137
void SetPrefixString(const G4String &wd="G4WT")
G4MTcoutDestination * threadCout
Definition: G4UImanager.hh:284
void SetIgnoreCout(G4int tid=0)
G4int threadID
Definition: G4UImanager.hh:283
void G4iosInitialization()
Definition: G4ios.cc:85
Here is the call graph for this function:
Here is the caller graph for this function:

◆ SetVerboseLevel()

void G4UImanager::SetVerboseLevel ( G4int  val)
inline

Definition at line 225 of file G4UImanager.hh.

226  { verboseLevel = val; }
G4int verboseLevel
Definition: G4UImanager.hh:159
Here is the caller graph for this function:

◆ SolveAlias()

G4String G4UImanager::SolveAlias ( const char *  aCmd)

Definition at line 391 of file G4UImanager.cc.

392 {
393  G4String aCommand = aCmd;
394  G4int ia = aCommand.index("{");
395  G4int iz = aCommand.index("#");
396  while((ia != G4int(std::string::npos))&&((iz==G4int(std::string::npos))||(ia<iz)))
397  {
398  G4int ibx = -1;
399  while(ibx<0)
400  {
401  G4int ib = aCommand.index("}");
402  if( ib == G4int(std::string::npos) )
403  {
404  G4cerr << aCommand << G4endl;
405  for(G4int i=0;i<ia;i++) G4cerr << " ";
406  G4cerr << "^" << G4endl;
407  G4cerr << "Unmatched alias parenthis -- command ignored" << G4endl;
408  G4String nullStr;
409  return nullStr;
410  }
411  G4String ps = aCommand(ia+1,aCommand.length()-(ia+1));
412  G4int ic = ps.index("{");
413  G4int id = ps.index("}");
414  if(ic!=G4int(std::string::npos) && ic < id)
415  { ia+=ic+1; }
416  else
417  { ibx = ib; }
418  }
419  //--- Here ia represents the position of innermost "{"
420  //--- and ibx represents corresponding "}"
421  G4String subs;
422  if(ia>0) subs = aCommand(0,ia);
423  G4String alis = aCommand(ia+1,ibx-ia-1);
424  G4String rems = aCommand(ibx+1,aCommand.length()-ibx);
425  // G4cout << "<" << subs << "> <" << alis << "> <" << rems << ">" << G4endl;
426  G4String* alVal = aliasList->FindAlias(alis);
427  if(!alVal)
428  {
429  G4cerr << "Alias <" << alis << "> not found -- command ignored" << G4endl;
430  G4String nullStr;
431  return nullStr;
432  }
433  aCommand = subs+(*alVal)+rems;
434  ia = aCommand.index("{");
435  }
436  return aCommand;
437 }
str_size index(const char *, G4int pos=0) const
int G4int
Definition: G4Types.hh:78
G4UIaliasList * aliasList
Definition: G4UImanager.hh:163
G4double iz
Definition: TRTMaterials.hh:39
G4String * FindAlias(const char *aliasName)
#define G4endl
Definition: G4ios.hh:61
G4GLOB_DLL std::ostream G4cerr
Here is the call graph for this function:
Here is the caller graph for this function:

◆ StoreHistory() [1/2]

void G4UImanager::StoreHistory ( const char *  fileName = "G4history.macro")

Definition at line 526 of file G4UImanager.cc.

527 { StoreHistory(true,fileName); }
void StoreHistory(const char *fileName="G4history.macro")
Definition: G4UImanager.cc:526
Here is the caller graph for this function:

◆ StoreHistory() [2/2]

void G4UImanager::StoreHistory ( G4bool  historySwitch,
const char *  fileName = "G4history.macro" 
)

Definition at line 529 of file G4UImanager.cc.

530 {
531  if(historySwitch)
532  {
533  if(saveHistory)
534  { historyFile.close(); }
535  historyFile.open((char*)fileName);
536  saveHistory = true;
537  }
538  else
539  {
540  historyFile.close();
541  saveHistory = false;
542  }
543  saveHistory = historySwitch;
544 }
std::ofstream historyFile
Definition: G4UImanager.hh:160
G4bool saveHistory
Definition: G4UImanager.hh:161

Member Data Documentation

◆ aliasList

G4UIaliasList* G4UImanager::aliasList
private

Definition at line 163 of file G4UImanager.hh.

◆ bridges

std::vector<G4UIbridge*>* G4UImanager::bridges
private

Definition at line 252 of file G4UImanager.hh.

◆ commandStack

std::vector<G4String>* G4UImanager::commandStack
private

Definition at line 255 of file G4UImanager.hh.

◆ CoutMessenger

G4LocalThreadCoutMessenger* G4UImanager::CoutMessenger
private

Definition at line 156 of file G4UImanager.hh.

◆ fMasterUImanager

G4UImanager * G4UImanager::fMasterUImanager = 0
staticprivate

Definition at line 150 of file G4UImanager.hh.

◆ fUImanager

G4ThreadLocal G4UImanager * G4UImanager::fUImanager = 0
staticprivate

Definition at line 148 of file G4UImanager.hh.

◆ fUImanagerHasBeenKilled

G4ThreadLocal G4bool G4UImanager::fUImanagerHasBeenKilled = false
staticprivate

Definition at line 149 of file G4UImanager.hh.

◆ g4UIWindow

G4UIsession* G4UImanager::g4UIWindow
private

Definition at line 153 of file G4UImanager.hh.

◆ historyFile

std::ofstream G4UImanager::historyFile
private

Definition at line 160 of file G4UImanager.hh.

◆ histVec

std::vector<G4String> G4UImanager::histVec
private

Definition at line 162 of file G4UImanager.hh.

◆ ignoreCmdNotFound

G4bool G4UImanager::ignoreCmdNotFound
private

Definition at line 253 of file G4UImanager.hh.

◆ igThreadID

G4int G4UImanager::igThreadID = -1
staticprivate

Definition at line 285 of file G4UImanager.hh.

◆ isMaster

G4bool G4UImanager::isMaster
private

Definition at line 251 of file G4UImanager.hh.

◆ maxHistSize

G4int G4UImanager::maxHistSize
private

Definition at line 164 of file G4UImanager.hh.

◆ pauseAtBeginOfEvent

G4bool G4UImanager::pauseAtBeginOfEvent
private

Definition at line 165 of file G4UImanager.hh.

◆ pauseAtEndOfEvent

G4bool G4UImanager::pauseAtEndOfEvent
private

Definition at line 166 of file G4UImanager.hh.

◆ savedCommand

G4UIcommand* G4UImanager::savedCommand
private

Definition at line 158 of file G4UImanager.hh.

◆ savedParameters

G4String G4UImanager::savedParameters
private

Definition at line 157 of file G4UImanager.hh.

◆ saveHistory

G4bool G4UImanager::saveHistory
private

Definition at line 161 of file G4UImanager.hh.

◆ searchDirs

std::vector<G4String> G4UImanager::searchDirs
private

Definition at line 168 of file G4UImanager.hh.

◆ searchPath

G4String G4UImanager::searchPath
private

Definition at line 167 of file G4UImanager.hh.

◆ session

G4UIsession* G4UImanager::session
private

Definition at line 152 of file G4UImanager.hh.

◆ stackCommandsForBroadcast

G4bool G4UImanager::stackCommandsForBroadcast
private

Definition at line 254 of file G4UImanager.hh.

◆ threadCout

G4MTcoutDestination* G4UImanager::threadCout
private

Definition at line 284 of file G4UImanager.hh.

◆ threadID

G4int G4UImanager::threadID
private

Definition at line 283 of file G4UImanager.hh.

◆ treeTop

G4UIcommandTree* G4UImanager::treeTop
private

Definition at line 151 of file G4UImanager.hh.

◆ UImessenger

G4UIcontrolMessenger* G4UImanager::UImessenger
private

Definition at line 154 of file G4UImanager.hh.

◆ UnitsMessenger

G4UnitsMessenger* G4UImanager::UnitsMessenger
private

Definition at line 155 of file G4UImanager.hh.

◆ verboseLevel

G4int G4UImanager::verboseLevel
private

Definition at line 159 of file G4UImanager.hh.


The documentation for this class was generated from the following files: