Geant4 11.2.2
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4UImanager Class Reference

#include <G4UImanager.hh>

+ Inheritance diagram for G4UImanager:

Public Member Functions

 ~G4UImanager () override
 
 G4UImanager (const G4UImanager &)=delete
 
const G4UImanageroperator= (const G4UImanager &)=delete
 
G4bool operator== (const G4UImanager &) const =delete
 
G4bool operator!= (const G4UImanager &) const =delete
 
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)
 
G4UIcommandFindCommand (const char *aCommand)
 
G4UIcommandFindCommand (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)
 
G4bool Notify (G4ApplicationState requestedState) override
 
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
 
G4UIsessionGetBaseSession () 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 (const 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 &prefix="W")
 
void SetThreadUseBuffer (G4bool flg=true)
 
void SetThreadIgnore (G4int tid=0)
 
void SetThreadIgnoreInit (G4bool flg=true)
 
G4MTcoutDestinationGetThreadCout ()
 
G4int GetLastReturnCode () const
 
bool IsLastCommandOutputTreated ()
 
void SetLastCommandOutputTreated ()
 
- Public Member Functions inherited from G4VStateDependent
 G4VStateDependent (G4bool bottom=false)
 
virtual ~G4VStateDependent ()
 
G4bool operator== (const G4VStateDependent &right) const
 
G4bool operator!= (const G4VStateDependent &right) const
 

Static Public Member Functions

static G4UImanagerGetUIpointer ()
 
static G4UImanagerGetMasterUIpointer ()
 
static void UseDoublePrecisionStr (G4bool val)
 
static G4bool DoublePrecisionStr ()
 

Protected Member Functions

 G4UImanager ()
 

Detailed Description

Definition at line 58 of file G4UImanager.hh.

Constructor & Destructor Documentation

◆ ~G4UImanager()

G4UImanager::~G4UImanager ( )
override

Definition at line 113 of file G4UImanager.cc.

114{
115 if (bridges != nullptr) {
116 for (auto bridge : *bridges) {
117 delete bridge;
118 }
119 delete bridges;
120 }
121 SetCoutDestination(nullptr);
122 histVec.clear();
123 if (saveHistory) {
124 historyFile.close();
125 }
126 delete CoutMessenger;
127 delete ProfileMessenger;
128 delete UnitsMessenger;
129 delete UImessenger;
130 delete treeTop;
131 delete aliasList;
132 fUImanagerHasBeenKilled() = true;
133 fUImanager() = nullptr;
134 if (commandStack != nullptr) {
135 commandStack->clear();
136 delete commandStack;
137 }
138 if (threadID >= 0) {
139 delete threadCout;
141 threadID = -1;
142 }
143}
void G4iosFinalization()
Definition G4ios.cc:266
void SetCoutDestination(G4UIsession *const value)

◆ G4UImanager() [1/2]

G4UImanager::G4UImanager ( const G4UImanager & )
delete

◆ G4UImanager() [2/2]

G4UImanager::G4UImanager ( )
protected

Definition at line 95 of file G4UImanager.cc.

95 : G4VStateDependent(true)
96{
97 treeTop = new G4UIcommandTree("/");
98 aliasList = new G4UIaliasList;
100 commandStack = new std::vector<G4String>;
101}
G4VStateDependent(G4bool bottom=false)

Referenced by GetUIpointer().

Member Function Documentation

◆ AddNewCommand()

void G4UImanager::AddNewCommand ( G4UIcommand * newCommand)

Definition at line 254 of file G4UImanager.cc.

255{
256 treeTop->AddNewCommand(newCommand);
257 if (fMasterUImanager() != nullptr && G4Threading::G4GetThreadId() == 0) {
258 fMasterUImanager()->AddWorkerCommand(newCommand);
259 }
260}
void AddNewCommand(G4UIcommand *newCommand, G4bool workerThreadOnly=false)
G4int G4GetThreadId()

◆ ApplyCommand() [1/2]

G4int G4UImanager::ApplyCommand ( const char * aCommand)

Definition at line 449 of file G4UImanager.cc.

450{
451 G4String aCommand = SolveAlias(aCmd);
452 if (aCommand.empty()) {
453 return fAliasNotFound;
454 }
455 if (verboseLevel != 0) {
456 if (isMaster) {
457 fLastCommandOutputTreated = false;
458 }
459 G4cout << aCommand << G4endl;
460 }
461 G4String commandString;
462 G4String commandParameter;
463
464 std::size_t i = aCommand.find(' ');
465 if (i != std::string::npos) {
466 commandString = aCommand.substr(0, i);
467 commandParameter = aCommand.substr(i + 1, aCommand.length() - (i + 1));
468 }
469 else {
470 commandString = aCommand;
471 }
472
473 // remove doubled slash
474 std::size_t len = commandString.length();
475 std::size_t ll = 0;
476 G4String a1;
477 G4String a2;
478 while (ll < len - 1) {
479 if (commandString.substr(ll, 2) == "//") {
480 if (ll == 0) {
481 // Safe because index argument always 0
482 commandString.erase(ll, 1);
483 }
484 else {
485 a1 = commandString.substr(0, ll);
486 a2 = commandString.substr(ll + 1, len - ll - 1);
487 commandString = a1 + a2;
488 }
489 --len;
490 }
491 else {
492 ++ll;
493 }
494 }
495
496 if (isMaster && bridges != nullptr) {
497 for (auto bridge : *bridges) {
498 G4int leng = bridge->DirLength();
499 if (commandString.substr(0, leng) == bridge->DirName()) {
500 return bridge->LocalUI()->ApplyCommand(commandString + " " + commandParameter);
501 }
502 }
503 }
504
505 G4UIcommand* targetCommand = treeTop->FindPath(commandString);
506 if (targetCommand == nullptr) {
507 if (ignoreCmdNotFound) {
508 if (stackCommandsForBroadcast) {
509 commandStack->push_back(commandString + " " + commandParameter);
510 }
511 return fCommandSucceeded;
512 }
513
514 return fCommandNotFound;
515 }
516
517 if (stackCommandsForBroadcast && targetCommand->ToBeBroadcasted()) {
518 commandStack->push_back(commandString + " " + commandParameter);
519 }
520
521 if (!(targetCommand->IsAvailable())) {
523 }
524
525 if (saveHistory) {
526 historyFile << aCommand << G4endl;
527 }
528 if (G4int(histVec.size()) >= maxHistSize) {
529 histVec.erase(histVec.begin());
530 }
531 histVec.push_back(aCommand);
532
533 targetCommand->ResetFailure();
534 G4int commandFailureCode = targetCommand->DoIt(commandParameter);
535 if (commandFailureCode == 0) {
536 G4int additionalFailureCode = targetCommand->IfCommandFailed();
537 if (additionalFailureCode > 0) {
539 msg << targetCommand->GetFailureDescription() << "\n"
540 << "Error code : " << additionalFailureCode;
541 G4Exception("G4UImanager::ApplyCommand", "UIMAN0123", JustWarning, msg);
542 commandFailureCode += additionalFailureCode;
543 }
544 }
545 return commandFailureCode;
546}
@ JustWarning
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
std::ostringstream G4ExceptionDescription
int G4int
Definition G4Types.hh:85
@ fCommandNotFound
@ fAliasNotFound
@ fIllegalApplicationState
@ fCommandSucceeded
#define G4endl
Definition G4ios.hh:67
G4GLOB_DLL std::ostream G4cout
G4UIcommand * FindPath(const char *commandPath) const
G4bool ToBeBroadcasted() const
G4int IfCommandFailed()
virtual G4int DoIt(G4String parameterList)
void ResetFailure()
G4bool IsAvailable()
const G4String & GetFailureDescription()
G4String SolveAlias(const char *aCmd)

Referenced by G4UIbridge::ApplyCommand(), ApplyCommand(), G4RunManagerKernel::BuildPhysicsTables(), G4TaskRunManager::CreateAndStartWorkers(), G4TheMTRayTracer::CreateBitMap(), G4WorkerRunManager::DoWork(), G4VBasicShell::ExecuteCommand(), G4RunManager::GeometryHasBeenModified(), G4TaskRunManagerKernel::InitializeWorker(), G4VVisCommand::InterpolateViews(), G4QTabWidget::paintEvent(), G4RunManager::ProcessOneEvent(), G4WorkerRunManager::ProcessOneEvent(), G4WorkerTaskRunManager::ProcessOneEvent(), G4WorkerTaskRunManager::ProcessUI(), G4VVisCommand::RefreshIfRequired(), G4RunManager::ReinitializeGeometry(), G4TaskRunManager::RequestWorkersProcessCommandsStack(), G4VVisCommandGeometrySet::Set(), G4EmExtraParametersMessenger::SetNewValue(), G4EmLowEParametersMessenger::SetNewValue(), G4EmParametersMessenger::SetNewValue(), G4OpenGLViewerMessenger::SetNewValue(), G4OpenGLXmViewerMessenger::SetNewValue(), G4OpticalParametersMessenger::SetNewValue(), G4ProcessManagerMessenger::SetNewValue(), G4ProcessTableMessenger::SetNewValue(), G4TrackingMessenger::SetNewValue(), G4UIcontrolMessenger::SetNewValue(), G4VisCommandDrawLogicalVolume::SetNewValue(), G4VisCommandDrawTree::SetNewValue(), G4VisCommandDrawView::SetNewValue(), G4VisCommandDrawVolume::SetNewValue(), G4VisCommandGeometryRestore::SetNewValue(), G4VisCommandList::SetNewValue(), G4VisCommandOpen::SetNewValue(), G4VisCommandReviewKeptEvents::SetNewValue(), G4VisCommandSceneAddTrajectories::SetNewValue(), G4VisCommandSpecify::SetNewValue(), G4VisCommandsTouchable::SetNewValue(), G4VisCommandsTouchableSet::SetNewValue(), G4VisCommandViewerClone::SetNewValue(), G4VisCommandViewerCreate::SetNewValue(), G4VisCommandViewerFlush::SetNewValue(), G4VisCommandViewerInterpolate::SetNewValue(), G4VisCommandGeometrySetVisibility::SetNewValueOnLV(), G4ToolsSGSceneHandler::SetPlotterHistograms(), G4VViewer::SetTouchable(), G4TheMTRayTracer::Trace(), and G4TheRayTracer::Trace().

◆ ApplyCommand() [2/2]

G4int G4UImanager::ApplyCommand ( const G4String & aCommand)

Definition at line 443 of file G4UImanager.cc.

444{
445 return ApplyCommand(aCmd.data());
446}
G4int ApplyCommand(const char *aCommand)

◆ CreateHTML()

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

Definition at line 705 of file G4UImanager.cc.

706{
707 G4UIcommandTree* tr = FindDirectory(dir);
708 if (tr != nullptr) {
709 tr->CreateHTML();
710 }
711 else {
712 G4cerr << "Directory <" << dir << "> is not found." << G4endl;
713 }
714}
G4GLOB_DLL std::ostream G4cerr
void CreateHTML(const G4String &="")

Referenced by G4UIcontrolMessenger::SetNewValue().

◆ DoublePrecisionStr()

G4bool G4UImanager::DoublePrecisionStr ( )
static

◆ ExecuteMacroFile()

void G4UImanager::ExecuteMacroFile ( const char * fileName)

Definition at line 284 of file G4UImanager.cc.

285{
286 G4UIsession* batchSession = new G4UIbatch(fileName, session);
287 session = batchSession;
288 lastRC = 0;
289 G4UIsession* previousSession = session->SessionStart();
290 lastRC = session->GetLastReturnCode();
291 delete session;
292 session = previousSession;
293}

Referenced by Foreach(), and G4UIcontrolMessenger::SetNewValue().

◆ FindCommand() [1/2]

G4UIcommand * G4UImanager::FindCommand ( const char * aCommand)

Definition at line 555 of file G4UImanager.cc.

556{
557 G4String aCommand = SolveAlias(aCmd);
558 if (aCommand.empty()) {
559 return nullptr;
560 }
561
562 G4String commandString;
563
564 std::size_t i = aCommand.find(' ');
565 if (i != std::string::npos) {
566 commandString = aCommand.substr(0, i);
567 }
568 else {
569 commandString = aCommand;
570 }
571
572 return treeTop->FindPath(commandString);
573}

Referenced by FindCommand().

◆ FindCommand() [2/2]

G4UIcommand * G4UImanager::FindCommand ( const G4String & aCommand)

Definition at line 549 of file G4UImanager.cc.

550{
551 return FindCommand(aCmd.data());
552}
G4UIcommand * FindCommand(const char *aCommand)

◆ FindMacroPath()

G4String G4UImanager::FindMacroPath ( const G4String & fname) const

Definition at line 752 of file G4UImanager.cc.

753{
754 G4String macrofile = fname;
755
756 for (const auto& searchDir : searchDirs) {
757 G4String fullpath = searchDir + "/" + fname;
758 if (FileFound(fullpath)) {
759 macrofile = fullpath;
760 break;
761 }
762 }
763 return macrofile;
764}

Referenced by G4UIQt::AddIcon(), G4UIQt::AddViewerTabFromFile(), Foreach(), and G4UIcontrolMessenger::SetNewValue().

◆ Foreach()

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

Definition at line 371 of file G4UImanager.cc.

372{
373 G4String candidatesString = candidates;
374 G4Tokenizer parameterToken(candidatesString);
375 G4String cd;
376 while (!((cd = parameterToken()).empty())) {
377 G4String vl = variableName;
378 vl += " ";
379 vl += cd;
380 SetAlias(vl);
382 if (lastRC != 0) {
384 ed << "Loop aborted due to a command execution error - "
385 << "error code " << lastRC;
386 G4Exception("G4UImanager::Foreach", "UIMAN0201", JustWarning, ed);
387 break;
388 }
389 }
390}
void ExecuteMacroFile(const char *fileName)
void SetAlias(const char *aliasLine)
G4String FindMacroPath(const G4String &fname) const

Referenced by ForeachS(), and Loop().

◆ ForeachS()

void G4UImanager::ForeachS ( const char * valueList)

Definition at line 341 of file G4UImanager.cc.

342{
343 G4String vl = valueList;
344 G4Tokenizer parameterToken(vl);
345 G4String mf = parameterToken();
346 G4String vn = parameterToken();
347 G4String c1 = parameterToken();
348 G4String ca;
349 while (!((ca = parameterToken()).empty())) {
350 c1 += " ";
351 c1 += ca;
352 }
353
354 G4String aliasValue = c1;
355 if (aliasValue[0] == '"') {
356 G4String strippedValue;
357 if (aliasValue.back() == '"') {
358 strippedValue = aliasValue.substr(1, aliasValue.length() - 2);
359 }
360 else {
361 strippedValue = aliasValue.substr(1, aliasValue.length() - 1);
362 }
363 aliasValue = strippedValue;
364 }
365
366 // Foreach(mf,vn,c1);
367 Foreach(mf, vn, aliasValue);
368}
void Foreach(const char *macroFile, const char *variableName, const char *candidates)

Referenced by G4UIcontrolMessenger::SetNewValue().

◆ GetBaseSession()

G4UIsession * G4UImanager::GetBaseSession ( ) const

Definition at line 883 of file G4UImanager.cc.

884{
885 // There may be no session - pure batch mode (session == nullptr)
886 // If there is a session, it may be a batch session used for processing macros.
887 // Find base session of this hierarchy of batch sessions.
888 G4UIsession* baseSession = session;
889 while (auto aBatchSession = dynamic_cast<G4UIbatch*>(baseSession)) {
890 auto previousSession = aBatchSession->GetPreviousSession();
891 if (previousSession == nullptr) {
892 // No previouse session - aBatchSession is the desired base session
893 baseSession = aBatchSession;
894 break;
895 }
896 // There is a previous session, which may or may not be a batch.
897 // If not, it will be our desired base - so record and test again.
898 baseSession = previousSession;
899 }
900 return baseSession;
901}

Referenced by G4OpenGLQt::IsUISessionCompatible(), G4OpenGLXm::IsUISessionCompatible(), G4OpenInventor::IsUISessionCompatible(), G4Qt3D::IsUISessionCompatible(), G4ToolsSGQtGLES::IsUISessionCompatible(), G4ToolsSGQtZB::IsUISessionCompatible(), and G4VtkQt::IsUISessionCompatible().

◆ GetCommandStack()

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

Definition at line 767 of file G4UImanager.cc.

768{
769 std::vector<G4String>* returnValue = commandStack;
770 commandStack = new std::vector<G4String>;
771 return returnValue;
772}

Referenced by G4MTRunManager::PrepareCommandsStack().

◆ GetCurrentDoubleValue() [1/2]

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

Definition at line 230 of file G4UImanager.cc.

232{
233 G4String targetParameter = GetCurrentStringValue(aCommand, aParameterName, reGet);
234 G4double value;
235 const char* t = targetParameter;
236 std::istringstream is(t);
237 is >> value;
238 return value;
239}
double G4double
Definition G4Types.hh:83
G4String GetCurrentStringValue(const char *aCommand, G4int parameterNumber=1, G4bool reGet=true)

◆ GetCurrentDoubleValue() [2/2]

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

Definition at line 242 of file G4UImanager.cc.

244{
245 G4String targetParameter = GetCurrentStringValue(aCommand, parameterNumber, reGet);
246 G4double value;
247 const char* t = targetParameter;
248 std::istringstream is(t);
249 is >> value;
250 return value;
251}

◆ GetCurrentIntValue() [1/2]

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

Definition at line 207 of file G4UImanager.cc.

209{
210 G4String targetParameter = GetCurrentStringValue(aCommand, aParameterName, reGet);
211 G4int value;
212 const char* t = targetParameter;
213 std::istringstream is(t);
214 is >> value;
215 return value;
216}

◆ GetCurrentIntValue() [2/2]

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

Definition at line 219 of file G4UImanager.cc.

220{
221 G4String targetParameter = GetCurrentStringValue(aCommand, parameterNumber, reGet);
222 G4int value;
223 const char* t = targetParameter;
224 std::istringstream is(t);
225 is >> value;
226 return value;
227}

Referenced by G4TheMTRayTracer::Trace(), and G4TheRayTracer::Trace().

◆ GetCurrentStringValue() [1/2]

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

Definition at line 192 of file G4UImanager.cc.

194{
195 if (reGet || savedCommand == nullptr) {
196 G4String parameterValues = GetCurrentValues(aCommand);
197 }
198 for (G4int i = 0; i < (G4int)savedCommand->GetParameterEntries(); ++i) {
199 if (aParameterName == savedCommand->GetParameter(i)->GetParameterName()) {
200 return GetCurrentStringValue(aCommand, i + 1, false);
201 }
202 }
203 return G4String();
204}
std::size_t GetParameterEntries() const
G4UIparameter * GetParameter(G4int i) const
G4String GetCurrentValues(const char *aCommand)
const G4String & GetParameterName() const

◆ GetCurrentStringValue() [2/2]

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

Definition at line 170 of file G4UImanager.cc.

172{
173 if (reGet || savedCommand == nullptr) {
174 savedParameters = GetCurrentValues(aCommand);
175 }
176 G4Tokenizer savedToken(savedParameters);
177 G4String token;
178 for (G4int i_thParameter = 0; i_thParameter < parameterNumber; ++i_thParameter) {
179 token = savedToken();
180 if (token.empty()) {
181 return G4String();
182 }
183 if (token[(size_t)0] == '"') {
184 token.append(" ");
185 token.append(savedToken("\""));
186 }
187 }
188 return token;
189}

Referenced by GetCurrentDoubleValue(), GetCurrentDoubleValue(), GetCurrentIntValue(), GetCurrentIntValue(), and GetCurrentStringValue().

◆ GetCurrentValues()

G4String G4UImanager::GetCurrentValues ( const char * aCommand)

Definition at line 158 of file G4UImanager.cc.

159{
160 G4String theCommand = aCommand;
161 savedCommand = treeTop->FindPath(theCommand);
162 if (savedCommand == nullptr) {
163 G4cerr << "command not found" << G4endl;
164 return G4String();
165 }
166 return savedCommand->GetCurrentValue();
167}
G4String GetCurrentValue()

Referenced by GetCurrentStringValue(), GetCurrentStringValue(), G4UIcontrolMessenger::SetNewValue(), G4ToolsSGSceneHandler::SetPlotterHistograms(), and G4VBasicShell::ShowCurrent().

◆ GetG4UIWindow()

G4UIsession * G4UImanager::GetG4UIWindow ( ) const
inline

◆ GetLastReturnCode()

G4int G4UImanager::GetLastReturnCode ( ) const
inline

Definition at line 243 of file G4UImanager.hh.

243{ return lastRC; }

Referenced by G4UIcontrolMessenger::SetNewValue().

◆ GetMacroSearchPath()

const G4String & G4UImanager::GetMacroSearchPath ( ) const
inline

Definition at line 207 of file G4UImanager.hh.

207{ return searchPath; }

Referenced by G4UIcontrolMessenger::GetCurrentValue().

◆ GetMasterUIpointer()

G4UImanager * G4UImanager::GetMasterUIpointer ( )
static

Definition at line 89 of file G4UImanager.cc.

90{
91 return fMasterUImanager();
92}

Referenced by G4UIbridge::G4UIbridge().

◆ GetMaxHistSize()

G4int G4UImanager::GetMaxHistSize ( ) const
inline

Definition at line 204 of file G4UImanager.hh.

204{ return maxHistSize; }

Referenced by G4UIcontrolMessenger::GetCurrentValue().

◆ GetNumberOfHistory()

G4int G4UImanager::GetNumberOfHistory ( ) const
inline

Definition at line 194 of file G4UImanager.hh.

194{ return G4int(histVec.size()); }

Referenced by G4VBasicShell::ApplyShellCommand().

◆ GetPauseAtBeginOfEvent()

G4bool G4UImanager::GetPauseAtBeginOfEvent ( ) const
inline

Definition at line 173 of file G4UImanager.hh.

173{ return pauseAtBeginOfEvent; }

◆ GetPauseAtEndOfEvent()

G4bool G4UImanager::GetPauseAtEndOfEvent ( ) const
inline

Definition at line 175 of file G4UImanager.hh.

175{ return pauseAtEndOfEvent; }

◆ GetPreviousCommand()

G4String G4UImanager::GetPreviousCommand ( G4int i) const
inline

Definition at line 195 of file G4UImanager.hh.

196 {
197 G4String st;
198 if (i >= 0 && i < G4int(histVec.size())) {
199 st = histVec[i];
200 }
201 return st;
202 }

Referenced by G4VBasicShell::ApplyShellCommand().

◆ GetSession()

G4UIsession * G4UImanager::GetSession ( ) const
inline

Definition at line 178 of file G4UImanager.hh.

178{ return session; }

Referenced by G4VisCommandReviewKeptEvents::SetNewValue().

◆ GetThreadCout()

G4MTcoutDestination * G4UImanager::GetThreadCout ( )
inline

Definition at line 238 of file G4UImanager.hh.

238{ return threadCout; }

◆ GetThreadID()

G4int G4UImanager::GetThreadID ( ) const
inline

Definition at line 230 of file G4UImanager.hh.

230{ return threadID; }

◆ GetTree()

◆ GetUIpointer()

G4UImanager * G4UImanager::GetUIpointer ( )
static

Definition at line 77 of file G4UImanager.cc.

78{
79 if (fUImanager() == nullptr) {
80 if (!fUImanagerHasBeenKilled()) {
81 fUImanager() = new G4UImanager;
82 fUImanager()->CreateMessenger();
83 }
84 }
85 return fUImanager();
86}

Referenced by G4UIQt::AddButton(), G4UIQt::AddIcon(), G4UIcommandTree::AddNewCommand(), G4UIQt::AddViewerTabFromFile(), G4OpenInventorQtExaminerViewer::afterRealizeHook(), G4VBasicShell::ApplyShellCommand(), G4RunManagerKernel::BuildPhysicsTables(), G4VVisCommand::CheckSceneAndNotifyHandlers(), G4VBasicShell::Complete(), G4TaskRunManager::CreateAndStartWorkers(), G4TheMTRayTracer::CreateBitMap(), G4UImessenger::CreateDirectory(), G4OpenGLQtViewer::CreateMainWindow(), G4VtkQtViewer::CreateMainWindow(), G4WorkerRunManager::DoWork(), G4VBasicShell::ExecuteCommand(), G4VBasicShell::FindCommand(), G4VBasicShell::FindDirectory(), G4MTRunManager::G4MTRunManager(), G4TaskRunManager::G4TaskRunManager(), G4UIbatch::G4UIbatch(), G4UIQt::G4UIQt(), G4UIterminal::G4UIterminal(), G4UIWin32::G4UIWin32(), G4UIXm::G4UIXm(), G4VisCommandDrawLogicalVolume::G4VisCommandDrawLogicalVolume(), G4VisCommandDrawVolume::G4VisCommandDrawVolume(), G4VisCommandOpen::G4VisCommandOpen(), G4VisCommandSceneAddMagneticField::G4VisCommandSceneAddMagneticField(), G4WorkerRunManager::G4WorkerRunManager(), G4RunManager::GeometryHasBeenModified(), G4VisManager::GeometryHasChanged(), G4VUIshell::GetCommandTree(), G4UIcontrolMessenger::GetCurrentValue(), G4OpenInventorQtViewer::Initialise(), G4Qt3DViewer::Initialise(), G4ToolsSGQtGLESViewer::Initialise(), G4ToolsSGQtZBViewer::Initialise(), G4TaskRunManagerKernel::InitializeWorker(), G4VVisCommand::InterpolateViews(), G4OpenGLQt::IsUISessionCompatible(), G4OpenGLXm::IsUISessionCompatible(), G4OpenInventor::IsUISessionCompatible(), G4Qt3D::IsUISessionCompatible(), G4ToolsSGQtGLES::IsUISessionCompatible(), G4ToolsSGQtZB::IsUISessionCompatible(), G4VtkQt::IsUISessionCompatible(), G4VisManager::NotifyHandlers(), G4QTabWidget::paintEvent(), G4MTRunManager::PrepareCommandsStack(), G4RunManager::ProcessOneEvent(), G4WorkerRunManager::ProcessOneEvent(), G4WorkerTaskRunManager::ProcessOneEvent(), G4WorkerTaskRunManager::ProcessUI(), G4UIQt::ReceiveG4cout(), G4VVisCommand::RefreshIfRequired(), G4RunManager::ReinitializeGeometry(), G4TaskRunManager::RequestWorkersProcessCommandsStack(), G4UIbatch::SessionStart(), G4VVisCommandGeometrySet::Set(), G4EmExtraParametersMessenger::SetNewValue(), G4EmLowEParametersMessenger::SetNewValue(), G4EmParametersMessenger::SetNewValue(), G4LocalThreadCoutMessenger::SetNewValue(), G4OpenGLViewerMessenger::SetNewValue(), G4OpenGLXmViewerMessenger::SetNewValue(), G4OpticalParametersMessenger::SetNewValue(), G4ProcessManagerMessenger::SetNewValue(), G4ProcessTableMessenger::SetNewValue(), G4RunMessenger::SetNewValue(), G4TrackingMessenger::SetNewValue(), G4UIcontrolMessenger::SetNewValue(), G4VisCommandDrawLogicalVolume::SetNewValue(), G4VisCommandDrawTree::SetNewValue(), G4VisCommandDrawView::SetNewValue(), G4VisCommandDrawVolume::SetNewValue(), G4VisCommandGeometryRestore::SetNewValue(), G4VisCommandList::SetNewValue(), G4VisCommandOpen::SetNewValue(), G4VisCommandPlot::SetNewValue(), G4VisCommandReviewKeptEvents::SetNewValue(), G4VisCommandReviewPlots::SetNewValue(), G4VisCommandSceneAddTrajectories::SetNewValue(), G4VisCommandSceneHandlerCreate::SetNewValue(), G4VisCommandSpecify::SetNewValue(), G4VisCommandsTouchable::SetNewValue(), G4VisCommandsTouchableSet::SetNewValue(), G4VisCommandViewerClone::SetNewValue(), G4VisCommandViewerCreate::SetNewValue(), G4VisCommandViewerFlush::SetNewValue(), G4VisCommandViewerInterpolate::SetNewValue(), G4VisCommandGeometrySetVisibility::SetNewValueOnLV(), G4ToolsSGSceneHandler::SetPlotterHistograms(), G4VViewer::SetTouchable(), G4VBasicShell::ShowCurrent(), G4MTRunManagerKernel::StartThread(), G4VBasicShell::TerminalHelp(), G4TheMTRayTracer::Trace(), G4TheRayTracer::Trace(), G4VViewer::UpdateGUISceneTree(), G4OpenGLQtViewer::updateViewerPropertiesTableWidget(), G4RunManagerKernel::~G4RunManagerKernel(), G4UIcommand::~G4UIcommand(), G4UIQt::~G4UIQt(), G4UIterminal::~G4UIterminal(), G4UIWin32::~G4UIWin32(), G4UIXm::~G4UIXm(), and G4VisManager::~G4VisManager().

◆ GetVerboseLevel()

◆ IsLastCommandOutputTreated()

bool G4UImanager::IsLastCommandOutputTreated ( )
inline

Definition at line 245 of file G4UImanager.hh.

245{ return fLastCommandOutputTreated; }

Referenced by G4UIQt::ReceiveG4cout().

◆ ListAlias()

void G4UImanager::ListAlias ( )

Definition at line 699 of file G4UImanager.cc.

700{
701 aliasList->List();
702}
void List() const

Referenced by G4UIcontrolMessenger::SetNewValue().

◆ ListCommands()

void G4UImanager::ListCommands ( const char * direc)

Definition at line 607 of file G4UImanager.cc.

608{
609 G4UIcommandTree* comTree = FindDirectory(direct);
610 if (comTree != nullptr) {
611 comTree->List();
612 }
613 else {
614 G4cout << direct << " is not found." << G4endl;
615 }
616}

Referenced by G4UIcontrolMessenger::SetNewValue().

◆ Loop()

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

Definition at line 317 of file G4UImanager.cc.

319{
320 G4String cd;
321 if (stepSize > 0) {
322 for (G4double d = initialValue; d <= finalValue; d += stepSize) {
323 std::ostringstream os;
324 os << d;
325 cd += os.str();
326 cd += " ";
327 }
328 }
329 else {
330 for (G4double d = initialValue; d >= finalValue; d += stepSize) {
331 std::ostringstream os;
332 os << d;
333 cd += os.str();
334 cd += " ";
335 }
336 }
337 Foreach(macroFile, variableName, cd);
338}

Referenced by LoopS().

◆ LoopS()

void G4UImanager::LoopS ( const char * valueList)

Definition at line 296 of file G4UImanager.cc.

297{
298 G4String vl = valueList;
299 G4Tokenizer parameterToken(vl);
300 G4String mf = parameterToken();
301 G4String vn = parameterToken();
302 G4String c1 = parameterToken();
303 c1 += " ";
304 c1 += parameterToken();
305 c1 += " ";
306 c1 += parameterToken();
307 const char* t1 = c1;
308 std::istringstream is(t1);
309 G4double d1;
310 G4double d2;
311 G4double d3;
312 is >> d1 >> d2 >> d3;
313 Loop(mf, vn, d1, d2, d3);
314}
void Loop(const char *macroFile, const char *variableName, G4double initialValue, G4double finalValue, G4double stepSize=1.0)

Referenced by G4UIcontrolMessenger::SetNewValue().

◆ Notify()

G4bool G4UImanager::Notify ( G4ApplicationState requestedState)
overridevirtual

Implements G4VStateDependent.

Definition at line 644 of file G4UImanager.cc.

645{
646 if (pauseAtBeginOfEvent) {
647 if (requestedState == G4State_EventProc
648 && G4StateManager::GetStateManager()->GetPreviousState() == G4State_GeomClosed)
649 {
650 PauseSession("BeginOfEvent");
651 }
652 }
653 if (pauseAtEndOfEvent) {
654 if (requestedState == G4State_GeomClosed
655 && G4StateManager::GetStateManager()->GetPreviousState() == G4State_EventProc)
656 {
657 PauseSession("EndOfEvent");
658 }
659 }
660 return true;
661}
@ G4State_EventProc
@ G4State_GeomClosed
static G4StateManager * GetStateManager()

◆ operator!=()

G4bool G4UImanager::operator!= ( const G4UImanager & ) const
delete

◆ operator=()

const G4UImanager & G4UImanager::operator= ( const G4UImanager & )
delete

◆ operator==()

G4bool G4UImanager::operator== ( const G4UImanager & ) const
delete

◆ ParseMacroSearchPath()

void G4UImanager::ParseMacroSearchPath ( )

Definition at line 717 of file G4UImanager.cc.

718{
719 searchDirs.clear();
720
721 std::size_t idxfirst = 0;
722 std::size_t idxend = 0;
723 G4String pathstring = "";
724 while ((idxend = searchPath.find(':', idxfirst)) != G4String::npos) {
725 pathstring = searchPath.substr(idxfirst, idxend - idxfirst);
726 if (!pathstring.empty()) {
727 searchDirs.push_back(pathstring);
728 }
729 idxfirst = idxend + 1;
730 }
731
732 pathstring = searchPath.substr(idxfirst, searchPath.size() - idxfirst);
733 if (!pathstring.empty()) {
734 searchDirs.push_back(pathstring);
735 }
736}

Referenced by G4UIcontrolMessenger::SetNewValue().

◆ RegisterBridge()

void G4UImanager::RegisterBridge ( G4UIbridge * brg)

Definition at line 775 of file G4UImanager.cc.

776{
777 if (brg->LocalUI() == this) {
778 G4Exception("G4UImanager::RegisterBridge()", "UI7002", FatalException,
779 "G4UIBridge cannot bridge between same object.");
780 }
781 else {
782 bridges->push_back(brg);
783 }
784}
@ FatalException
G4UImanager * LocalUI() const
Definition G4UIbridge.hh:54

◆ RemoveAlias()

void G4UImanager::RemoveAlias ( const char * aliasName)

Definition at line 691 of file G4UImanager.cc.

692{
693 G4String aL = aliasName;
694 G4String targetAlias = G4StrUtil::strip_copy(aL);
695 aliasList->RemoveAlias(targetAlias);
696}
void RemoveAlias(const char *aliasName)

Referenced by G4UIcontrolMessenger::SetNewValue().

◆ RemoveCommand()

void G4UImanager::RemoveCommand ( G4UIcommand * aCommand)

Definition at line 269 of file G4UImanager.cc.

270{
271 treeTop->RemoveCommand(aCommand);
272 if (fMasterUImanager() != nullptr && G4Threading::G4GetThreadId() == 0) {
273 fMasterUImanager()->RemoveWorkerCommand(aCommand);
274 }
275}
void RemoveCommand(G4UIcommand *aCommand, G4bool workerThreadOnly=false)

Referenced by G4UIcommand::~G4UIcommand().

◆ SetAlias()

void G4UImanager::SetAlias ( const char * aliasLine)

Definition at line 670 of file G4UImanager.cc.

671{
672 G4String aLine = aliasLine;
673 std::size_t i = aLine.find(' ');
674 G4String aliasName = aLine.substr(0, i);
675 G4String aliasValue = aLine.substr(i + 1, aLine.length() - (i + 1));
676 if (aliasValue[0] == '"') {
677 G4String strippedValue;
678 if (aliasValue.back() == '"') {
679 strippedValue = aliasValue.substr(1, aliasValue.length() - 2);
680 }
681 else {
682 strippedValue = aliasValue.substr(1, aliasValue.length() - 1);
683 }
684 aliasValue = strippedValue;
685 }
686
687 aliasList->ChangeAlias(aliasName, aliasValue);
688}
void ChangeAlias(const char *aliasName, const char *aliasValue)

Referenced by Foreach(), and G4UIcontrolMessenger::SetNewValue().

◆ SetCerrFileName()

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

Definition at line 825 of file G4UImanager.cc.

826{
827 // for sequential mode, ignore this method.
828 if (threadID < 0) {
829 return;
830 }
831
832 if (fileN == "**Screen**") {
833 threadCout->SetCerrFileName(fileN, ifAppend);
834 }
835 else {
836 std::stringstream fn;
837 fn << "G4W_" << threadID << "_" << fileN;
838 threadCout->SetCerrFileName(fn.str(), ifAppend);
839 }
840}
void SetCerrFileName(const G4String &fileN="G4cerr.txt", G4bool ifAppend=true)

Referenced by G4LocalThreadCoutMessenger::SetNewValue().

◆ SetCoutDestination()

void G4UImanager::SetCoutDestination ( G4UIsession *const value)

◆ SetCoutFileName()

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

Definition at line 807 of file G4UImanager.cc.

808{
809 // for sequential mode, ignore this method.
810 if (threadID < 0) {
811 return;
812 }
813
814 if (fileN == "**Screen**") {
815 threadCout->SetCoutFileName(fileN, ifAppend);
816 }
817 else {
818 std::stringstream fn;
819 fn << "G4W_" << threadID << "_" << fileN;
820 threadCout->SetCoutFileName(fn.str(), ifAppend);
821 }
822}
void SetCoutFileName(const G4String &fileN="G4cout.txt", G4bool ifAppend=true)

Referenced by G4LocalThreadCoutMessenger::SetNewValue().

◆ SetG4UIWindow()

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

Definition at line 185 of file G4UImanager.hh.

185{ g4UIWindow = value; }

Referenced by G4UIQt::G4UIQt(), G4UIWin32::G4UIWin32(), G4UIQt::~G4UIQt(), and G4UIWin32::~G4UIWin32().

◆ SetIgnoreCmdNotFound()

void G4UImanager::SetIgnoreCmdNotFound ( G4bool val)
inline

Definition at line 220 of file G4UImanager.hh.

220{ ignoreCmdNotFound = val; }

Referenced by G4WorkerRunManager::G4WorkerRunManager().

◆ SetLastCommandOutputTreated()

void G4UImanager::SetLastCommandOutputTreated ( )
inline

Definition at line 246 of file G4UImanager.hh.

246{ fLastCommandOutputTreated = true; }

Referenced by G4UIQt::ReceiveG4cout().

◆ SetMacroSearchPath()

void G4UImanager::SetMacroSearchPath ( const G4String & path)
inline

Definition at line 206 of file G4UImanager.hh.

206{ searchPath = path; }

Referenced by G4UIcontrolMessenger::SetNewValue().

◆ SetMasterUIManager()

void G4UImanager::SetMasterUIManager ( G4bool val)
inline

Definition at line 211 of file G4UImanager.hh.

212 {
213 isMaster = val;
214 stackCommandsForBroadcast = val;
215 if (val && (bridges == nullptr)) {
216 bridges = new std::vector<G4UIbridge*>;
217 fMasterUImanager() = this;
218 }
219 }

Referenced by G4MTRunManager::G4MTRunManager(), and G4TaskRunManager::G4TaskRunManager().

◆ SetMaxHistSize()

void G4UImanager::SetMaxHistSize ( G4int mx)
inline

Definition at line 203 of file G4UImanager.hh.

203{ maxHistSize = mx; }

Referenced by G4UIcontrolMessenger::SetNewValue().

◆ SetPauseAtBeginOfEvent()

void G4UImanager::SetPauseAtBeginOfEvent ( G4bool vl)
inline

Definition at line 172 of file G4UImanager.hh.

172{ pauseAtBeginOfEvent = vl; }

Referenced by G4RunMessenger::SetNewValue().

◆ SetPauseAtEndOfEvent()

void G4UImanager::SetPauseAtEndOfEvent ( G4bool vl)
inline

Definition at line 174 of file G4UImanager.hh.

174{ pauseAtEndOfEvent = vl; }

Referenced by G4RunMessenger::SetNewValue().

◆ SetSession()

◆ SetThreadIgnore()

void G4UImanager::SetThreadIgnore ( G4int tid = 0)

Definition at line 863 of file G4UImanager.cc.

864{
865 // for sequential mode, ignore this method.
866 if (threadID < 0) {
867 igThreadID = tid;
868 return;
869 }
870 threadCout->SetIgnoreCout(tid);
871}
void SetIgnoreCout(G4int tid=0)

Referenced by G4LocalThreadCoutMessenger::SetNewValue().

◆ SetThreadIgnoreInit()

void G4UImanager::SetThreadIgnoreInit ( G4bool flg = true)

Definition at line 874 of file G4UImanager.cc.

875{
876 // for sequential mode, ignore this method.
877 if (threadID < 0) {
878 return;
879 }
880 threadCout->SetIgnoreInit(flg);
881}
void SetIgnoreInit(G4bool val=true)

Referenced by G4LocalThreadCoutMessenger::SetNewValue().

◆ SetThreadPrefixString()

void G4UImanager::SetThreadPrefixString ( const G4String & prefix = "W")

Definition at line 843 of file G4UImanager.cc.

844{
845 // for sequential mode, ignore this method.
846 if (threadID < 0) {
847 return;
848 }
849 threadCout->SetPrefixString(s);
850}
void SetPrefixString(const G4String &wd="G4WT")

Referenced by G4LocalThreadCoutMessenger::SetNewValue().

◆ SetThreadUseBuffer()

void G4UImanager::SetThreadUseBuffer ( G4bool flg = true)

Definition at line 853 of file G4UImanager.cc.

854{
855 // for sequential mode, ignore this method.
856 if (threadID < 0) {
857 return;
858 }
859 threadCout->EnableBuffering(flg);
860}
void EnableBuffering(G4bool flag=true)

Referenced by G4LocalThreadCoutMessenger::SetNewValue().

◆ SetUpForAThread()

void G4UImanager::SetUpForAThread ( G4int tId)

Definition at line 787 of file G4UImanager.cc.

788{
789 threadID = tId;
791 threadCout = new G4MTcoutDestination(threadID);
792 threadCout->SetIgnoreCout(igThreadID);
793}
void G4iosInitialization()
Definition G4ios.cc:265

Referenced by G4TaskRunManagerKernel::InitializeWorker(), and G4MTRunManagerKernel::StartThread().

◆ SetUpForSpecialThread()

void G4UImanager::SetUpForSpecialThread ( const G4String & aPrefix)

Definition at line 796 of file G4UImanager.cc.

797{
801 threadCout = new G4MTcoutDestination(threadID);
802 threadCout->SetPrefixString(pref);
803 threadCout->SetIgnoreCout(igThreadID);
804}
void G4SetThreadId(G4int aNewValue)

◆ SetVerboseLevel()

◆ SolveAlias()

G4String G4UImanager::SolveAlias ( const char * aCmd)

Definition at line 393 of file G4UImanager.cc.

394{
395 G4String aCommand = aCmd;
396 std::size_t ia = aCommand.find('{');
397 std::size_t iz = aCommand.find('#');
398 while ((ia != std::string::npos) && ((iz == std::string::npos) || (ia < iz))) {
399 G4int ibx = -1;
400 while (ibx < 0) {
401 std::size_t ib = aCommand.find('}');
402 if (ib == std::string::npos) {
403 G4cerr << aCommand << G4endl;
404 for (std::size_t i = 0; i < ia; ++i) {
405 G4cerr << " ";
406 }
407 G4cerr << "^" << G4endl;
408 G4cerr << "Unmatched alias parenthesis -- command ignored" << G4endl;
409 G4String nullStr;
410 return nullStr;
411 }
412 G4String ps = aCommand.substr(ia + 1, aCommand.length() - (ia + 1));
413 std::size_t ic = ps.find('{');
414 std::size_t id = ps.find('}');
415 if (ic != std::string::npos && ic < id) {
416 ia += ic + 1;
417 }
418 else {
419 ibx = (G4int)ib;
420 }
421 }
422 //--- Here ia represents the position of innermost "{"
423 //--- and ibx represents corresponding "}"
424 G4String subs;
425 if (ia > 0) {
426 subs = aCommand.substr(0, ia);
427 }
428 G4String alis = aCommand.substr(ia + 1, ibx - ia - 1);
429 G4String rems = aCommand.substr(ibx + 1, aCommand.length() - ibx);
430 const G4String* alVal = aliasList->FindAlias(alis);
431 if (alVal == nullptr) {
432 G4cerr << "Alias <" << alis << "> not found -- command ignored" << G4endl;
433 G4String nullStr;
434 return nullStr;
435 }
436 aCommand = subs + (*alVal) + rems;
437 ia = aCommand.find('{');
438 }
439 return aCommand;
440}
const G4String * FindAlias(const char *aliasName) const

Referenced by ApplyCommand(), FindCommand(), and G4UIcontrolMessenger::SetNewValue().

◆ StoreHistory() [1/2]

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

Definition at line 576 of file G4UImanager.cc.

577{
578 StoreHistory(true, fileName);
579}
void StoreHistory(const char *fileName="G4history.macro")

Referenced by G4UIcontrolMessenger::SetNewValue(), and StoreHistory().

◆ StoreHistory() [2/2]

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

Definition at line 582 of file G4UImanager.cc.

583{
584 if (historySwitch) {
585 if (saveHistory) {
586 historyFile.close();
587 }
588 historyFile.open((char*)fileName);
589 saveHistory = true;
590 }
591 else {
592 historyFile.close();
593 saveHistory = false;
594 }
595 saveHistory = historySwitch;
596}

◆ UseDoublePrecisionStr()

void G4UImanager::UseDoublePrecisionStr ( G4bool val)
static

Definition at line 146 of file G4UImanager.cc.

147{
148 doublePrecisionStr = val;
149}

Referenced by G4UIcontrolMessenger::SetNewValue().


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