90 UImessenger(0), UnitsMessenger(0), CoutMessenger(0),
91 isMaster(
false),bridges(0),
92 ignoreCmdNotFound(
false), stackCommandsForBroadcast(
false),
93 threadID(-1), threadCout(0), lastRC(0)
123 std::vector<G4UIbridge*>::iterator itr =
bridges->begin();
124 for(;itr!=
bridges->end();itr++)
180 {
return (
this==&right); }
182 {
return (
this!=&right); }
210 for(
G4int i_thParameter=0;i_thParameter<parameterNumber;i_thParameter++)
212 token = savedToken();
214 if( token[(
size_t)0] ==
'"' )
217 token.
append(savedToken(
"\""));
224 const char * aParameterName,
G4bool reGet)
232 if( aParameterName ==
240 const char * aParameterName,
G4bool reGet)
245 const char*
t = targetParameter;
246 std::istringstream is(t);
257 const char*
t = targetParameter;
258 std::istringstream is(t);
264 const char * aParameterName,
G4bool reGet)
269 const char*
t = targetParameter;
270 std::istringstream is(t);
281 const char*
t = targetParameter;
282 std::istringstream is(t);
330 c1 += parameterToken();
332 c1 += parameterToken();
334 std::istringstream is(t1);
338 is >> d1 >> d2 >> d3;
339 Loop(mf,vn,d1,d2,d3);
347 for(
G4double d=initialValue;
d<=finalValue;
d+=stepSize)
349 std::ostringstream os;
355 for(
G4double d=initialValue;
d>=finalValue;
d+=stepSize)
357 std::ostringstream os;
363 Foreach(macroFile,variableName,cd);
374 while(!((ca=parameterToken()).isNull()))
381 if(aliasValue(0)==
'"')
384 if(aliasValue(aliasValue.length()-1)==
'"')
385 { strippedValue = aliasValue(1,aliasValue.length()-2); }
387 { strippedValue = aliasValue(1,aliasValue.length()-1); }
388 aliasValue = strippedValue;
396 const char * candidates)
398 G4String candidatesString = candidates;
401 while(!((cd=parameterToken()).isNull()))
411 ed <<
"Loop aborted due to a command execution error - "
412 <<
"error code " <<
lastRC;
425 while((ia !=
G4int(std::string::npos))&&((iz==
G4int(std::string::npos))||(ia<iz)))
431 if( ib ==
G4int(std::string::npos) )
436 G4cerr <<
"Unmatched alias parenthesis -- command ignored" <<
G4endl;
440 G4String ps = aCommand(ia+1,aCommand.length()-(ia+1));
443 if(ic!=
G4int(std::string::npos) && ic <
id)
451 if(ia>0) subs = aCommand(0,ia);
452 G4String alis = aCommand(ia+1,ibx-ia-1);
453 G4String rems = aCommand(ibx+1,aCommand.length()-ibx);
458 G4cerr <<
"Alias <" << alis <<
"> not found -- command ignored" <<
G4endl;
462 aCommand = subs+(*alVal)+rems;
463 ia = aCommand.
index(
"{");
483 size_t i = aCommand.
index(
" ");
484 if( i != std::string::npos )
486 commandString = aCommand(0,i);
487 commandParameter = aCommand(i+1,aCommand.length()-(i+1));
491 commandString = aCommand;
501 if(commandString(ll,2)==
"//")
504 { commandString.
remove(ll,1); }
507 a1 = commandString(0,ll);
508 a2 = commandString(ll+1,len-ll-1);
509 commandString = a1+a2;
519 std::vector<G4UIbridge*>::iterator itr =
bridges->begin();
520 for(;itr!=
bridges->end();itr++)
522 G4int leng = (*itr)->DirLength();
523 if(commandString(0,leng)==(*itr)->DirName())
524 {
return (*itr)->LocalUI()->ApplyCommand(commandString+
" "+commandParameter); }
529 if( targetCommand ==
nullptr )
534 {
commandStack->push_back(commandString+
" "+commandParameter); }
542 {
commandStack->push_back(commandString+
" "+commandParameter); }
553 G4int commandFailureCode = targetCommand->
DoIt( commandParameter );
554 if(commandFailureCode==0)
557 if(additionalFailureCode > 0)
561 <<
"Error code : " << additionalFailureCode;
562 G4Exception(
"G4UImanager::ApplyCommand",
"UIMAN0123",
564 commandFailureCode += additionalFailureCode;
567 return commandFailureCode;
608 if( targetDir( targetDir.length()-1 ) !=
'/' )
609 { targetDir +=
"/"; }
611 if( targetDir ==
"/" )
614 while( idx <
G4int(targetDir.length())-1 )
617 G4String targetDirString = targetDir(0,i+1);
618 comTree = comTree->
GetTree(targetDirString);
619 if( comTree ==
nullptr )
673 G4String aliasValue = aLine(i+1,aLine.length()-(i+1));
674 if(aliasValue(0)==
'"')
677 if(aliasValue(aliasValue.length()-1)==
'"')
678 { strippedValue = aliasValue(1,aliasValue.length()-2); }
680 { strippedValue = aliasValue(1,aliasValue.length()-1); }
681 aliasValue = strippedValue;
705 {
G4cerr <<
"Directory <" << dir <<
"> is not found." <<
G4endl; }
716 pathstring =
searchPath.substr(idxfirst, idxend-idxfirst);
717 if(pathstring.size() != 0)
searchDirs.push_back(pathstring);
718 idxfirst = idxend + 1;
722 if(pathstring.size() != 0)
searchDirs.push_back(pathstring);
742 for (
size_t i = 0; i <
searchDirs.size(); i++) {
745 macrofile = fullpath;
765 "G4UIBridge cannot bridge between same object.");
794 if(fileN ==
"**Screen**")
798 std::stringstream fn;
809 if(fileN ==
"**Screen**")
813 std::stringstream fn;