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

#include <G4HumanPhantomMessenger.hh>

Inheritance diagram for G4HumanPhantomMessenger:
G4UImessenger

Public Member Functions

 G4HumanPhantomMessenger (G4HumanPhantomConstruction *myUsrPhtm)
 
 ~G4HumanPhantomMessenger ()
 
void SetNewValue (G4UIcommand *command, G4String newValue)
 
void AddBodyPart (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 48 of file G4HumanPhantomMessenger.hh.

Constructor & Destructor Documentation

G4HumanPhantomMessenger::G4HumanPhantomMessenger ( G4HumanPhantomConstruction myUsrPhtm)

Definition at line 45 of file G4HumanPhantomMessenger.cc.

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

46  :myUserPhantom(myUsrPhtm),bps(false)
47 {
48  phantomDir = new G4UIdirectory("/phantom/");
49  phantomDir->SetGuidance("Set Your Phantom.");
50 
51  bpDir = new G4UIdirectory("/bodypart/");
52  bpDir->SetGuidance("Add Body Part to Phantom");
53 
54  modelCmd = new G4UIcmdWithAString("/phantom/setPhantomModel",this);
55  modelCmd->SetGuidance("Set sex of Phantom: MIRD, ORNLFemale, ORNLMale, MIX, MIRDHead, ORNLHead.");
56  modelCmd->SetParameterName("phantomModel",true);
57  modelCmd->SetDefaultValue("MIRD");
58  modelCmd->SetCandidates("MIRD ORNLFemale ORNLMale MIX MIRDHead ORNLHead");
60 
61  sexCmd = new G4UIcmdWithAString("/phantom/setPhantomSex",this);
62  sexCmd->SetGuidance("Set sex of Phantom: Male or Female.");
63  sexCmd->SetParameterName("phantomSex",true);
64  sexCmd->SetDefaultValue("Female");
65  sexCmd->SetCandidates("Male Female");
67 
68  bodypartCmd = new G4UIcmdWithAString("/bodypart/addBodyPart",this);
69  bodypartCmd->SetGuidance("Add a Body Part to Phantom");
70  bodypartCmd->SetParameterName("bpName",true);
72 
73  endCmd = new G4UIcmdWithoutParameter("/phantom/buildNewPhantom",this);
74  endCmd->SetGuidance("Build your Phantom.");
76 
77 }
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)
void SetCandidates(const char *candidateList)
G4HumanPhantomMessenger::~G4HumanPhantomMessenger ( )

Definition at line 79 of file G4HumanPhantomMessenger.cc.

80 {
81  delete modelCmd;
82  delete sexCmd;
83  delete bodypartCmd;
84  delete endCmd;
85  delete phantomDir;
86  delete bpDir;
87 }

Member Function Documentation

void G4HumanPhantomMessenger::AddBodyPart ( G4String  newBodyPartSensitivity)

Definition at line 111 of file G4HumanPhantomMessenger.cc.

References G4cout, G4endl, and G4HumanPhantomConstruction::SetBodyPartSensitivity().

Referenced by SetNewValue().

112 {
113 
114  char* str = new char[newBodyPartSensitivity.length()+1];
115 
116  strcpy(str, newBodyPartSensitivity.c_str());
117 
118  std::string bpart = strtok(str," ");
119 
120  std::string sensitivity = strtok(NULL," ");
121 
122  if(sensitivity=="yes"){
123  bps=true;
124  }else{
125  bps=false;
126  }
127 
128  G4cout << " >>> Body Part = " << bpart << "\n"
129  << " >>> Sensitivity = " << sensitivity << G4endl;
130 
131  myUserPhantom->SetBodyPartSensitivity(bpart,bps);
132 }
G4GLOB_DLL std::ostream G4cout
void SetBodyPartSensitivity(G4String, G4bool)
#define G4endl
Definition: G4ios.hh:61
void G4HumanPhantomMessenger::SetNewValue ( G4UIcommand command,
G4String  newValue 
)
virtual

Reimplemented from G4UImessenger.

Definition at line 89 of file G4HumanPhantomMessenger.cc.

References AddBodyPart(), G4cout, G4endl, G4HumanPhantomConstruction::SetPhantomModel(), and G4HumanPhantomConstruction::SetPhantomSex().

89  {
90 
91  if( command == modelCmd )
92  {
93  myUserPhantom->SetPhantomModel(newValue);
94  }
95  if( command == sexCmd )
96  {
97  myUserPhantom->SetPhantomSex(newValue);
98  }
99  if( command == bodypartCmd )
100  {
101  AddBodyPart(newValue);
102  }
103  if( command == endCmd )
104  {
105  G4cout <<
106  " ****************>>>> NEW PHANTOM CONSTRUCTION <<<<***************** "
107  << G4endl;
108  }
109 }
G4GLOB_DLL std::ostream G4cout
#define G4endl
Definition: G4ios.hh:61

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