#include <G4VisCommandsSceneAdd.hh>
Inheritance diagram for G4VisCommandSceneAddPSHits:
Public Member Functions | |
G4VisCommandSceneAddPSHits () | |
virtual | ~G4VisCommandSceneAddPSHits () |
G4String | GetCurrentValue (G4UIcommand *command) |
void | SetNewValue (G4UIcommand *command, G4String newValue) |
Definition at line 300 of file G4VisCommandsSceneAdd.hh.
G4VisCommandSceneAddPSHits::G4VisCommandSceneAddPSHits | ( | ) |
Definition at line 1653 of file G4VisCommandsSceneAdd.cc.
01653 { 01654 G4bool omitable; 01655 fpCommand = new G4UIcmdWithAString ("/vis/scene/add/psHits", this); 01656 fpCommand -> SetGuidance 01657 ("Adds Primitive Scorer Hits (PSHits) to current scene."); 01658 fpCommand -> SetGuidance 01659 ("PSHits are drawn at end of run when the scene in which" 01660 "\nthey are added is current."); 01661 fpCommand -> SetGuidance 01662 ("Optional parameter specifies name of scoring map. By default all" 01663 "\nscoring maps registered with the G4ScoringManager are drawn."); 01664 fpCommand -> SetParameterName ("mapname", omitable = true); 01665 fpCommand -> SetDefaultValue ("all"); 01666 }
G4VisCommandSceneAddPSHits::~G4VisCommandSceneAddPSHits | ( | ) | [virtual] |
G4String G4VisCommandSceneAddPSHits::GetCurrentValue | ( | G4UIcommand * | command | ) | [virtual] |
void G4VisCommandSceneAddPSHits::SetNewValue | ( | G4UIcommand * | command, | |
G4String | newValue | |||
) | [virtual] |
Reimplemented from G4UImessenger.
Definition at line 1677 of file G4VisCommandsSceneAdd.cc.
References G4VisManager::confirmations, G4VisManager::errors, G4cout, G4endl, and G4VisManager::warnings.
01678 { 01679 G4VisManager::Verbosity verbosity = fpVisManager->GetVerbosity(); 01680 G4bool warn(verbosity >= G4VisManager::warnings); 01681 01682 G4Scene* pScene = fpVisManager->GetCurrentScene(); 01683 if (!pScene) { 01684 if (verbosity >= G4VisManager::errors) { 01685 G4cout << "ERROR: No current scene. Please create one." << G4endl; 01686 } 01687 return; 01688 } 01689 01690 G4PSHitsModel* model = new G4PSHitsModel(newValue); 01691 const G4String& currentSceneName = pScene -> GetName (); 01692 G4bool successful = pScene -> AddEndOfRunModel (model, warn); 01693 if (successful) { 01694 if (verbosity >= G4VisManager::confirmations) { 01695 if (newValue == "all") { 01696 G4cout << "All Primitive Scorer hits"; 01697 } else { 01698 G4cout << "Hits of Primitive Scorer \"" << newValue << '"'; 01699 } 01700 G4cout << " will be drawn at end of run in scene \"" 01701 << currentSceneName << "\"." 01702 << G4endl; 01703 } 01704 } 01705 else G4VisCommandsSceneAddUnsuccessful(verbosity); 01706 UpdateVisManagerScene (currentSceneName); 01707 }