286 {
287
289
291 G4int maxNumberOfKeptEvents;
292 std::istringstream is (newValue);
293 is >> action >> maxNumberOfKeptEvents;
294
296 if (!pScene) {
298 G4warn <<
"ERROR: No current scene. Please create one." <<
G4endl;
299 }
300 return;
301 }
302
304 if (!pSceneHandler) {
306 G4warn <<
"ERROR: No current sceneHandler. Please create one." <<
G4endl;
307 }
308 return;
309 }
310
311 if (action == "accumulate") {
314 }
315 else if (action == "refresh") {
319 "ERROR: Cannot refresh events unless runs refresh too."
320 "\n Use \"/vis/scene/endOfRun refresh\"."
322 }
323 } else {
327 }
328 }
329 else {
332 "ERROR: unrecognised parameter \"" << action << "\"."
334 }
335 return;
336 }
337
338
340
341
342 size_t nCurrentlyKept = 0;
344 if(runManager)
345 {
347 if(currentRun)
348 {
349 const std::vector<const G4Event*>* events = currentRun->
GetEventVector();
350 if(events)
351 nCurrentlyKept = events->size();
352 }
353 }
354
356 G4cout <<
"End of event action set to ";
358 else {
359 G4cout <<
"\"accumulate\"."
360 "\n Maximum number of events to be kept: "
361 << maxNumberOfKeptEvents
362 << " (unlimited if negative)."
363 "\n This may be changed with, e.g., "
364 "\"/vis/scene/endOfEventAction accumulate 1000\".";
365 }
367 }
368
370 maxNumberOfKeptEvents != 0 &&
373 if (nCurrentlyKept) {
375 "\n There are currently " << nCurrentlyKept
376 << " events kept for refreshing and/or reviewing.";
377 } else {
378 G4warn <<
"The vis manager will keep ";
379 if (maxNumberOfKeptEvents < 0)
G4warn <<
"an unlimited number of";
380 else G4warn <<
"up to " << maxNumberOfKeptEvents;
382 if (maxNumberOfKeptEvents > 1 || maxNumberOfKeptEvents < 0)
384 "\n This may use a lot of memory."
385 "\n It may be changed with, e.g., "
386 "\"/vis/scene/endOfEventAction accumulate 10\".";
387 }
389 }
390}
G4GLOB_DLL std::ostream G4cout
static G4RunManager * GetMasterRunManager()
const G4Run * GetCurrentRun() const
std::vector< const G4Event * > * GetEventVector() const
G4bool GetRefreshAtEndOfEvent() const
void SetRefreshAtEndOfEvent(G4bool)
void SetMaxNumberOfKeptEvents(G4int)
G4bool GetRefreshAtEndOfRun() const
void SetMarkForClearingTransientStore(G4bool)
static G4VisManager * fpVisManager
G4Scene * GetCurrentScene() const
G4VSceneHandler * GetCurrentSceneHandler() const
static Verbosity GetVerbosity()
void ResetTransientsDrawnFlags()