Geant4.10
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions
G02DetectorMessenger Class Reference

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

#include <G02DetectorMessenger.hh>

Inheritance diagram for G02DetectorMessenger:
G4UImessenger

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
 

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
 

Detailed Description

Detector messenger class used in GDML read/write example.

Definition at line 53 of file G02DetectorMessenger.hh.

Constructor & Destructor Documentation

G02DetectorMessenger::G02DetectorMessenger ( G02DetectorConstruction myDet)

Definition at line 46 of file G02DetectorMessenger.cc.

References G4UIcommand::AvailableForStates(), G4State_PreInit, G4UIcmdWithAString::SetDefaultValue(), G4UIcommand::SetGuidance(), and G4UIcmdWithAString::SetParameterName().

47  : G4UImessenger(),
48  fTheDetector( myDet ),
49  fTheDetectorDir(0),
50  fTheReadCommand(0),
51  fTheWriteCommand(0),
52  fTheStepCommand(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");
61  fTheReadCommand ->AvailableForStates(G4State_PreInit);
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");
67  fTheWriteCommand ->AvailableForStates(G4State_PreInit);
68 
69  fTheStepCommand = new G4UIcmdWithAString("/mydet/StepFile", this);
70  fTheStepCommand ->SetGuidance("Read STEP Tools files (name without extension)");
71  fTheStepCommand ->SetParameterName("STEPFile", false);
72  fTheStepCommand ->SetDefaultValue("mbb");
73  fTheStepCommand ->AvailableForStates(G4State_PreInit);
74 }
void SetParameterName(const char *theName, G4bool omittable, G4bool currentAsDefault=false)
void SetGuidance(const char *aGuidance)
Definition: G4UIcommand.hh:161
void AvailableForStates(G4ApplicationState s1)
Definition: G4UIcommand.cc:225
void SetDefaultValue(const char *defVal)
G02DetectorMessenger::~G02DetectorMessenger ( )

Definition at line 78 of file G02DetectorMessenger.cc.

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

Member Function Documentation

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

Reimplemented from G4UImessenger.

Definition at line 88 of file G02DetectorMessenger.cc.

References G02DetectorConstruction::SetReadFile(), G02DetectorConstruction::SetStepFile(), and G02DetectorConstruction::SetWriteFile().

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)
void SetReadFile(const G4String &File)
void SetStepFile(const G4String &File)

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