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

#include <G4VisCommandsSceneAdd.hh>

+ Inheritance diagram for G4VisCommandSceneAddUserAction:

Public Member Functions

 G4VisCommandSceneAddUserAction ()
 
virtual ~G4VisCommandSceneAddUserAction ()
 
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 367 of file G4VisCommandsSceneAdd.hh.

Constructor & Destructor Documentation

◆ G4VisCommandSceneAddUserAction()

G4VisCommandSceneAddUserAction::G4VisCommandSceneAddUserAction ( )

Definition at line 2433 of file G4VisCommandsSceneAdd.cc.

2433 {
2434 G4bool omitable;
2435 fpCommand = new G4UIcmdWithAString("/vis/scene/add/userAction",this);
2436 fpCommand -> SetGuidance
2437 ("Add named Vis User Action to current scene.");
2438 fpCommand -> SetGuidance
2439 ("Attempts to match search string to name of action - use unique sub-string.");
2440 fpCommand -> SetGuidance
2441 ("(Use /vis/list to see names of registered actions.)");
2442 fpCommand -> SetGuidance
2443 ("If name == \"all\" (default), all actions are added.");
2444 fpCommand -> SetParameterName("action-name", omitable = true);
2445 fpCommand -> SetDefaultValue("all");
2446}
bool G4bool
Definition: G4Types.hh:67

◆ ~G4VisCommandSceneAddUserAction()

G4VisCommandSceneAddUserAction::~G4VisCommandSceneAddUserAction ( )
virtual

Definition at line 2448 of file G4VisCommandsSceneAdd.cc.

2448 {
2449 delete fpCommand;
2450}

Member Function Documentation

◆ GetCurrentValue()

G4String G4VisCommandSceneAddUserAction::GetCurrentValue ( G4UIcommand command)
virtual

Reimplemented from G4UImessenger.

Definition at line 2452 of file G4VisCommandsSceneAdd.cc.

2452 {
2453 return "";
2454}

◆ SetNewValue()

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

Reimplemented from G4UImessenger.

Definition at line 2456 of file G4VisCommandsSceneAdd.cc.

2457 {
2458
2460
2462 if (!pScene) {
2463 if (verbosity >= G4VisManager::errors) {
2464 G4cout << "ERROR: No current scene. Please create one." << G4endl;
2465 }
2466 return;
2467 }
2468
2469 G4bool any = false;
2470
2471 const std::vector<G4VisManager::UserVisAction>& runDurationUserVisActions =
2473 for (size_t i = 0; i < runDurationUserVisActions.size(); i++) {
2474 const G4String& name = runDurationUserVisActions[i].fName;
2475 G4VUserVisAction* visAction = runDurationUserVisActions[i].fpUserVisAction;
2476 if (newValue == "all" || name.find(newValue) != std::string::npos) {
2477 any = true;
2478 AddVisAction(name,visAction,pScene,runDuration,verbosity);
2479 }
2480 }
2481
2482 const std::vector<G4VisManager::UserVisAction>& endOfEventUserVisActions =
2484 for (size_t i = 0; i < endOfEventUserVisActions.size(); i++) {
2485 const G4String& name = endOfEventUserVisActions[i].fName;
2486 G4VUserVisAction* visAction = endOfEventUserVisActions[i].fpUserVisAction;
2487 if (newValue == "all" || name.find(newValue) != std::string::npos) {
2488 any = true;
2489 AddVisAction(name,visAction,pScene,endOfEvent,verbosity);
2490 }
2491 }
2492
2493 const std::vector<G4VisManager::UserVisAction>& endOfRunUserVisActions =
2495 for (size_t i = 0; i < endOfRunUserVisActions.size(); i++) {
2496 const G4String& name = endOfRunUserVisActions[i].fName;
2497 G4VUserVisAction* visAction = endOfRunUserVisActions[i].fpUserVisAction;
2498 if (newValue == "all" || name.find(newValue) != std::string::npos) {
2499 any = true;
2500 AddVisAction(name,visAction,pScene,endOfRun,verbosity);
2501 }
2502 }
2503
2504 if (!any) {
2505 if (verbosity >= G4VisManager::warnings) {
2506 G4cout << "WARNING: No User Vis Action registered." << G4endl;
2507 }
2508 return;
2509 }
2510
2511 const G4String& currentSceneName = pScene -> GetName ();
2512 UpdateVisManagerScene (currentSceneName);
2513}
#define G4endl
Definition: G4ios.hh:52
G4DLLIMPORT std::ostream G4cout
static G4VisManager * fpVisManager
void UpdateVisManagerScene(const G4String &sceneName="")
G4Scene * GetCurrentScene() const
const std::vector< UserVisAction > & GetRunDurationUserVisActions() const
const std::vector< UserVisAction > & GetEndOfRunUserVisActions() const
const std::vector< UserVisAction > & GetEndOfEventUserVisActions() const
static Verbosity GetVerbosity()

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