Geant4  10.02.p03
G02DetectorMessenger Class Reference

Detector messenger class used in GDML read/write example. More...

#include <G02DetectorMessenger.hh>

Inheritance diagram for G02DetectorMessenger:
Collaboration diagram for G02DetectorMessenger:

Public Member Functions

 G02DetectorMessenger (G02DetectorConstruction *)
 
 ~G02DetectorMessenger ()
 
virtual void SetNewValue (G4UIcommand *, G4String)
 
- Public Member Functions inherited from G4UImessenger
 G4UImessenger ()
 
 G4UImessenger (const G4String &path, const G4String &dsc, G4bool commandsToBeBroadcasted=true)
 
virtual ~G4UImessenger ()
 
virtual G4String GetCurrentValue (G4UIcommand *command)
 
G4bool operator== (const G4UImessenger &messenger) const
 
G4bool CommandsShouldBeInMaster () const
 

Private Attributes

G02DetectorConstructionfTheDetector
 
G4UIdirectoryfTheDetectorDir
 
G4UIcmdWithAStringfTheReadCommand
 
G4UIcmdWithAStringfTheWriteCommand
 
G4UIcmdWithAStringfTheStepCommand
 

Additional Inherited Members

- 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, G4bool commandsToBeBroadcasted=true)
 
template<typename T >
T * CreateCommand (const G4String &cname, const G4String &dsc)
 
- Protected Attributes inherited from G4UImessenger
G4UIdirectorybaseDir
 
G4String baseDirName
 
G4bool commandsShouldBeInMaster
 

Detailed Description

Detector messenger class used in GDML read/write example.

Definition at line 53 of file G02DetectorMessenger.hh.

Constructor & Destructor Documentation

◆ G02DetectorMessenger()

G02DetectorMessenger::G02DetectorMessenger ( G02DetectorConstruction myDet)

Definition at line 46 of file G02DetectorMessenger.cc.

47  : G4UImessenger(),
48  fTheDetector( myDet ),
49  fTheDetectorDir(0),
50  fTheReadCommand(0),
53 {
54  fTheDetectorDir = new G4UIdirectory( "/mydet/" );
55  fTheDetectorDir->SetGuidance("Detector control.");
56 
57  fTheReadCommand = new G4UIcmdWithAString("/mydet/readFile", this);
58  fTheReadCommand ->SetGuidance("READ GDML file with given name");
59  fTheReadCommand ->SetParameterName("FileRead", false);
60  fTheReadCommand ->SetDefaultValue("test.gdml");
62 
63  fTheWriteCommand = new G4UIcmdWithAString("/mydet/writeFile", this);
64  fTheWriteCommand ->SetGuidance("WRITE geometry to GDML file with given name");
65  fTheWriteCommand ->SetParameterName("FileWrite", false);
66  fTheWriteCommand ->SetDefaultValue("wtest.gdml");
68 
69  fTheStepCommand = new G4UIcmdWithAString("/mydet/StepFile", this);
70  fTheStepCommand ->SetGuidance("Read STEP Tools files (name without extension)");
71  fTheStepCommand ->SetParameterName("STEPFile", false);
74 }
void SetParameterName(const char *theName, G4bool omittable, G4bool currentAsDefault=false)
G02DetectorConstruction * fTheDetector
G4UIcmdWithAString * fTheStepCommand
void SetGuidance(const char *aGuidance)
Definition: G4UIcommand.hh:161
void AvailableForStates(G4ApplicationState s1)
Definition: G4UIcommand.cc:239
G4UIdirectory * fTheDetectorDir
void SetDefaultValue(const char *defVal)
G4UIcmdWithAString * fTheReadCommand
G4UIcmdWithAString * fTheWriteCommand
Here is the call graph for this function:

◆ ~G02DetectorMessenger()

G02DetectorMessenger::~G02DetectorMessenger ( )

Definition at line 78 of file G02DetectorMessenger.cc.

79 {
80  delete fTheReadCommand;
81  delete fTheWriteCommand;
82  delete fTheStepCommand;
83  delete fTheDetectorDir;
84 }
G4UIcmdWithAString * fTheStepCommand
G4UIdirectory * fTheDetectorDir
G4UIcmdWithAString * fTheReadCommand
G4UIcmdWithAString * fTheWriteCommand

Member Function Documentation

◆ SetNewValue()

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

Reimplemented from G4UImessenger.

Definition at line 88 of file G02DetectorMessenger.cc.

89 {
90  if ( command == fTheReadCommand )
91  {
92  fTheDetector->SetReadFile(newValue );
93  }
94  if ( command == fTheWriteCommand )
95  {
96  fTheDetector->SetWriteFile(newValue );
97  }
98  if ( command == fTheStepCommand )
99  {
100  fTheDetector->SetStepFile(newValue );
101  }
102 }
void SetWriteFile(const G4String &File)
G02DetectorConstruction * fTheDetector
G4UIcmdWithAString * fTheStepCommand
void SetReadFile(const G4String &File)
void SetStepFile(const G4String &File)
G4UIcmdWithAString * fTheReadCommand
G4UIcmdWithAString * fTheWriteCommand
Here is the call graph for this function:

Member Data Documentation

◆ fTheDetector

G02DetectorConstruction* G02DetectorMessenger::fTheDetector
private

Definition at line 65 of file G02DetectorMessenger.hh.

◆ fTheDetectorDir

G4UIdirectory* G02DetectorMessenger::fTheDetectorDir
private

Definition at line 66 of file G02DetectorMessenger.hh.

◆ fTheReadCommand

G4UIcmdWithAString* G02DetectorMessenger::fTheReadCommand
private

Definition at line 67 of file G02DetectorMessenger.hh.

◆ fTheStepCommand

G4UIcmdWithAString* G02DetectorMessenger::fTheStepCommand
private

Definition at line 69 of file G02DetectorMessenger.hh.

◆ fTheWriteCommand

G4UIcmdWithAString* G02DetectorMessenger::fTheWriteCommand
private

Definition at line 68 of file G02DetectorMessenger.hh.


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