- Timestamp:
- Nov 9, 2007, 3:32:25 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/geant4/visualization/management/src/G4VisCommands.cc
r531 r593 25 25 // 26 26 // 27 // $Id: G4VisCommands.cc,v 1.2 0 2006/11/26 15:49:10allison Exp $28 // GEANT4 tag $Name: geant4-0 8-02-patch-01 $27 // $Id: G4VisCommands.cc,v 1.22 2007/03/27 15:47:32 allison Exp $ 28 // GEANT4 tag $Name: geant4-09-00-ref-01 $ 29 29 30 30 // /vis/ top level commands - John Allison 5th February 2001 … … 40 40 #include "G4Run.hh" 41 41 #include "G4UIsession.hh" 42 43 ////////////// /vis/abortReviewKeptEvents ///////////////////////////// 44 45 G4VisCommandAbortReviewKeptEvents::G4VisCommandAbortReviewKeptEvents () { 46 G4bool omitable; 47 48 fpCommand = new G4UIcmdWithABool("/vis/abortReviewKeptEvents", this); 49 fpCommand -> SetGuidance("Abort review of kept events."); 50 fpCommand -> SetParameterName("abort", omitable=true); 51 fpCommand -> SetDefaultValue(true); 52 } 53 54 G4VisCommandAbortReviewKeptEvents::~G4VisCommandAbortReviewKeptEvents () { 55 delete fpCommand; 56 } 57 58 G4String G4VisCommandAbortReviewKeptEvents::GetCurrentValue (G4UIcommand*) { 59 return G4String(); 60 } 61 62 void G4VisCommandAbortReviewKeptEvents::SetNewValue (G4UIcommand*, 63 G4String newValue) { 64 fpVisManager->SetAbortReviewKeptEvents(G4UIcommand::ConvertToBool(newValue)); 65 G4cout << "Type \"continue\" to complete the abort." << G4endl; 66 } 42 67 43 68 ////////////// /vis/enable /////////////////////////////////////// … … 128 153 fpCommand -> SetGuidance 129 154 ("If a macro file is specified, it is executed for each event."); 130 fpCommand -> SetGuidance 131 ("If a macro file is not specified, each event is drawn to the current" 132 "\nviewer. After each event, the session is paused. The user may issue" 133 "\nany allowed command. Then enter \"continue\" to continue to the next" 134 "\nevent."); 155 fpCommand -> SetGuidance( 156 "If a macro file is not specified, each event is drawn to the current" 157 "\nviewer. After each event, the session is paused. The user may issue" 158 "\nany allowed command. Then enter \"cont[inue]\" to continue to the next" 159 "\nevent." 160 "\nUseful commands might be:" 161 "\n \"/vis/viewer/...\" to change the view (zoom, set/viewpoint,...)." 162 "\n \"/vis/oglx/printEPS\" to get hard copy." 163 "\n \"/vis/open\" to get alternative viewer." 164 "\n \"/vis/abortReviewKeptEvents\", then \"cont[inue]\", to abort."); 135 165 fpCommand -> SetParameterName("macro-file-name", omitable=true); 136 166 fpCommand -> SetDefaultValue(""); … … 185 215 } 186 216 187 G4VSceneHandler* sceneHandler = fpVisManager->GetCurrentSceneHandler();188 189 217 G4UImanager* UImanager = G4UImanager::GetUIpointer(); 190 218 G4int keepVerbose = UImanager->GetVerboseLevel(); … … 200 228 201 229 // Draw to viewer and pause session... 230 G4UIsession* session = UImanager->GetSession(); 202 231 for (size_t i = 0; i < nKeptEvents; ++i) { 203 232 const G4Event* event = (*events)[i]; 204 233 if (verbosity >= G4VisManager::warnings) { 205 234 G4cout << "Drawing event : " << event->GetEventID() << 206 ". At EndOfEvent, enter any command, then \"cont inue\"..."235 ". At EndOfEvent, enter any command, then \"cont[inue]\"..." 207 236 << G4endl; 237 static G4bool first = true; 238 if (first) { 239 first = false; 240 G4cout << 241 " Useful commands might be:" 242 "\n \"/vis/viewer/...\" to change the view (zoom, set/viewpoint,...)." 243 "\n \"/vis/oglx/printEPS\" to get hard copy." 244 "\n \"/vis/open\" to get alternative viewer." 245 "\n \"/vis/abortReviewKeptEvents\", then \"cont[inue]\", to abort." 246 << G4endl; 247 } 208 248 } 209 sceneHandler->SetEvent(event);249 fpVisManager->SetRequestedEvent(event); 210 250 UImanager->ApplyCommand("/vis/viewer/rebuild"); 211 251 /* The above command forces a rebuild of the scene, including … … 224 264 features or a complete re-think. 225 265 */ 226 if (!viewer->GetViewParameters().IsAutoRefresh()) 227 UImanager->ApplyCommand("/vis/viewer/flush"); 228 G4UIsession* session = UImanager->GetSession(); 266 UImanager->ApplyCommand("/vis/viewer/flush"); 229 267 session->PauseSessionStart("EndOfEvent"); 230 sceneHandler->SetEvent(0); 231 } 268 fpVisManager->SetRequestedEvent(0); 269 if (fpVisManager->GetAbortReviewKeptEvents()) break; 270 } 271 fpVisManager->SetAbortReviewKeptEvents(false); 232 272 233 273 } else { … … 240 280 << " with macro file \"" << macroFileName << G4endl; 241 281 } 242 sceneHandler->SetEvent(event);282 fpVisManager->SetRequestedEvent(event); 243 283 UImanager->ApplyCommand("/control/execute " + macroFileName); 244 sceneHandler->SetEvent(0);284 fpVisManager->SetRequestedEvent(0); 245 285 } 246 286 }
Note: See TracChangeset
for help on using the changeset viewer.