#include <G4VisCommandsViewer.hh>
Inheritance diagram for G4VisCommandViewerFlush:
Public Member Functions | |
G4VisCommandViewerFlush () | |
virtual | ~G4VisCommandViewerFlush () |
G4String | GetCurrentValue (G4UIcommand *command) |
void | SetNewValue (G4UIcommand *command, G4String newValue) |
Definition at line 173 of file G4VisCommandsViewer.hh.
G4VisCommandViewerFlush::G4VisCommandViewerFlush | ( | ) |
Definition at line 855 of file G4VisCommandsViewer.cc.
00855 { 00856 G4bool omitable, currentAsDefault; 00857 fpCommand = new G4UIcmdWithAString ("/vis/viewer/flush", this); 00858 fpCommand -> SetGuidance 00859 ("Compound command: \"/vis/viewer/refresh\" + \"/vis/viewer/update\"."); 00860 fpCommand -> SetGuidance 00861 ("Useful for refreshing and initiating post-processing for graphics" 00862 "\nsystems which need post-processing. By default, acts on current" 00863 "\nviewer. \"/vis/viewer/list\" to see possible viewers. Viewer" 00864 "\nbecomes current."); 00865 fpCommand -> SetParameterName ("viewer-name", 00866 omitable = true, 00867 currentAsDefault = true); 00868 }
G4VisCommandViewerFlush::~G4VisCommandViewerFlush | ( | ) | [virtual] |
G4String G4VisCommandViewerFlush::GetCurrentValue | ( | G4UIcommand * | command | ) | [virtual] |
Reimplemented from G4UImessenger.
Definition at line 875 of file G4VisCommandsViewer.cc.
00875 { 00876 G4VViewer* viewer = fpVisManager -> GetCurrentViewer (); 00877 return viewer ? viewer -> GetName () : G4String("none"); 00878 }
void G4VisCommandViewerFlush::SetNewValue | ( | G4UIcommand * | command, | |
G4String | newValue | |||
) | [virtual] |
Reimplemented from G4UImessenger.
Definition at line 880 of file G4VisCommandsViewer.cc.
References G4UImanager::ApplyCommand(), G4VisManager::confirmations, G4VisManager::errors, G4VVisCommand::fpVisManager, G4cout, G4endl, G4UImanager::GetUIpointer(), G4UImanager::GetVerboseLevel(), G4VisManager::GetVerbosity(), and G4UImanager::SetVerboseLevel().
00880 { 00881 00882 G4VisManager::Verbosity verbosity = fpVisManager->GetVerbosity(); 00883 00884 G4String& flushName = newValue; 00885 G4VViewer* viewer = fpVisManager -> GetViewer (flushName); 00886 if (!viewer) { 00887 if (verbosity >= G4VisManager::errors) { 00888 G4cout << "ERROR: Viewer \"" << flushName << "\"" << 00889 " not found - \"/vis/viewer/list\"\n to see possibilities." 00890 << G4endl; 00891 } 00892 return; 00893 } 00894 00895 G4UImanager* ui = G4UImanager::GetUIpointer(); 00896 G4int keepVerbose = ui->GetVerboseLevel(); 00897 G4int newVerbose(0); 00898 if (keepVerbose >= 2 || verbosity >= G4VisManager::confirmations) 00899 newVerbose = 2; 00900 ui->SetVerboseLevel(newVerbose); 00901 ui->ApplyCommand(G4String("/vis/viewer/refresh " + flushName)); 00902 ui->ApplyCommand(G4String("/vis/viewer/update " + flushName)); 00903 ui->SetVerboseLevel(keepVerbose); 00904 if (verbosity >= G4VisManager::confirmations) { 00905 G4cout << "Viewer \"" << viewer -> GetName () << "\"" 00906 << " flushed." << G4endl; 00907 } 00908 }