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

Messenger class that defines commands for G4FieldBuilder. More...

#include <G4FieldBuilderMessenger.hh>

+ Inheritance diagram for G4FieldBuilderMessenger:

Public Member Functions

 G4FieldBuilderMessenger (G4FieldBuilder *fieldBuilder)
 Standard constructor.
 
 ~G4FieldBuilderMessenger () override
 Destructor.
 
void SetNewValue (G4UIcommand *command, G4String newValues) override
 Apply command to the associated object.
 
- Public Member Functions inherited from G4UImessenger
 G4UImessenger ()=default
 
 G4UImessenger (const G4String &path, const G4String &dsc, G4bool commandsToBeBroadcasted=true)
 
virtual ~G4UImessenger ()
 
virtual G4String GetCurrentValue (G4UIcommand *command)
 
G4bool CommandsShouldBeInMaster () const
 

Additional Inherited Members

- Protected Member Functions inherited from G4UImessenger
G4String ItoS (G4int i)
 
G4String LtoS (G4long l)
 
G4String DtoS (G4double a)
 
G4String BtoS (G4bool b)
 
G4int StoI (const G4String &s)
 
G4long StoL (const G4String &s)
 
G4double StoD (const G4String &s)
 
G4bool StoB (const G4String &s)
 
void AddUIcommand (G4UIcommand *newCommand)
 
void CreateDirectory (const G4String &path, const G4String &dsc, G4bool commandsToBeBroadcasted=true)
 
template<typename T>
T * CreateCommand (const G4String &cname, const G4String &dsc)
 
- Protected Attributes inherited from G4UImessenger
G4UIdirectorybaseDir = nullptr
 
G4String baseDirName = ""
 
G4bool commandsShouldBeInMaster = false
 

Detailed Description

Messenger class that defines commands for G4FieldBuilder.

Implements commands:

  • /field/verboseLevel level
Author
I. Hrivnacova; IJCLab, Orsay

Definition at line 52 of file G4FieldBuilderMessenger.hh.

Constructor & Destructor Documentation

◆ G4FieldBuilderMessenger()

G4FieldBuilderMessenger::G4FieldBuilderMessenger ( G4FieldBuilder * fieldBuilder)

Standard constructor.

Definition at line 48 of file G4FieldBuilderMessenger.cc.

49 : fFieldBuilder(fieldBuilder)
50{
51 // Standard constructor
52
53 G4String directoryName = "/field/";
54 fDirectory = new G4UIdirectory(directoryName);
55 fDirectory->SetGuidance("Magnetic (or other type) field control commands.");
56
57 G4String commandName = std::move(directoryName);
58 commandName.append("verboseLevel");
59 fVerboseLevelCmd = new G4UIcmdWithAnInteger(commandName, this);
60 fVerboseLevelCmd->SetGuidance("Set verbose level");
61 fVerboseLevelCmd->SetParameterName("VerboseLevel", false);
62 // add possible values
63 fVerboseLevelCmd->AvailableForStates(
65}
@ G4State_Init
@ G4State_Idle
@ G4State_PreInit

Referenced by G4FieldBuilderMessenger().

◆ ~G4FieldBuilderMessenger()

G4FieldBuilderMessenger::~G4FieldBuilderMessenger ( )
override

Destructor.

Definition at line 68 of file G4FieldBuilderMessenger.cc.

69{
70 // Destructor
71
72 delete fDirectory;
73 delete fVerboseLevelCmd;
74}

Member Function Documentation

◆ SetNewValue()

void G4FieldBuilderMessenger::SetNewValue ( G4UIcommand * command,
G4String newValues )
overridevirtual

Apply command to the associated object.

Reimplemented from G4UImessenger.

Definition at line 81 of file G4FieldBuilderMessenger.cc.

83{
84 // Apply command to the associated object.
85
86 if (command == fVerboseLevelCmd) {
87 fFieldBuilder->SetVerboseLevel(fVerboseLevelCmd->GetNewIntValue(newValues));
88 return;
89 }
90}

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