#include <G4VisCommandsSceneHandler.hh>
Inheritance diagram for G4VisCommandSceneHandlerList:
Public Member Functions | |
G4VisCommandSceneHandlerList () | |
~G4VisCommandSceneHandlerList () | |
G4String | GetCurrentValue (G4UIcommand *command) |
void | SetNewValue (G4UIcommand *command, G4String newValue) |
Definition at line 63 of file G4VisCommandsSceneHandler.hh.
G4VisCommandSceneHandlerList::G4VisCommandSceneHandlerList | ( | ) |
Definition at line 326 of file G4VisCommandsSceneHandler.cc.
00326 { 00327 G4bool omitable; 00328 fpCommand = new G4UIcommand ("/vis/sceneHandler/list", this); 00329 fpCommand -> SetGuidance ("Lists scene handler(s)."); 00330 fpCommand -> SetGuidance 00331 ("\"help /vis/verbose\" for definition of verbosity."); 00332 G4UIparameter* parameter; 00333 parameter = new G4UIparameter("scene-handler-name", 's', omitable = true); 00334 parameter -> SetDefaultValue ("all"); 00335 fpCommand -> SetParameter (parameter); 00336 parameter = new G4UIparameter ("verbosity", 's', omitable = true); 00337 parameter -> SetDefaultValue ("warnings"); 00338 fpCommand -> SetParameter (parameter); 00339 }
G4VisCommandSceneHandlerList::~G4VisCommandSceneHandlerList | ( | ) |
G4String G4VisCommandSceneHandlerList::GetCurrentValue | ( | G4UIcommand * | command | ) | [virtual] |
void G4VisCommandSceneHandlerList::SetNewValue | ( | G4UIcommand * | command, | |
G4String | newValue | |||
) | [virtual] |
Reimplemented from G4UImessenger.
Definition at line 349 of file G4VisCommandsSceneHandler.cc.
References G4VVisCommand::fpVisManager, G4cout, G4endl, G4VSceneHandler::GetName(), G4VisManager::GetVerbosityValue(), and G4VisManager::parameters.
00350 { 00351 G4String name, verbosityString; 00352 std::istringstream is (newValue); 00353 is >> name >> verbosityString; 00354 G4VisManager::Verbosity verbosity = 00355 fpVisManager->GetVerbosityValue(verbosityString); 00356 const G4VSceneHandler* currentSceneHandler = 00357 fpVisManager -> GetCurrentSceneHandler (); 00358 G4String currentName; 00359 if (currentSceneHandler) currentName = currentSceneHandler->GetName(); 00360 00361 const G4SceneHandlerList& list = fpVisManager -> GetAvailableSceneHandlers (); 00362 G4bool found = false; 00363 for (size_t iSH = 0; iSH < list.size (); iSH++) { 00364 const G4String& iName = list [iSH] -> GetName (); 00365 if (name != "all") { 00366 if (name != iName) continue; 00367 } 00368 found = true; 00369 if (iName == currentName) { 00370 G4cout << " (current)"; 00371 } 00372 else { 00373 G4cout << " "; 00374 } 00375 G4cout << " scene handler \"" << list [iSH] -> GetName () << "\"" 00376 << " (" << list [iSH] -> GetGraphicsSystem () -> GetName () << ")"; 00377 if (verbosity >= G4VisManager::parameters) { 00378 G4cout << "\n " << *(list [iSH]); 00379 } 00380 G4cout << G4endl; 00381 } 00382 if (!found) { 00383 G4cout << "No scene handlers found"; 00384 if (name != "all") { 00385 G4cout << " of name \"" << name << "\""; 00386 } 00387 G4cout << "." << G4endl; 00388 } 00389 }