230{
231 static bool reviewing = false;
232 if (reviewing) {
234 "\"/vis/reviewKeptEvents\" not allowed within an already started review."
235 "\n No action taken."
237 return;
238 }
239
242
245 const std::vector<const G4Event*>* events = run? run->
GetEventVector(): 0;
246 size_t nKeptEvents = events? events->size(): 0;
247
248 if (!nKeptEvents) {
251 "ERROR: G4VisCommandReviewKeptEvents::SetNewValue: No kept events,"
252 "\n or kept events not accessible."
254 }
255 return;
256 }
257
259 if (!viewer) {
262 "ERROR: No current viewer - \"/vis/viewer/list\" to see possibilities."
264 }
265 return;
266 }
267
269 if (!pScene) {
271 G4cout <<
"ERROR: No current scene. Please create one." <<
G4endl;
272 }
273 return;
274 }
275
280 newVerbose = 2;
282
283
284 reviewing = true;
287 if (macroFileName.empty()) {
288
289
291 for (size_t i = 0; i < nKeptEvents; ++i) {
292 const G4Event*
event = (*events)[i];
294 G4cout <<
"Drawing event : " <<
event->GetEventID() <<
295 ". At EndOfEvent, enter any command, then \"cont[inue]\"..."
297 static G4bool first =
true;
298 if (first) {
299 first = false;
301 " Useful commands might be:"
302 "\n \"/vis/viewer/...\" to change the view (zoom, set/viewpoint,...)."
303 "\n \"/vis/oglx/printEPS\" to get hard copy."
304 "\n \"/vis/open\" to get alternative viewer."
305 "\n \"/vis/abortReviewKeptEvents\", then \"cont[inue]\", to abort."
307 }
308 }
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
330 }
332
333 } else {
334
335
336 for (size_t i = 0; i < nKeptEvents; ++i) {
337 const G4Event*
event = (*events)[i];
339 G4cout <<
"Drawing event : " <<
event->GetEventID()
340 <<
" with macro file \"" << macroFileName <<
G4endl;
341 }
343 UImanager->
ApplyCommand(
"/control/execute " + macroFileName);
345 }
346 }
348 reviewing = false;
349
351}
G4DLLIMPORT std::ostream G4cout
static G4RunManager * GetRunManager()
const G4Run * GetCurrentRun() const
const std::vector< const G4Event * > * GetEventVector() const
G4bool GetRefreshAtEndOfEvent() const
void SetRefreshAtEndOfEvent(G4bool)
G4int ApplyCommand(const char *aCommand)
G4int GetVerboseLevel() const
G4UIsession * GetSession() const
static G4UImanager * GetUIpointer()
void SetVerboseLevel(G4int val)
virtual void PauseSessionStart(const G4String &Prompt)
static G4VisManager * fpVisManager
G4Scene * GetCurrentScene() const
G4bool GetAbortReviewKeptEvents() const
void SetAbortReviewKeptEvents(G4bool)
G4VViewer * GetCurrentViewer() const
void SetRequestedEvent(const G4Event *)
static Verbosity GetVerbosity()