#include <G4VisCommandsScene.hh>
Inheritance diagram for G4VisCommandSceneList:
Public Member Functions | |
G4VisCommandSceneList () | |
virtual | ~G4VisCommandSceneList () |
G4String | GetCurrentValue (G4UIcommand *command) |
void | SetNewValue (G4UIcommand *command, G4String newValue) |
Definition at line 104 of file G4VisCommandsScene.hh.
G4VisCommandSceneList::G4VisCommandSceneList | ( | ) |
Definition at line 478 of file G4VisCommandsScene.cc.
00478 { 00479 G4bool omitable; 00480 fpCommand = new G4UIcommand ("/vis/scene/list", this); 00481 fpCommand -> SetGuidance ("Lists scene(s)."); 00482 fpCommand -> SetGuidance 00483 ("\"help /vis/verbose\" for definition of verbosity."); 00484 G4UIparameter* parameter; 00485 parameter = new G4UIparameter ("scene-name", 's', omitable = true); 00486 parameter -> SetDefaultValue ("all"); 00487 fpCommand -> SetParameter (parameter); 00488 parameter = new G4UIparameter ("verbosity", 's', omitable = true); 00489 parameter -> SetDefaultValue ("warnings"); 00490 fpCommand -> SetParameter (parameter); 00491 }
G4VisCommandSceneList::~G4VisCommandSceneList | ( | ) | [virtual] |
G4String G4VisCommandSceneList::GetCurrentValue | ( | G4UIcommand * | command | ) | [virtual] |
void G4VisCommandSceneList::SetNewValue | ( | G4UIcommand * | command, | |
G4String | newValue | |||
) | [virtual] |
Reimplemented from G4UImessenger.
Definition at line 501 of file G4VisCommandsScene.cc.
References G4VVisCommand::fpVisManager, G4cout, G4endl, G4Scene::GetName(), G4VisManager::GetVerbosityValue(), G4VisManager::parameters, and G4VisManager::warnings.
00501 { 00502 G4String name, verbosityString; 00503 std::istringstream is (newValue); 00504 is >> name >> verbosityString; 00505 G4VisManager::Verbosity verbosity = 00506 fpVisManager->GetVerbosityValue(verbosityString); 00507 const G4Scene* currentScene = fpVisManager -> GetCurrentScene (); 00508 G4String currentName; 00509 if (currentScene) currentName = currentScene->GetName(); 00510 00511 G4SceneList& sceneList = fpVisManager -> SetSceneList (); 00512 G4int iScene, nScenes = sceneList.size (); 00513 G4bool found = false; 00514 for (iScene = 0; iScene < nScenes; iScene++) { 00515 G4Scene* pScene = sceneList [iScene]; 00516 const G4String& iName = pScene -> GetName (); 00517 if (name != "all") { 00518 if (name != iName) continue; 00519 } 00520 found = true; 00521 if (iName == currentName) { 00522 G4cout << " (current)"; 00523 } 00524 else { 00525 G4cout << " "; 00526 } 00527 G4cout << " scene \"" << iName << "\""; 00528 if (verbosity >= G4VisManager::warnings) { 00529 G4int i; 00530 G4cout << "\n Run-duration models:"; 00531 G4int nRunModels = pScene -> GetRunDurationModelList ().size (); 00532 if (nRunModels == 0) { 00533 G4cout << " none."; 00534 } 00535 for (i = 0; i < nRunModels; i++) { 00536 if (pScene -> GetRunDurationModelList()[i].fActive) 00537 G4cout << "\n Active: "; 00538 else G4cout << "\n Inactive: "; 00539 G4VModel* pModel = pScene -> GetRunDurationModelList()[i].fpModel; 00540 G4cout << pModel -> GetGlobalDescription (); 00541 } 00542 G4cout << "\n End-of-event models:"; 00543 G4int nEOEModels = pScene -> GetEndOfEventModelList ().size (); 00544 if (nEOEModels == 0) { 00545 G4cout << " none."; 00546 } 00547 for (i = 0; i < nEOEModels; i++) { 00548 if (pScene -> GetEndOfEventModelList()[i].fActive) 00549 G4cout << "\n Active: "; 00550 else G4cout << "\n Inactive: "; 00551 G4VModel* pModel = pScene -> GetEndOfEventModelList()[i].fpModel; 00552 G4cout << pModel -> GetGlobalDescription (); 00553 } 00554 G4cout << "\n End-of-run models:"; 00555 G4int nEORModels = pScene -> GetEndOfRunModelList ().size (); 00556 if (nEORModels == 0) { 00557 G4cout << " none."; 00558 } 00559 for (i = 0; i < nEORModels; i++) { 00560 if (pScene -> GetEndOfRunModelList()[i].fActive) 00561 G4cout << "\n Active: "; 00562 else G4cout << "\n Inactive: "; 00563 G4VModel* pModel = pScene -> GetEndOfRunModelList()[i].fpModel; 00564 G4cout << pModel -> GetGlobalDescription (); 00565 } 00566 } 00567 if (verbosity >= G4VisManager::parameters) { 00568 G4cout << "\n " << *sceneList [iScene]; 00569 } 00570 G4cout << G4endl; 00571 } 00572 if (!found) { 00573 G4cout << "No scenes found"; 00574 if (name != "all") { 00575 G4cout << " of name \"" << name << "\""; 00576 } 00577 G4cout << "." << G4endl; 00578 } 00579 }