#include <G4VisCommandsGeometry.hh>
Inheritance diagram for G4VisCommandGeometryList:
Public Member Functions | |
G4VisCommandGeometryList () | |
virtual | ~G4VisCommandGeometryList () |
G4String | GetCurrentValue (G4UIcommand *command) |
void | SetNewValue (G4UIcommand *command, G4String newValue) |
Definition at line 52 of file G4VisCommandsGeometry.hh.
G4VisCommandGeometryList::G4VisCommandGeometryList | ( | ) |
Definition at line 49 of file G4VisCommandsGeometry.cc.
00050 { 00051 G4bool omitable; 00052 fpCommand = new G4UIcmdWithAString("/vis/geometry/list", this); 00053 fpCommand -> SetGuidance("Lists vis attributes of logical volume(s)."); 00054 fpCommand -> SetGuidance("\"all\" lists all logical volumes."); 00055 fpCommand -> SetParameterName("logical-volume-name", omitable = true); 00056 fpCommand -> SetDefaultValue("all"); 00057 }
G4VisCommandGeometryList::~G4VisCommandGeometryList | ( | ) | [virtual] |
G4String G4VisCommandGeometryList::GetCurrentValue | ( | G4UIcommand * | command | ) | [virtual] |
void G4VisCommandGeometryList::SetNewValue | ( | G4UIcommand * | command, | |
G4String | newValue | |||
) | [virtual] |
Reimplemented from G4UImessenger.
Definition at line 69 of file G4VisCommandsGeometry.cc.
References G4VisManager::errors, G4VVisCommand::fpVisManager, G4cout, G4endl, G4LogicalVolumeStore::GetInstance(), and G4VisManager::GetVerbosity().
00070 { 00071 G4LogicalVolumeStore *pLVStore = G4LogicalVolumeStore::GetInstance(); 00072 G4bool found = false; 00073 for (size_t iLV = 0; iLV < pLVStore->size(); iLV++ ) { 00074 G4LogicalVolume*pLV = (*pLVStore)[iLV]; 00075 const G4String& logVolName = pLV->GetName(); 00076 if (newValue == "all" || logVolName == newValue) { 00077 const G4VisAttributes* visAtts = pLV->GetVisAttributes(); 00078 G4cout << "\nLogical Volume \"" << pLV->GetName() 00079 << "\": vis attributes:\n" << *visAtts 00080 << G4endl; 00081 } 00082 if (logVolName == newValue) found = true; 00083 } 00084 if (newValue != "all" && !found) { 00085 if (fpVisManager->GetVerbosity() >= G4VisManager::errors) { 00086 G4cout << "ERROR: Logical volume \"" << newValue 00087 << "\" not found in logical volume store." << G4endl; 00088 } 00089 return; 00090 } 00091 }