Geant4  10.03.p03
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
HadrontherapyModulatorMessenger Class Reference

#include <HadrontherapyModulatorMessenger.hh>

Inheritance diagram for HadrontherapyModulatorMessenger:
Collaboration diagram for HadrontherapyModulatorMessenger:

Public Member Functions

 HadrontherapyModulatorMessenger (HadrontherapyModulator *)
 
 ~HadrontherapyModulatorMessenger ()
 
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
 

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

Definition at line 47 of file HadrontherapyModulatorMessenger.hh.

Constructor & Destructor Documentation

HadrontherapyModulatorMessenger::HadrontherapyModulatorMessenger ( HadrontherapyModulator Mod)

Definition at line 44 of file HadrontherapyModulatorMessenger.cc.

45 :Modulator(Mod)
46 
47 {
48  modulatorDir = new G4UIdirectory("/modulator/");
49  modulatorDir -> SetGuidance("Command to change the modulator wheel proprties");
50 
51  modulatorMatCmd = new G4UIcmdWithAString("/modulator/RMWMat",this);
52  modulatorMatCmd -> SetGuidance("Set material of modulatorWheel");
53  modulatorMatCmd -> SetParameterName("Material",false);
54  modulatorMatCmd -> AvailableForStates(G4State_Idle);
55 
56  modulatorExternalFile=new G4UIcmdWithAString("/modulator/ReadData",this);
57  modulatorExternalFile -> SetGuidance("set properties of modulator steps via a external file");
58  modulatorExternalFile -> SetParameterName("FileName",true,false);
59  modulatorExternalFile -> SetDefaultValue ("default");
60  modulatorExternalFile -> AvailableForStates(G4State_Idle);
61 
62  modulatorPositionCmd = new G4UIcmdWith3VectorAndUnit("/modulator/position",this);
63  modulatorPositionCmd -> SetGuidance("Set position of modulato");
64  modulatorPositionCmd -> SetParameterName("PositionAlongX",
65  "PositionAlongY",
66  "PositionAlongZ",false);
67  modulatorPositionCmd -> SetDefaultUnit("mm");
68  modulatorPositionCmd -> SetUnitCandidates("mm cm m");
69  modulatorPositionCmd -> AvailableForStates(G4State_Idle);
70 
71 
72  modulatorOuterRadiusCmd = new G4UIcmdWithADoubleAndUnit("/modulator/outRadius",this);
73  modulatorOuterRadiusCmd -> SetGuidance("Set size of outer radius");
74  modulatorOuterRadiusCmd-> SetParameterName("Size",false);
75  modulatorOuterRadiusCmd -> SetDefaultUnit("mm");
76  modulatorOuterRadiusCmd-> SetUnitCandidates("mm cm m");
77  modulatorOuterRadiusCmd-> AvailableForStates(G4State_Idle);
78 
79  modulatorInnerRadiusCmd = new G4UIcmdWithADoubleAndUnit("/modulator/innerRadius",this);
80  modulatorInnerRadiusCmd -> SetGuidance("Set size of inner radius");
81  modulatorInnerRadiusCmd-> SetParameterName("Size",false);
82  modulatorInnerRadiusCmd -> SetDefaultUnit("mm");
83  modulatorInnerRadiusCmd-> SetUnitCandidates("mm cm m");
84  modulatorInnerRadiusCmd-> AvailableForStates(G4State_Idle);
85 
86  modulatorAngleCmd = new G4UIcmdWithADoubleAndUnit("/modulator/angle",this);
87  modulatorAngleCmd -> SetGuidance("Set Modulator Angle");
88  modulatorAngleCmd -> SetParameterName("Size",false);
89  modulatorAngleCmd -> SetRange("Size>=0.");
90  modulatorAngleCmd -> SetUnitCategory("Angle");
91  modulatorAngleCmd -> AvailableForStates(G4State_Idle);
92 }
HadrontherapyModulatorMessenger::~HadrontherapyModulatorMessenger ( )

Definition at line 94 of file HadrontherapyModulatorMessenger.cc.

95 {
96  delete modulatorAngleCmd;
97  delete modulatorMatCmd;
98  delete modulatorPositionCmd;
99  delete modulatorInnerRadiusCmd;
100  delete modulatorOuterRadiusCmd;
101  delete modulatorDir;
102 }

Member Function Documentation

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

Reimplemented from G4UImessenger.

Definition at line 107 of file HadrontherapyModulatorMessenger.cc.

108 {
109  if( command == modulatorAngleCmd )
110  {Modulator -> SetModulatorAngle
111  (modulatorAngleCmd -> GetNewDoubleValue(newValue));}
112 
113  else if( command == modulatorMatCmd )
114  {Modulator -> SetModulatorMaterial(newValue);}
115 
116  else if (command== modulatorExternalFile)
117  {Modulator->GetDataFromFile(newValue);}
118 
119  else if( command == modulatorPositionCmd )
120  { G4ThreeVector size = modulatorPositionCmd-> GetNew3VectorValue(newValue);
121  Modulator -> SetModulatorPosition(size);}
122 
123  else if( command == modulatorOuterRadiusCmd )
124  { Modulator -> SetModulatorOuterRadius(
125  modulatorOuterRadiusCmd -> GetNewDoubleValue(newValue));}
126 
127  else if( command == modulatorInnerRadiusCmd )
128  { Modulator -> SetModulatorInnerRadius(
129  modulatorInnerRadiusCmd -> GetNewDoubleValue(newValue));}
130 }
void GetDataFromFile(G4String value)

Here is the call graph for this function:


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