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

#include <exrdmDetectorMessenger.hh>

Inheritance diagram for exrdmDetectorMessenger:
G4UImessenger

Public Member Functions

 exrdmDetectorMessenger (exrdmDetectorConstruction *)
 
virtual ~exrdmDetectorMessenger ()
 
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

Definition at line 46 of file exrdmDetectorMessenger.hh.

Constructor & Destructor Documentation

exrdmDetectorMessenger::exrdmDetectorMessenger ( exrdmDetectorConstruction myDet)

Definition at line 43 of file exrdmDetectorMessenger.cc.

References G4UIcommand::AvailableForStates(), G4State_Idle, G4State_PreInit, G4UIcommand::SetGuidance(), G4UIcmdWithAString::SetParameterName(), G4UIcmdWithADoubleAndUnit::SetParameterName(), and G4UIcmdWithADoubleAndUnit::SetUnitCategory().

44 :G4UImessenger(),
45  fMyDetector(myDet),
46  fExrdmDir(0),
47  fDetDir(0),
48  fTargMatCmd(0),
49  fDetectMatCmd(0),
50  fTargRadiusCmd(0),
51  fDetectThicknessCmd(0),
52  fTargLengthCmd(0),
53  fDetectLengthCmd(0)
54 {
55  fExrdmDir = new G4UIdirectory("/exrdm/");
56  fExrdmDir->SetGuidance("UI commands specific to this example.");
57 
58  fDetDir = new G4UIdirectory("/exrdm/det/");
59  fDetDir->SetGuidance("detector control.");
60 
61  fTargMatCmd = new G4UIcmdWithAString("/exrdm/det/setTargetMate",this);
62  fTargMatCmd->SetGuidance("Select Material of the Target.");
63  fTargMatCmd->SetParameterName("choice",false);
65 
66  fTargRadiusCmd = new G4UIcmdWithADoubleAndUnit("/exrdm/det/setTargetRadius", this);
67  fTargRadiusCmd->SetGuidance("Set the Target Radius.");
68  fTargRadiusCmd->SetUnitCategory("Length");
69  fTargRadiusCmd->SetParameterName("choice",false);
70  fTargRadiusCmd->AvailableForStates(G4State_PreInit);
71 
72  fTargLengthCmd = new G4UIcmdWithADoubleAndUnit("/exrdm/det/setTargetLength", this);
73  fTargLengthCmd->SetGuidance("Set the Target Length.");
74  fTargLengthCmd->SetUnitCategory("Length");
75  fTargLengthCmd->SetParameterName("choice",false);
76  fTargLengthCmd->AvailableForStates(G4State_PreInit);
77 
78  fDetectMatCmd = new G4UIcmdWithAString("/exrdm/det/setDetectorMate",this);
79  fDetectMatCmd->SetGuidance("Select Material of the Detector.");
80  fDetectMatCmd->SetParameterName("choice",false);
82 
83  fDetectThicknessCmd =
84  new G4UIcmdWithADoubleAndUnit("/exrdm/det/setDetectorThickness",this);
85  fDetectThicknessCmd->SetGuidance("Set the Detector Thickness.");
86  fDetectThicknessCmd->SetUnitCategory("Length");
87  fDetectThicknessCmd->SetParameterName("choice",false);
88  fDetectThicknessCmd->AvailableForStates(G4State_PreInit);
89 
90  fDetectLengthCmd =
91  new G4UIcmdWithADoubleAndUnit("/exrdm/det/setDetectorLength",this);
92  fDetectLengthCmd->SetGuidance("Set the Detector Length.");
93  fDetectLengthCmd->SetUnitCategory("Length");
94  fDetectLengthCmd->SetParameterName("choice",false);
95  fDetectLengthCmd->AvailableForStates(G4State_PreInit);
96 }
void SetParameterName(const char *theName, G4bool omittable, G4bool currentAsDefault=false)
void SetUnitCategory(const char *unitCategory)
void SetGuidance(const char *aGuidance)
Definition: G4UIcommand.hh:161
void AvailableForStates(G4ApplicationState s1)
Definition: G4UIcommand.cc:225
void SetParameterName(const char *theName, G4bool omittable, G4bool currentAsDefault=false)
exrdmDetectorMessenger::~exrdmDetectorMessenger ( )
virtual

Definition at line 100 of file exrdmDetectorMessenger.cc.

101 {
102  delete fTargMatCmd;
103  delete fDetectMatCmd;
104  delete fTargRadiusCmd;
105  delete fDetectThicknessCmd;
106  delete fTargLengthCmd;
107  delete fDetectLengthCmd;
108  delete fDetDir;
109  delete fExrdmDir;
110 }

Member Function Documentation

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

Reimplemented from G4UImessenger.

Definition at line 114 of file exrdmDetectorMessenger.cc.

References G4UIcmdWithADoubleAndUnit::GetNewDoubleValue(), exrdmDetectorConstruction::SetDetectorLength(), exrdmDetectorConstruction::SetDetectorMaterial(), exrdmDetectorConstruction::SetDetectorThickness(), exrdmDetectorConstruction::SetTargetLength(), exrdmDetectorConstruction::SetTargetMaterial(), and exrdmDetectorConstruction::SetTargetRadius().

115 {
116  if( command == fTargMatCmd )fMyDetector->SetTargetMaterial(newValue);
117  else if ( command == fTargLengthCmd )
118  fMyDetector->SetTargetLength(fTargLengthCmd->GetNewDoubleValue(newValue));
119  else if ( command == fTargRadiusCmd )
120  fMyDetector->SetTargetRadius(fTargLengthCmd->GetNewDoubleValue(newValue));
121  else if( command == fDetectMatCmd )
122  fMyDetector->SetDetectorMaterial(newValue);
123  else if (command == fDetectLengthCmd )
124  fMyDetector->SetDetectorLength(
125  fDetectLengthCmd->GetNewDoubleValue(newValue));
126  else if (command == fDetectThicknessCmd )
127  fMyDetector->SetDetectorThickness(
128  fDetectThicknessCmd->GetNewDoubleValue(newValue));
129 }
static G4double GetNewDoubleValue(const char *paramString)
void SetDetectorThickness(G4double value)
void SetDetectorLength(G4double value)

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