#include <G4UImanager.hh>
Inheritance 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 |
G4UIcommandTree * | GetTree () const |
G4UIsession * | GetSession () const |
G4UIsession * | GetG4UIWindow () 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 G4String & | GetMacroSearchPath () const |
void | ParseMacroSearchPath () |
G4String | FindMacroPath (const G4String &fname) const |
Static Public Member Functions | |
static G4UImanager * | GetUIpointer () |
Protected Member Functions | |
G4UImanager () |
Definition at line 53 of file G4UImanager.hh.
G4UImanager::G4UImanager | ( | ) | [protected] |
Definition at line 64 of file G4UImanager.cc.
References SetCoutDestination().
00065 : G4VStateDependent(true), 00066 UImessenger(0), UnitsMessenger(0) 00067 { 00068 savedCommand = 0; 00069 treeTop = new G4UIcommandTree("/"); 00070 aliasList = new G4UIaliasList; 00071 G4String nullString; 00072 savedParameters = nullString; 00073 verboseLevel = 0; 00074 saveHistory = false; 00075 session = NULL; 00076 g4UIWindow = NULL; 00077 SetCoutDestination(session); 00078 pauseAtBeginOfEvent = false; 00079 pauseAtEndOfEvent = false; 00080 maxHistSize = 20; 00081 searchPath=""; 00082 }
G4UImanager::~G4UImanager | ( | ) |
Definition at line 90 of file G4UImanager.cc.
References SetCoutDestination().
00091 { 00092 SetCoutDestination(NULL); 00093 histVec.clear(); 00094 if(saveHistory) historyFile.close(); 00095 delete UImessenger; 00096 delete UnitsMessenger; 00097 delete treeTop; 00098 delete aliasList; 00099 fUImanagerHasBeenKilled = true; 00100 fUImanager = NULL; 00101 }
void G4UImanager::AddNewCommand | ( | G4UIcommand * | newCommand | ) |
Definition at line 220 of file G4UImanager.cc.
References G4UIcommandTree::AddNewCommand().
00221 { 00222 treeTop->AddNewCommand( newCommand ); 00223 }
Definition at line 364 of file G4UImanager.cc.
References ApplyCommand(), and G4String::data().
00365 { 00366 return ApplyCommand(aCmd.data()); 00367 }
G4int G4UImanager::ApplyCommand | ( | const char * | aCommand | ) |
Definition at line 369 of file G4UImanager.cc.
References G4UIcommand::DoIt(), fAliasNotFound, fCommandNotFound, fIllegalApplicationState, G4UIcommandTree::FindPath(), G4cout, G4endl, G4String::index(), G4UIcommand::IsAvailable(), G4String::isNull(), G4String::remove(), and SolveAlias().
Referenced by G4IonTable::AddProcessManager(), ApplyCommand(), G4VBasicShell::ExecuteCommand(), G4RunManager::ProcessOneEvent(), G4VVisCommandViewer::RefreshIfRequired(), G4RunManager::rndmSaveThisEvent(), G4RunManager::rndmSaveThisRun(), G4VVisCommandGeometrySet::Set(), G4VisCommandViewerFlush::SetNewValue(), G4VisCommandViewerCreate::SetNewValue(), G4VisCommandViewerClone::SetNewValue(), G4VisCommandSceneAddTrajectories::SetNewValue(), G4VisCommandGeometryRestore::SetNewValue(), G4VisCommandSpecify::SetNewValue(), G4VisCommandOpen::SetNewValue(), G4VisCommandDrawVolume::SetNewValue(), G4VisCommandDrawView::SetNewValue(), G4VisCommandDrawTree::SetNewValue(), G4VisCommandReviewKeptEvents::SetNewValue(), G4VisCommandList::SetNewValue(), G4UIcontrolMessenger::SetNewValue(), G4TrackingMessenger::SetNewValue(), G4ProcessTableMessenger::SetNewValue(), G4ProcessManagerMessenger::SetNewValue(), G4EnergyLossMessenger::SetNewValue(), G4VisCommandGeometrySetVisibility::SetNewValueOnLV(), and G4TheRayTracer::Trace().
00370 { 00371 G4String aCommand = SolveAlias(aCmd); 00372 if(aCommand.isNull()) return fAliasNotFound; 00373 if(verboseLevel) G4cout << aCommand << G4endl; 00374 G4String commandString; 00375 G4String commandParameter; 00376 00377 G4int i = aCommand.index(" "); 00378 if( i != G4int(std::string::npos) ) 00379 { 00380 commandString = aCommand(0,i); 00381 commandParameter = aCommand(i+1,aCommand.length()-(i+1)); 00382 } 00383 else 00384 { 00385 commandString = aCommand; 00386 } 00387 00388 // remove doubled slash 00389 G4int len = commandString.length(); 00390 G4int ll = 0; 00391 G4String a1; 00392 G4String a2; 00393 while(ll<len-1) 00394 { 00395 if(commandString(ll,2)=="//") 00396 { 00397 if(ll==0) 00398 { commandString.remove(ll,1); } 00399 else 00400 { 00401 a1 = commandString(0,ll); 00402 a2 = commandString(ll+1,len-ll-1); 00403 commandString = a1+a2; 00404 } 00405 len--; 00406 } 00407 else 00408 { ll++; } 00409 } 00410 00411 G4UIcommand * targetCommand = treeTop->FindPath( commandString ); 00412 if( targetCommand == NULL ) 00413 { return fCommandNotFound; } 00414 00415 if(!(targetCommand->IsAvailable())) 00416 { return fIllegalApplicationState; } 00417 00418 if(saveHistory) historyFile << aCommand << G4endl; 00419 if( G4int(histVec.size()) >= maxHistSize ) 00420 { histVec.erase(histVec.begin()); } 00421 histVec.push_back(aCommand); 00422 return targetCommand->DoIt( commandParameter ); 00423 }
void G4UImanager::CreateHTML | ( | const char * | dir = "/" |
) |
Definition at line 554 of file G4UImanager.cc.
References G4UIcommandTree::CreateHTML(), G4cerr, and G4endl.
Referenced by G4UIcontrolMessenger::SetNewValue().
00555 { 00556 G4UIcommandTree* tr = FindDirectory(dir); 00557 if(tr!=0) 00558 { tr->CreateHTML(); } 00559 else 00560 { G4cerr << "Directory <" << dir << "> is not found." << G4endl; } 00561 }
void G4UImanager::ExecuteMacroFile | ( | const char * | fileName | ) |
Definition at line 230 of file G4UImanager.cc.
References G4UIsession::SessionStart().
Referenced by Foreach(), and G4UIcontrolMessenger::SetNewValue().
00231 { 00232 G4UIsession* batchSession = new G4UIbatch(fileName,session); 00233 session = batchSession; 00234 G4UIsession* previousSession = session->SessionStart(); 00235 delete session; 00236 session = previousSession; 00237 }
Definition at line 593 of file G4UImanager.cc.
00594 { 00595 G4String macrofile = fname; 00596 00597 for (size_t i = 0; i < searchDirs.size(); i++) { 00598 G4String fullpath = searchDirs[i] + "/" + fname; 00599 if ( FileFound(fullpath) ) { 00600 macrofile = fullpath; 00601 break; 00602 } 00603 } 00604 00605 return macrofile; 00606 }
void G4UImanager::Foreach | ( | const char * | macroFile, | |
const char * | variableName, | |||
const char * | candidates | |||
) |
Definition at line 299 of file G4UImanager.cc.
References ExecuteMacroFile(), and SetAlias().
Referenced by ForeachS(), and Loop().
00301 { 00302 G4String candidatesString = candidates; 00303 G4Tokenizer parameterToken( candidatesString ); 00304 G4String cd; 00305 while(!((cd=parameterToken()).isNull())) 00306 { 00307 G4String vl = variableName; 00308 vl += " "; 00309 vl += cd; 00310 SetAlias(vl); 00311 ExecuteMacroFile(macroFile); 00312 } 00313 }
void G4UImanager::ForeachS | ( | const char * | valueList | ) |
Definition at line 283 of file G4UImanager.cc.
References Foreach().
Referenced by G4UIcontrolMessenger::SetNewValue().
00284 { 00285 G4String vl = valueList; 00286 G4Tokenizer parameterToken(vl); 00287 G4String mf = parameterToken(); 00288 G4String vn = parameterToken(); 00289 G4String c1 = parameterToken(); 00290 G4String ca; 00291 while(!((ca=parameterToken()).isNull())) 00292 { 00293 c1 += " "; 00294 c1 += ca; 00295 } 00296 Foreach(mf,vn,c1); 00297 }
G4double G4UImanager::GetCurrentDoubleValue | ( | const char * | aCommand, | |
const char * | aParameterName, | |||
G4bool | reGet = true | |||
) |
Definition at line 196 of file G4UImanager.cc.
References GetCurrentStringValue().
00198 { 00199 G4String targetParameter = 00200 GetCurrentStringValue( aCommand, aParameterName, reGet ); 00201 G4double value; 00202 const char* t = targetParameter; 00203 std::istringstream is(t); 00204 is >> value; 00205 return value; 00206 }
G4double G4UImanager::GetCurrentDoubleValue | ( | const char * | aCommand, | |
G4int | parameterNumber = 1 , |
|||
G4bool | reGet = true | |||
) |
Definition at line 208 of file G4UImanager.cc.
References GetCurrentStringValue().
00210 { 00211 G4String targetParameter = 00212 GetCurrentStringValue( aCommand, parameterNumber, reGet ); 00213 G4double value; 00214 const char* t = targetParameter; 00215 std::istringstream is(t); 00216 is >> value; 00217 return value; 00218 }
G4int G4UImanager::GetCurrentIntValue | ( | const char * | aCommand, | |
const char * | aParameterName, | |||
G4bool | reGet = true | |||
) |
Definition at line 172 of file G4UImanager.cc.
References GetCurrentStringValue().
00174 { 00175 G4String targetParameter = 00176 GetCurrentStringValue( aCommand, aParameterName, reGet ); 00177 G4int value; 00178 const char* t = targetParameter; 00179 std::istringstream is(t); 00180 is >> value; 00181 return value; 00182 }
G4int G4UImanager::GetCurrentIntValue | ( | const char * | aCommand, | |
G4int | parameterNumber = 1 , |
|||
G4bool | reGet = true | |||
) |
Definition at line 184 of file G4UImanager.cc.
References GetCurrentStringValue().
Referenced by G4TheRayTracer::Trace().
00186 { 00187 G4String targetParameter = 00188 GetCurrentStringValue( aCommand, parameterNumber, reGet ); 00189 G4int value; 00190 const char* t = targetParameter; 00191 std::istringstream is(t); 00192 is >> value; 00193 return value; 00194 }
G4String G4UImanager::GetCurrentStringValue | ( | const char * | aCommand, | |
const char * | aParameterName, | |||
G4bool | reGet = true | |||
) |
Definition at line 156 of file G4UImanager.cc.
References GetCurrentStringValue(), GetCurrentValues(), G4UIcommand::GetParameter(), G4UIcommand::GetParameterEntries(), and G4UIparameter::GetParameterName().
00158 { 00159 if(reGet || savedCommand == NULL) 00160 { 00161 G4String parameterValues = GetCurrentValues( aCommand ); 00162 } 00163 for(G4int i=0;i<savedCommand->GetParameterEntries();i++) 00164 { 00165 if( aParameterName == 00166 savedCommand->GetParameter(i)->GetParameterName() ) 00167 return GetCurrentStringValue(aCommand,i+1,false); 00168 } 00169 return G4String(); 00170 }
G4String G4UImanager::GetCurrentStringValue | ( | const char * | aCommand, | |
G4int | parameterNumber = 1 , |
|||
G4bool | reGet = true | |||
) |
Definition at line 134 of file G4UImanager.cc.
References G4String::append(), GetCurrentValues(), and G4String::isNull().
Referenced by GetCurrentDoubleValue(), GetCurrentIntValue(), and GetCurrentStringValue().
00136 { 00137 if(reGet || savedCommand == NULL) 00138 { 00139 savedParameters = GetCurrentValues( aCommand ); 00140 } 00141 G4Tokenizer savedToken( savedParameters ); 00142 G4String token; 00143 for(G4int i_thParameter=0;i_thParameter<parameterNumber;i_thParameter++) 00144 { 00145 token = savedToken(); 00146 if( token.isNull() ) return G4String(); 00147 if( token[(size_t)0] == '"' ) 00148 { 00149 token.append(" "); 00150 token.append(savedToken("\"")); 00151 } 00152 } 00153 return token; 00154 }
G4String G4UImanager::GetCurrentValues | ( | const char * | aCommand | ) |
Definition at line 122 of file G4UImanager.cc.
References G4UIcommandTree::FindPath(), G4cerr, G4endl, and G4UIcommand::GetCurrentValue().
Referenced by GetCurrentStringValue(), and G4VBasicShell::ShowCurrent().
00123 { 00124 G4String theCommand = aCommand; 00125 savedCommand = treeTop->FindPath( theCommand ); 00126 if( savedCommand == NULL ) 00127 { 00128 G4cerr << "command not found" << G4endl; 00129 return G4String(); 00130 } 00131 return savedCommand->GetCurrentValue(); 00132 }
G4UIsession* G4UImanager::GetG4UIWindow | ( | ) | const [inline] |
const G4String& G4UImanager::GetMacroSearchPath | ( | ) | const [inline] |
G4int G4UImanager::GetMaxHistSize | ( | ) | const [inline] |
Definition at line 231 of file G4UImanager.hh.
Referenced by G4UIcontrolMessenger::GetCurrentValue().
G4int G4UImanager::GetNumberOfHistory | ( | ) | const [inline] |
Definition at line 220 of file G4UImanager.hh.
Referenced by G4VBasicShell::ApplyShellCommand(), G4UIGainServer::GetCommand(), and G4UIGAG::GetCommand().
G4bool G4UImanager::GetPauseAtBeginOfEvent | ( | ) | const [inline] |
G4bool G4UImanager::GetPauseAtEndOfEvent | ( | ) | const [inline] |
Definition at line 222 of file G4UImanager.hh.
Referenced by G4VBasicShell::ApplyShellCommand(), G4UIGainServer::GetCommand(), and G4UIGAG::GetCommand().
00223 { 00224 G4String st; 00225 if(i>=0 && i<G4int(histVec.size())) 00226 { st = histVec[i]; } 00227 return st; 00228 }
G4UIsession* G4UImanager::GetSession | ( | ) | const [inline] |
Definition at line 199 of file G4UImanager.hh.
Referenced by G4VisCommandReviewKeptEvents::SetNewValue().
G4UIcommandTree* G4UImanager::GetTree | ( | ) | const [inline] |
Definition at line 197 of file G4UImanager.hh.
Referenced by G4VBasicShell::Complete(), G4CascadeParamMessenger::CreateDirectory(), G4VBasicShell::FindCommand(), G4VBasicShell::FindDirectory(), G4UIGAG::G4UIGAG(), G4UIGainServer::G4UIGainServer(), G4UIGainServer::GetCommand(), G4UIGAG::GetCommand(), and G4VBasicShell::TerminalHelp().
G4UImanager * G4UImanager::GetUIpointer | ( | ) | [static] |
Definition at line 51 of file G4UImanager.cc.
References CreateMessenger().
Referenced by G4IonTable::AddProcessManager(), G4VBasicShell::ApplyShellCommand(), G4VBasicShell::Complete(), G4UImessenger::CreateDirectory(), G4CascadeParamMessenger::CreateDirectory(), G4VBasicShell::ExecuteCommand(), G4VBasicShell::FindCommand(), G4VBasicShell::FindDirectory(), G4UIbatch::G4UIbatch(), G4UIGAG::G4UIGAG(), G4UIGainServer::G4UIGainServer(), G4UIterminal::G4UIterminal(), G4VisManager::GeometryHasChanged(), G4VUIshell::GetCommandTree(), G4UIcontrolMessenger::GetCurrentValue(), G4VisManager::NotifyHandlers(), G4RunManager::ProcessOneEvent(), G4VVisCommandViewer::RefreshIfRequired(), G4RunManager::rndmSaveThisEvent(), G4RunManager::rndmSaveThisRun(), G4UIbatch::SessionStart(), G4VVisCommandGeometrySet::Set(), G4VisCommandViewerFlush::SetNewValue(), G4VisCommandViewerCreate::SetNewValue(), G4VisCommandViewerClone::SetNewValue(), G4VisCommandSceneHandlerCreate::SetNewValue(), G4VisCommandSceneAddTrajectories::SetNewValue(), G4VisCommandGeometryRestore::SetNewValue(), G4VisCommandSpecify::SetNewValue(), G4VisCommandOpen::SetNewValue(), G4VisCommandDrawVolume::SetNewValue(), G4VisCommandDrawView::SetNewValue(), G4VisCommandDrawTree::SetNewValue(), G4VisCommandReviewKeptEvents::SetNewValue(), G4VisCommandList::SetNewValue(), G4UIcontrolMessenger::SetNewValue(), G4TrackingMessenger::SetNewValue(), G4RunMessenger::SetNewValue(), G4ProcessTableMessenger::SetNewValue(), G4ProcessManagerMessenger::SetNewValue(), G4EnergyLossMessenger::SetNewValue(), G4VisCommandGeometrySetVisibility::SetNewValueOnLV(), G4VBasicShell::ShowCurrent(), G4VBasicShell::TerminalHelp(), G4TheRayTracer::Trace(), G4VVisCommand::UpdateVisManagerScene(), G4RunManagerKernel::~G4RunManagerKernel(), G4UIcommand::~G4UIcommand(), G4UIGAG::~G4UIGAG(), G4UIGainServer::~G4UIGainServer(), and G4UIterminal::~G4UIterminal().
00052 { 00053 if(!fUImanager) 00054 { 00055 if(!fUImanagerHasBeenKilled) 00056 { 00057 fUImanager = new G4UImanager; 00058 fUImanager->CreateMessenger(); 00059 } 00060 } 00061 return fUImanager; 00062 }
G4int G4UImanager::GetVerboseLevel | ( | ) | const [inline] |
Definition at line 218 of file G4UImanager.hh.
Referenced by G4IonTable::AddProcessManager(), G4UIcontrolMessenger::GetCurrentValue(), G4VisCommandViewerFlush::SetNewValue(), G4VisCommandViewerClone::SetNewValue(), G4VisCommandSceneAddTrajectories::SetNewValue(), G4VisCommandSpecify::SetNewValue(), G4VisCommandOpen::SetNewValue(), G4VisCommandDrawVolume::SetNewValue(), G4VisCommandDrawView::SetNewValue(), G4VisCommandDrawTree::SetNewValue(), and G4VisCommandReviewKeptEvents::SetNewValue().
void G4UImanager::ListAlias | ( | ) |
Definition at line 549 of file G4UImanager.cc.
References G4UIaliasList::List().
Referenced by G4UIcontrolMessenger::SetNewValue().
00550 { 00551 aliasList->List(); 00552 }
void G4UImanager::ListCommands | ( | const char * | direc | ) |
Definition at line 450 of file G4UImanager.cc.
References G4cout, G4endl, and G4UIcommandTree::List().
Referenced by G4UIcontrolMessenger::SetNewValue().
00451 { 00452 G4UIcommandTree* comTree = FindDirectory(direct); 00453 if(comTree) 00454 { comTree->List(); } 00455 else 00456 { G4cout << direct << " is not found." << G4endl; } 00457 }
void G4UImanager::Loop | ( | const char * | macroFile, | |
const char * | variableName, | |||
G4double | initialValue, | |||
G4double | finalValue, | |||
G4double | stepSize = 1.0 | |||
) |
Definition at line 259 of file G4UImanager.cc.
References Foreach().
Referenced by LoopS().
00261 { 00262 G4String cd; 00263 if (stepSize > 0) { 00264 for(G4double d=initialValue;d<=finalValue;d+=stepSize) 00265 { 00266 std::ostringstream os; 00267 os << d; 00268 cd += os.str(); 00269 cd += " "; 00270 } 00271 } else { 00272 for(G4double d=initialValue;d>=finalValue;d+=stepSize) 00273 { 00274 std::ostringstream os; 00275 os << d; 00276 cd += os.str(); 00277 cd += " "; 00278 } 00279 } 00280 Foreach(macroFile,variableName,cd); 00281 }
void G4UImanager::LoopS | ( | const char * | valueList | ) |
Definition at line 239 of file G4UImanager.cc.
References Loop().
Referenced by G4UIcontrolMessenger::SetNewValue().
00240 { 00241 G4String vl = valueList; 00242 G4Tokenizer parameterToken(vl); 00243 G4String mf = parameterToken(); 00244 G4String vn = parameterToken(); 00245 G4String c1 = parameterToken(); 00246 c1 += " "; 00247 c1 += parameterToken(); 00248 c1 += " "; 00249 c1 += parameterToken(); 00250 const char* t1 = c1; 00251 std::istringstream is(t1); 00252 G4double d1; 00253 G4double d2; 00254 G4double d3; 00255 is >> d1 >> d2 >> d3; 00256 Loop(mf,vn,d1,d2,d3); 00257 }
G4bool G4UImanager::Notify | ( | G4ApplicationState | requestedState | ) | [virtual] |
Implements G4VStateDependent.
Definition at line 481 of file G4UImanager.cc.
References G4State_EventProc, G4State_GeomClosed, and G4StateManager::GetStateManager().
00482 { 00483 //G4cout << G4StateManager::GetStateManager()->GetStateString(requestedState) << " <--- " << G4StateManager::GetStateManager()->GetStateString(G4StateManager::GetStateManager()->GetPreviousState()) << G4endl; 00484 if(pauseAtBeginOfEvent) 00485 { 00486 if(requestedState==G4State_EventProc && 00487 G4StateManager::GetStateManager()->GetPreviousState()==G4State_GeomClosed) 00488 { PauseSession("BeginOfEvent"); } 00489 } 00490 if(pauseAtEndOfEvent) 00491 { 00492 if(requestedState==G4State_GeomClosed && 00493 G4StateManager::GetStateManager()->GetPreviousState()==G4State_EventProc) 00494 { PauseSession("EndOfEvent"); } 00495 } 00496 return true; 00497 }
void G4UImanager::ParseMacroSearchPath | ( | ) |
Definition at line 563 of file G4UImanager.cc.
References G4String::index().
00564 { 00565 searchDirs.clear(); 00566 00567 size_t idxfirst = 0; 00568 size_t idxend = 0; 00569 G4String pathstring = ""; 00570 while( (idxend = searchPath.index(':', idxfirst)) != G4String::npos) { 00571 pathstring = searchPath.substr(idxfirst, idxend-idxfirst); 00572 if(pathstring.size() != 0) searchDirs.push_back(pathstring); 00573 idxfirst = idxend + 1; 00574 } 00575 00576 pathstring = searchPath.substr(idxfirst, searchPath.size()-idxfirst); 00577 if(pathstring.size() != 0) searchDirs.push_back(pathstring); 00578 }
void G4UImanager::RemoveAlias | ( | const char * | aliasName | ) |
Definition at line 542 of file G4UImanager.cc.
References G4String::both, G4UIaliasList::RemoveAlias(), and G4String::strip().
Referenced by G4UIcontrolMessenger::SetNewValue().
00543 { 00544 G4String aL = aliasName; 00545 G4String targetAlias = aL.strip(G4String::both); 00546 aliasList->RemoveAlias(targetAlias); 00547 }
void G4UImanager::RemoveCommand | ( | G4UIcommand * | aCommand | ) |
Definition at line 225 of file G4UImanager.cc.
References G4UIcommandTree::RemoveCommand().
Referenced by G4UIcommand::~G4UIcommand().
00226 { 00227 treeTop->RemoveCommand( aCommand ); 00228 }
void G4UImanager::SetAlias | ( | const char * | aliasLine | ) |
Definition at line 523 of file G4UImanager.cc.
References G4UIaliasList::ChangeAlias(), and G4String::index().
Referenced by Foreach(), and G4UIcontrolMessenger::SetNewValue().
00524 { 00525 G4String aLine = aliasLine; 00526 G4int i = aLine.index(" "); 00527 G4String aliasName = aLine(0,i); 00528 G4String aliasValue = aLine(i+1,aLine.length()-(i+1)); 00529 if(aliasValue(0)=='"') 00530 { 00531 G4String strippedValue; 00532 if(aliasValue(aliasValue.length()-1)=='"') 00533 { strippedValue = aliasValue(1,aliasValue.length()-2); } 00534 else 00535 { strippedValue = aliasValue(1,aliasValue.length()-1); } 00536 aliasValue = strippedValue; 00537 } 00538 00539 aliasList->ChangeAlias(aliasName,aliasValue); 00540 }
void G4UImanager::SetCoutDestination | ( | G4UIsession *const | value | ) |
Definition at line 517 of file G4UImanager.cc.
References G4cerrbuf, G4coutbuf, and G4strstreambuf::SetDestination().
Referenced by G4UIGAG::G4UIGAG(), G4UImanager(), G4UIGAG::~G4UIGAG(), G4UIGainServer::~G4UIGainServer(), and ~G4UImanager().
00518 { 00519 G4coutbuf.SetDestination(value); 00520 G4cerrbuf.SetDestination(value); 00521 }
void G4UImanager::SetG4UIWindow | ( | G4UIsession *const | value | ) | [inline] |
void G4UImanager::SetMacroSearchPath | ( | const G4String & | path | ) | [inline] |
void G4UImanager::SetMaxHistSize | ( | G4int | mx | ) | [inline] |
void G4UImanager::SetPauseAtBeginOfEvent | ( | G4bool | vl | ) | [inline] |
void G4UImanager::SetPauseAtEndOfEvent | ( | G4bool | vl | ) | [inline] |
void G4UImanager::SetSession | ( | G4UIsession *const | value | ) | [inline] |
Definition at line 204 of file G4UImanager.hh.
Referenced by G4UIGAG::G4UIGAG(), G4UIGAG::~G4UIGAG(), and G4UIGainServer::~G4UIGainServer().
void G4UImanager::SetVerboseLevel | ( | G4int | val | ) | [inline] |
Definition at line 216 of file G4UImanager.hh.
Referenced by G4IonTable::AddProcessManager(), G4VisCommandViewerFlush::SetNewValue(), G4VisCommandViewerClone::SetNewValue(), G4VisCommandSceneAddTrajectories::SetNewValue(), G4VisCommandSpecify::SetNewValue(), G4VisCommandOpen::SetNewValue(), G4VisCommandDrawVolume::SetNewValue(), G4VisCommandDrawView::SetNewValue(), G4VisCommandDrawTree::SetNewValue(), G4VisCommandReviewKeptEvents::SetNewValue(), and G4UIcontrolMessenger::SetNewValue().
G4String G4UImanager::SolveAlias | ( | const char * | aCmd | ) |
Definition at line 316 of file G4UImanager.cc.
References G4UIaliasList::FindAlias(), G4cerr, G4endl, and G4String::index().
Referenced by ApplyCommand(), and G4UIcontrolMessenger::SetNewValue().
00317 { 00318 G4String aCommand = aCmd; 00319 G4int ia = aCommand.index("{"); 00320 G4int iz = aCommand.index("#"); 00321 while((ia != G4int(std::string::npos))&&((iz==G4int(std::string::npos))||(ia<iz))) 00322 { 00323 G4int ibx = -1; 00324 while(ibx<0) 00325 { 00326 G4int ib = aCommand.index("}"); 00327 if( ib == G4int(std::string::npos) ) 00328 { 00329 G4cerr << aCommand << G4endl; 00330 for(G4int i=0;i<ia;i++) G4cerr << " "; 00331 G4cerr << "^" << G4endl; 00332 G4cerr << "Unmatched alias parenthis -- command ignored" << G4endl; 00333 G4String nullStr; 00334 return nullStr; 00335 } 00336 G4String ps = aCommand(ia+1,aCommand.length()-(ia+1)); 00337 G4int ic = ps.index("{"); 00338 G4int id = ps.index("}"); 00339 if(ic!=G4int(std::string::npos) && ic < id) 00340 { ia+=ic+1; } 00341 else 00342 { ibx = ib; } 00343 } 00344 //--- Here ia represents the position of innermost "{" 00345 //--- and ibx represents corresponding "}" 00346 G4String subs; 00347 if(ia>0) subs = aCommand(0,ia); 00348 G4String alis = aCommand(ia+1,ibx-ia-1); 00349 G4String rems = aCommand(ibx+1,aCommand.length()-ibx); 00350 // G4cout << "<" << subs << "> <" << alis << "> <" << rems << ">" << G4endl; 00351 G4String* alVal = aliasList->FindAlias(alis); 00352 if(!alVal) 00353 { 00354 G4cerr << "Alias <" << alis << "> not found -- command ignored" << G4endl; 00355 G4String nullStr; 00356 return nullStr; 00357 } 00358 aCommand = subs+(*alVal)+rems; 00359 ia = aCommand.index("{"); 00360 } 00361 return aCommand; 00362 }
void G4UImanager::StoreHistory | ( | G4bool | historySwitch, | |
const char * | fileName = "G4history.macro" | |||
) |
Definition at line 428 of file G4UImanager.cc.
00429 { 00430 if(historySwitch) 00431 { 00432 if(saveHistory) 00433 { historyFile.close(); } 00434 historyFile.open((char*)fileName); 00435 saveHistory = true; 00436 } 00437 else 00438 { 00439 historyFile.close(); 00440 saveHistory = false; 00441 } 00442 saveHistory = historySwitch; 00443 }
void G4UImanager::StoreHistory | ( | const char * | fileName = "G4history.macro" |
) |
Definition at line 425 of file G4UImanager.cc.
Referenced by G4UIcontrolMessenger::SetNewValue().
00426 { StoreHistory(true,fileName); }