#include <G4VisCommandsCompound.hh>
Inheritance diagram for G4VisCommandOpen:
Public Member Functions | |
G4VisCommandOpen () | |
virtual | ~G4VisCommandOpen () |
void | SetNewValue (G4UIcommand *command, G4String newValue) |
Definition at line 69 of file G4VisCommandsCompound.hh.
G4VisCommandOpen::G4VisCommandOpen | ( | ) |
Definition at line 232 of file G4VisCommandsCompound.cc.
References G4VVisCommand::fpVisManager, G4VisManager::GetAvailableGraphicsSystems(), G4String::isNull(), G4UIparameter::SetDefaultValue(), G4UIparameter::SetGuidance(), G4UIcommand::SetGuidance(), G4UIcommand::SetParameter(), G4UIparameter::SetParameterCandidates(), and G4String::strip().
00232 { 00233 G4bool omitable; 00234 fpCommand = new G4UIcommand("/vis/open", this); 00235 fpCommand->SetGuidance 00236 ("Creates a scene handler ready for drawing."); 00237 fpCommand->SetGuidance 00238 ("The scene handler becomes current (the name is auto-generated)."); 00239 G4UIparameter* parameter; 00240 parameter = new G4UIparameter("graphics-system-name", 's', omitable = false); 00241 const G4GraphicsSystemList& gslist = 00242 fpVisManager->GetAvailableGraphicsSystems(); 00243 G4String candidates; 00244 for (size_t igslist = 0; igslist < gslist.size(); igslist++) { 00245 const G4String& name = gslist[igslist]->GetName(); 00246 const G4String& nickname = gslist[igslist]->GetNickname(); 00247 if (nickname.isNull()) { 00248 candidates += name; 00249 } 00250 else { 00251 candidates += nickname; 00252 } 00253 candidates += " "; 00254 } 00255 candidates = candidates.strip(); 00256 parameter->SetParameterCandidates(candidates); 00257 fpCommand->SetParameter(parameter); 00258 parameter = new G4UIparameter("window-size-hint", 's', omitable = true); 00259 parameter->SetGuidance 00260 ("integer (pixels) for square window placed by window manager or" 00261 " X-Windows-type geometry string, e.g. 600x600-100+100"); 00262 parameter->SetDefaultValue("600"); 00263 fpCommand->SetParameter(parameter); 00264 }
G4VisCommandOpen::~G4VisCommandOpen | ( | ) | [virtual] |
void G4VisCommandOpen::SetNewValue | ( | G4UIcommand * | command, | |
G4String | newValue | |||
) | [virtual] |
Reimplemented from G4UImessenger.
Definition at line 270 of file G4VisCommandsCompound.cc.
References G4UImanager::ApplyCommand(), G4VisManager::confirmations, G4VVisCommand::fpVisManager, G4UImanager::GetUIpointer(), G4UImanager::GetVerboseLevel(), G4VisManager::GetVerbosity(), and G4UImanager::SetVerboseLevel().
00270 { 00271 G4String systemName, windowSizeHint; 00272 std::istringstream is(newValue); 00273 is >> systemName >> windowSizeHint; 00274 G4UImanager* UImanager = G4UImanager::GetUIpointer(); 00275 G4int keepVerbose = UImanager->GetVerboseLevel(); 00276 G4int newVerbose(0); 00277 if (keepVerbose >= 2 || 00278 fpVisManager->GetVerbosity() >= G4VisManager::confirmations) 00279 newVerbose = 2; 00280 UImanager->SetVerboseLevel(newVerbose); 00281 UImanager->ApplyCommand(G4String("/vis/sceneHandler/create " + systemName)); 00282 UImanager->ApplyCommand(G4String("/vis/viewer/create ! ! " + windowSizeHint)); 00283 UImanager->SetVerboseLevel(keepVerbose); 00284 }