#include <G4VisCommandsScene.hh>
Inheritance diagram for G4VisCommandSceneCreate:
Public Member Functions | |
G4VisCommandSceneCreate () | |
virtual | ~G4VisCommandSceneCreate () |
G4String | GetCurrentValue (G4UIcommand *command) |
void | SetNewValue (G4UIcommand *command, G4String newValue) |
Definition at line 64 of file G4VisCommandsScene.hh.
G4VisCommandSceneCreate::G4VisCommandSceneCreate | ( | ) |
Definition at line 191 of file G4VisCommandsScene.cc.
00191 : fId (0) { 00192 G4bool omitable; 00193 fpCommand = new G4UIcmdWithAString ("/vis/scene/create", this); 00194 fpCommand -> SetGuidance 00195 ("Creates an empty scene."); 00196 fpCommand -> SetGuidance 00197 ("Invents a name if not supplied. This scene becomes current."); 00198 fpCommand -> SetParameterName ("scene-name", omitable = true); 00199 }
G4VisCommandSceneCreate::~G4VisCommandSceneCreate | ( | ) | [virtual] |
G4String G4VisCommandSceneCreate::GetCurrentValue | ( | G4UIcommand * | command | ) | [virtual] |
void G4VisCommandSceneCreate::SetNewValue | ( | G4UIcommand * | command, | |
G4String | newValue | |||
) | [virtual] |
Reimplemented from G4UImessenger.
Definition at line 215 of file G4VisCommandsScene.cc.
References G4VisManager::confirmations, G4VVisCommand::fpVisManager, G4cout, G4endl, G4VisManager::GetVerbosity(), and G4VisManager::warnings.
00215 { 00216 00217 G4VisManager::Verbosity verbosity = fpVisManager->GetVerbosity(); 00218 00219 G4String& newName = newValue; 00220 G4String nextName = NextName (); 00221 00222 if (newName == "") { 00223 newName = nextName; 00224 } 00225 if (newName == nextName) fId++; 00226 00227 G4SceneList& sceneList = fpVisManager -> SetSceneList (); 00228 G4int iScene, nScenes = sceneList.size (); 00229 for (iScene = 0; iScene < nScenes; iScene++) { 00230 if (sceneList [iScene] -> GetName () == newName) break; 00231 } 00232 if (iScene < nScenes) { 00233 if (verbosity >= G4VisManager::warnings) { 00234 G4cout << "WARNING: Scene \"" << newName << "\" already exists." 00235 << "\n New scene not created." 00236 << G4endl; 00237 } 00238 } else { 00239 00240 // Add empty scene data object to list... 00241 G4Scene* pScene = new G4Scene (newName); 00242 sceneList.push_back (pScene); 00243 fpVisManager -> SetCurrentScene (pScene); 00244 00245 if (verbosity >= G4VisManager::confirmations) { 00246 G4cout << "New empty scene \"" << newName << "\" created." << G4endl; 00247 } 00248 } 00249 }