1478 {
1479 G4String
name, verbosityString;
1480 std::istringstream is (newValue);
1481 is >>
name >> verbosityString;
1482 G4String shortName =
fpVisManager -> ViewerShortName (name);
1485
1486 const G4VViewer* currentViewer =
fpVisManager -> GetCurrentViewer ();
1487 G4String currentViewerShortName;
1488 if (currentViewer) {
1489 currentViewerShortName = currentViewer -> GetShortName ();
1490 }
1491 else {
1492 currentViewerShortName = "none";
1493 }
1494
1495 const G4SceneHandlerList& sceneHandlerList =
1497 std::size_t nHandlers = sceneHandlerList.size ();
1499 G4bool foundCurrent =
false;
1500 for (std::size_t iHandler = 0; iHandler < nHandlers; ++iHandler) {
1501 G4VSceneHandler* sceneHandler = sceneHandlerList [iHandler];
1502 const G4ViewerList& viewerList = sceneHandler -> GetViewerList ();
1504 << "Scene handler \"" << sceneHandler -> GetName () << "\" ("
1506 const G4Scene* pScene = sceneHandler -> GetScene ();
1507 if (pScene) {
1508 G4cout <<
", scene \"" << pScene -> GetName () <<
"\"";
1509 }
1511 std::size_t nViewers = viewerList.size ();
1512 if (nViewers == 0) {
1513 G4cout <<
"\n No viewers for this scene handler." <<
G4endl;
1514 }
1515 else {
1516 for (std::size_t iViewer = 0; iViewer < nViewers; ++iViewer) {
1517 const G4VViewer* thisViewer = viewerList [iViewer];
1518 G4String thisName = thisViewer -> GetName ();
1519 G4String thisShortName = thisViewer -> GetShortName ();
1520 if (name != "all") {
1521 if (thisShortName != shortName) continue;
1522 }
1523 found = true;
1525 if (thisShortName == currentViewerShortName) {
1526 foundCurrent = true;
1528 }
1529 else {
1531 }
1532 G4cout <<
" viewer \"" << thisName <<
"\"";
1534 G4cout <<
"\n " << *thisViewer;
1535 }
1536 }
1537 }
1539 }
1540
1541 if (!foundCurrent) {
1542 G4cout <<
"No valid current viewer - please create or select one."
1544 }
1545
1546 if (!found) {
1548 if (name != "all") {
1550 }
1552 }
1553}
G4GLOB_DLL std::ostream G4cout
const G4String & GetNickname() const
G4VGraphicsSystem * GetGraphicsSystem() const
static G4VisManager * fpVisManager
const char * name(G4int ptype)