409 std::istringstream is (newValue);
414 while (is.get(c) && c ==
' '){}
416 while (is.get(c) && c !=
'"') {originalName +=
c;}
420 while (is.get(c) && c !=
' ') {originalName +=
c;}
426 if (!originalViewer) {
428 G4cerr <<
"ERROR: Viewer \"" << originalName
429 <<
"\" not found - \"/vis/viewer/list\" to see possibilities." 434 originalName = originalViewer->
GetName();
436 while (is.get(c) && c ==
' '){}
438 while (is.get(c) && c !=
'"') {cloneName +=
c;}
442 while (is.get(c) && c !=
' ') {cloneName +=
c;}
447 G4bool errorWhileNaming =
false;
448 if (cloneName ==
"none") {
451 cloneName = originalName;
452 std::ostringstream oss;
453 oss <<
'-' << subID++;
454 G4String::size_type lastDashPosition, nextSpacePosition;
455 if ((lastDashPosition = cloneName.rfind(
'-')) != G4String::npos &&
456 (nextSpacePosition = cloneName.find(
" ", lastDashPosition)) !=
458 cloneName.insert(nextSpacePosition, oss.str());
460 G4String::size_type spacePosition = cloneName.find(
' ');
461 if (spacePosition != G4String::npos)
462 cloneName.insert(spacePosition, oss.str());
464 errorWhileNaming =
true;
466 }
while (!errorWhileNaming &&
fpVisManager -> GetViewer (cloneName));
469 if (errorWhileNaming) {
471 G4cerr <<
"ERROR: While naming clone viewer \"" << cloneName
480 G4cerr <<
"ERROR: Putative clone viewer \"" << cloneName
481 <<
"\" already exists." 493 if (keepVerbose >= 2 ||
499 (
G4String(
"/vis/viewer/create ! \"" + cloneName +
"\" " + windowSizeHint));
504 G4cout <<
"Viewer \"" << originalName <<
"\" cloned." <<
G4endl;
505 G4cout <<
"Clone \"" << cloneName <<
"\" now current." <<
G4endl;
G4int GetVerboseLevel() const
G4String strip(G4int strip_Type=trailing, char c=' ')
void SetVerboseLevel(G4int val)
static G4UImanager * GetUIpointer()
G4GLOB_DLL std::ostream G4cout
static Verbosity GetVerbosity()
const G4ViewParameters & GetViewParameters() const
const G4String & GetXGeometryString() const
const G4String & GetName() const
G4int ApplyCommand(const char *aCommand)
G4GLOB_DLL std::ostream G4cerr
static G4VisManager * fpVisManager