- Timestamp:
- Jun 1, 2010, 6:36:22 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/source/visualization/management/src/G4VisCommandsSceneAdd.cc
r1258 r1288 25 25 // 26 26 // 27 // $Id: G4VisCommandsSceneAdd.cc,v 1. 79 2010/05/11 10:58:49allison Exp $27 // $Id: G4VisCommandsSceneAdd.cc,v 1.81 2010/06/01 16:08:15 allison Exp $ 28 28 // GEANT4 tag $Name: $ 29 29 // /vis/scene commands - John Allison 9th August 1998 … … 37 37 #include "G4ModelingParameters.hh" 38 38 #include "G4HitsModel.hh" 39 #include "G4DigiModel.hh" 39 40 #include "G4PSHitsModel.hh" 40 41 #include "G4TrajectoriesModel.hh" … … 157 158 } 158 159 160 161 ////////////// /vis/scene/add/digis /////////////////////////////////////// 162 163 G4VisCommandSceneAddDigis::G4VisCommandSceneAddDigis () { 164 fpCommand = new G4UIcmdWithoutParameter ("/vis/scene/add/digitisations", this); 165 fpCommand -> SetGuidance ("Adds digis to current scene."); 166 fpCommand -> SetGuidance 167 ("Digis are drawn at end of event when the scene in which" 168 "\nthey are added is current."); 169 170 fpCommandUS = new G4UIcmdWithoutParameter ("/vis/scene/add/digitizations", this); 171 fpCommandUS -> SetGuidance ("Adds digis to current scene."); 172 fpCommandUS -> SetGuidance 173 ("Digis are drawn at end of event when the scene in which" 174 "\nthey are added is current."); 175 } 176 177 G4VisCommandSceneAddDigis::~G4VisCommandSceneAddDigis () { 178 delete fpCommandUS; 179 delete fpCommand; 180 } 181 182 G4String G4VisCommandSceneAddDigis::GetCurrentValue (G4UIcommand*) { 183 return ""; 184 } 185 186 void G4VisCommandSceneAddDigis::SetNewValue (G4UIcommand*, G4String) { 187 188 G4VisManager::Verbosity verbosity = fpVisManager->GetVerbosity(); 189 G4bool warn(verbosity >= G4VisManager::warnings); 190 191 G4Scene* pScene = fpVisManager->GetCurrentScene(); 192 if (!pScene) { 193 if (verbosity >= G4VisManager::errors) { 194 G4cout << "ERROR: No current scene. Please create one." << G4endl; 195 } 196 return; 197 } 198 199 G4DigiModel* model = new G4DigiModel; 200 const G4String& currentSceneName = pScene -> GetName (); 201 G4bool successful = pScene -> AddEndOfEventModel (model, warn); 202 if (successful) { 203 if (verbosity >= G4VisManager::confirmations) { 204 G4cout << "Digis will be drawn in scene \"" 205 << currentSceneName << "\"." 206 << G4endl; 207 } 208 } 209 else G4VisCommandsSceneAddUnsuccessful(verbosity); 210 UpdateVisManagerScene (currentSceneName); 211 } 159 212 160 213 ////////////// /vis/scene/add/eventID ///////////////////////////////////////
Note: See TracChangeset
for help on using the changeset viewer.