G4VisCommandSceneEndOfRunAction Class Reference

#include <G4VisCommandsScene.hh>

Inheritance diagram for G4VisCommandSceneEndOfRunAction:

G4VVisCommandScene G4VVisCommand G4UImessenger

Public Member Functions

 G4VisCommandSceneEndOfRunAction ()
virtual ~G4VisCommandSceneEndOfRunAction ()
G4String GetCurrentValue (G4UIcommand *command)
void SetNewValue (G4UIcommand *command, G4String newValue)

Detailed Description

Definition at line 91 of file G4VisCommandsScene.hh.


Constructor & Destructor Documentation

G4VisCommandSceneEndOfRunAction::G4VisCommandSceneEndOfRunAction (  ) 

Definition at line 389 of file G4VisCommandsScene.cc.

00389                                                                   {
00390   G4bool omitable;
00391   fpCommand = new G4UIcmdWithAString ("/vis/scene/endOfRunAction", this);
00392   fpCommand -> SetGuidance
00393     ("Accumulate or refresh the viewer for each new run.");
00394   fpCommand -> SetGuidance
00395     ("\"accumulate\": viewer accumulates hits, etc., run by run, or");
00396   fpCommand -> SetGuidance
00397     ("\"refresh\": viewer shows them at end of run or, for direct-screen"
00398      "\n  viewers, refreshes the screen just before drawing the first"
00399      "\n  event of the next run.");
00400   fpCommand -> SetGuidance ("The detector remains or is redrawn.");
00401   fpCommand -> SetParameterName ("action", omitable = true);
00402   fpCommand -> SetCandidates ("accumulate refresh");
00403   fpCommand -> SetDefaultValue ("refresh");
00404 }

G4VisCommandSceneEndOfRunAction::~G4VisCommandSceneEndOfRunAction (  )  [virtual]

Definition at line 406 of file G4VisCommandsScene.cc.

00406                                                                    {
00407   delete fpCommand;
00408 }


Member Function Documentation

G4String G4VisCommandSceneEndOfRunAction::GetCurrentValue ( G4UIcommand command  )  [virtual]

Reimplemented from G4UImessenger.

Definition at line 410 of file G4VisCommandsScene.cc.

00410                                                                       {
00411   return "";
00412 }

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

Reimplemented from G4UImessenger.

Definition at line 414 of file G4VisCommandsScene.cc.

References G4VisManager::confirmations, G4VisManager::errors, G4VVisCommand::fpVisManager, G4cout, G4endl, G4VisManager::GetCurrentScene(), G4VisManager::GetCurrentSceneHandler(), G4Scene::GetRefreshAtEndOfEvent(), G4Scene::GetRefreshAtEndOfRun(), G4VisManager::GetVerbosity(), G4VisManager::ResetTransientsDrawnFlags(), G4VSceneHandler::SetMarkForClearingTransientStore(), and G4Scene::SetRefreshAtEndOfRun().

00415                                                                         {
00416 
00417   G4VisManager::Verbosity verbosity = fpVisManager->GetVerbosity();
00418 
00419   G4String action;
00420   std::istringstream is (newValue);
00421   is >> action;
00422 
00423   G4Scene* pScene = fpVisManager->GetCurrentScene();
00424   if (!pScene) {
00425     if (verbosity >= G4VisManager::errors) {
00426       G4cout << "ERROR: No current scene.  Please create one." << G4endl;
00427     }
00428     return;
00429   }
00430 
00431   G4VSceneHandler* pSceneHandler = fpVisManager->GetCurrentSceneHandler();
00432   if (!pSceneHandler) {
00433     if (verbosity >= G4VisManager::errors) {
00434       G4cout << "ERROR: No current sceneHandler.  Please create one." << G4endl;
00435     }
00436     return;
00437   }
00438 
00439   if (action == "accumulate") {
00440     if (pScene->GetRefreshAtEndOfEvent()) {
00441       if (verbosity >= G4VisManager::errors) {
00442         G4cout <<
00443           "ERROR: Cannot accumulate runs unless events accumulate too."
00444           "\n  Use \"/vis/scene/endOfEventAction accumulate\"."
00445                << G4endl;
00446       }
00447     }
00448     else {
00449       pScene->SetRefreshAtEndOfRun(false);
00450     }
00451   }
00452   else if (action == "refresh") {
00453     pScene->SetRefreshAtEndOfRun(true);
00454     pSceneHandler->SetMarkForClearingTransientStore(true);
00455   }
00456   else {
00457     if (verbosity >= G4VisManager::errors) {
00458       G4cout <<
00459         "ERROR: unrecognised parameter \"" << action << "\"."
00460              << G4endl;
00461     }
00462     return;
00463   }
00464 
00465   // Change of transients behaviour, so...
00466   fpVisManager->ResetTransientsDrawnFlags();
00467 
00468   if (verbosity >= G4VisManager::confirmations) {
00469     G4cout << "End of run action set to \"";
00470     if (pScene->GetRefreshAtEndOfRun()) G4cout << "refresh";
00471     else G4cout << "accumulate";
00472     G4cout << "\"" << G4endl;
00473   }
00474 }


The documentation for this class was generated from the following files:
Generated on Mon May 27 17:53:45 2013 for Geant4 by  doxygen 1.4.7