Geant4 9.6.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4VisCommandSceneEndOfRunAction Class Reference

#include <G4VisCommandsScene.hh>

+ Inheritance diagram for G4VisCommandSceneEndOfRunAction:

Public Member Functions

 G4VisCommandSceneEndOfRunAction ()
 
virtual ~G4VisCommandSceneEndOfRunAction ()
 
G4String GetCurrentValue (G4UIcommand *command)
 
void SetNewValue (G4UIcommand *command, G4String newValue)
 
- Public Member Functions inherited from G4VVisCommandScene
 G4VVisCommandScene ()
 
virtual ~G4VVisCommandScene ()
 
- Public Member Functions inherited from G4VVisCommand
 G4VVisCommand ()
 
virtual ~G4VVisCommand ()
 
- Public Member Functions inherited from G4UImessenger
 G4UImessenger ()
 
 G4UImessenger (const G4String &path, const G4String &dsc)
 
virtual ~G4UImessenger ()
 
virtual G4String GetCurrentValue (G4UIcommand *command)
 
virtual void SetNewValue (G4UIcommand *command, G4String newValue)
 
G4bool operator== (const G4UImessenger &messenger) const
 

Additional Inherited Members

- Static Public Member Functions inherited from G4VVisCommand
static void SetVisManager (G4VisManager *)
 
- Protected Member Functions inherited from G4VVisCommandScene
G4String CurrentSceneName ()
 
- Protected Member Functions inherited from G4VVisCommand
void UpdateVisManagerScene (const G4String &sceneName="")
 
- Protected Member Functions inherited from G4UImessenger
G4String ItoS (G4int i)
 
G4String DtoS (G4double a)
 
G4String BtoS (G4bool b)
 
G4int StoI (G4String s)
 
G4double StoD (G4String s)
 
G4bool StoB (G4String s)
 
void AddUIcommand (G4UIcommand *newCommand)
 
void CreateDirectory (const G4String &path, const G4String &dsc)
 
template<typename T >
T * CreateCommand (const G4String &cname, const G4String &dsc)
 
- Static Protected Member Functions inherited from G4VVisCommand
static G4String ConvertToString (G4double x, G4double y, const char *unitName)
 
static void ConvertToDoublePair (const G4String &paramString, G4double &xval, G4double &yval)
 
- Protected Attributes inherited from G4UImessenger
G4UIdirectorybaseDir
 
G4String baseDirName
 
- Static Protected Attributes inherited from G4VVisCommand
static G4VisManagerfpVisManager = 0
 
static G4Colour fCurrentColour = G4Colour::White()
 
static G4Colour fCurrentTextColour = G4Colour::Blue()
 
static G4Text::Layout fCurrentTextLayout = G4Text::left
 
static G4double fCurrentLineWidth = 1.
 
static G4ModelingParameters::PVNameCopyNoPath fCurrentTouchablePath
 

Detailed Description

Definition at line 91 of file G4VisCommandsScene.hh.

Constructor & Destructor Documentation

◆ G4VisCommandSceneEndOfRunAction()

G4VisCommandSceneEndOfRunAction::G4VisCommandSceneEndOfRunAction ( )

Definition at line 389 of file G4VisCommandsScene.cc.

389 {
390 G4bool omitable;
391 fpCommand = new G4UIcmdWithAString ("/vis/scene/endOfRunAction", this);
392 fpCommand -> SetGuidance
393 ("Accumulate or refresh the viewer for each new run.");
394 fpCommand -> SetGuidance
395 ("\"accumulate\": viewer accumulates hits, etc., run by run, or");
396 fpCommand -> SetGuidance
397 ("\"refresh\": viewer shows them at end of run or, for direct-screen"
398 "\n viewers, refreshes the screen just before drawing the first"
399 "\n event of the next run.");
400 fpCommand -> SetGuidance ("The detector remains or is redrawn.");
401 fpCommand -> SetParameterName ("action", omitable = true);
402 fpCommand -> SetCandidates ("accumulate refresh");
403 fpCommand -> SetDefaultValue ("refresh");
404}
bool G4bool
Definition: G4Types.hh:67

◆ ~G4VisCommandSceneEndOfRunAction()

G4VisCommandSceneEndOfRunAction::~G4VisCommandSceneEndOfRunAction ( )
virtual

Definition at line 406 of file G4VisCommandsScene.cc.

406 {
407 delete fpCommand;
408}

Member Function Documentation

◆ GetCurrentValue()

G4String G4VisCommandSceneEndOfRunAction::GetCurrentValue ( G4UIcommand command)
virtual

Reimplemented from G4UImessenger.

Definition at line 410 of file G4VisCommandsScene.cc.

410 {
411 return "";
412}

◆ SetNewValue()

void G4VisCommandSceneEndOfRunAction::SetNewValue ( G4UIcommand command,
G4String  newValue 
)
virtual

Reimplemented from G4UImessenger.

Definition at line 414 of file G4VisCommandsScene.cc.

415 {
416
418
419 G4String action;
420 std::istringstream is (newValue);
421 is >> action;
422
424 if (!pScene) {
425 if (verbosity >= G4VisManager::errors) {
426 G4cout << "ERROR: No current scene. Please create one." << G4endl;
427 }
428 return;
429 }
430
432 if (!pSceneHandler) {
433 if (verbosity >= G4VisManager::errors) {
434 G4cout << "ERROR: No current sceneHandler. Please create one." << G4endl;
435 }
436 return;
437 }
438
439 if (action == "accumulate") {
440 if (pScene->GetRefreshAtEndOfEvent()) {
441 if (verbosity >= G4VisManager::errors) {
442 G4cout <<
443 "ERROR: Cannot accumulate runs unless events accumulate too."
444 "\n Use \"/vis/scene/endOfEventAction accumulate\"."
445 << G4endl;
446 }
447 }
448 else {
449 pScene->SetRefreshAtEndOfRun(false);
450 }
451 }
452 else if (action == "refresh") {
453 pScene->SetRefreshAtEndOfRun(true);
454 pSceneHandler->SetMarkForClearingTransientStore(true);
455 }
456 else {
457 if (verbosity >= G4VisManager::errors) {
458 G4cout <<
459 "ERROR: unrecognised parameter \"" << action << "\"."
460 << G4endl;
461 }
462 return;
463 }
464
465 // Change of transients behaviour, so...
467
468 if (verbosity >= G4VisManager::confirmations) {
469 G4cout << "End of run action set to \"";
470 if (pScene->GetRefreshAtEndOfRun()) G4cout << "refresh";
471 else G4cout << "accumulate";
472 G4cout << "\"" << G4endl;
473 }
474}
#define G4endl
Definition: G4ios.hh:52
G4DLLIMPORT std::ostream G4cout
G4bool GetRefreshAtEndOfEvent() const
void SetRefreshAtEndOfRun(G4bool)
G4bool GetRefreshAtEndOfRun() const
void SetMarkForClearingTransientStore(G4bool)
static G4VisManager * fpVisManager
G4Scene * GetCurrentScene() const
G4VSceneHandler * GetCurrentSceneHandler() const
static Verbosity GetVerbosity()
void ResetTransientsDrawnFlags()

The documentation for this class was generated from the following files: