#include <G4GenericMessenger.hh>
Inheritance diagram for G4GenericMessenger::Command:
Definition at line 59 of file G4GenericMessenger.hh.
G4GenericMessenger::Command::Command | ( | G4UIcommand * | cmd, | |
const std::type_info & | ti | |||
) | [inline] |
G4GenericMessenger::Command::Command | ( | ) | [inline] |
G4GenericMessenger::Command & G4GenericMessenger::Command::SetCandidates | ( | const G4String & | ) |
Definition at line 182 of file G4GenericMessenger.cc.
References command, G4UIcommand::GetParameter(), and G4UIparameter::SetParameterCandidates().
00182 { 00183 G4UIparameter * theParam = command->GetParameter(0); 00184 theParam->SetParameterCandidates(candList); 00185 return *this; 00186 }
Definition at line 73 of file G4GenericMessenger.hh.
References SetUnit(), and UnitDefault.
00073 {return SetUnit(u, UnitDefault);}
G4GenericMessenger::Command & G4GenericMessenger::Command::SetDefaultValue | ( | const G4String & | ) |
Definition at line 188 of file G4GenericMessenger.cc.
References command, G4UIcommand::GetParameter(), and G4UIparameter::SetDefaultValue().
00188 { 00189 G4UIparameter * theParam = command->GetParameter(0); 00190 theParam->SetDefaultValue(defVal); 00191 return *this; 00192 }
Definition at line 70 of file G4GenericMessenger.hh.
References command, and G4UIcommand::SetGuidance().
00070 { command->SetGuidance(s); return *this; }
G4GenericMessenger::Command & G4GenericMessenger::Command::SetParameterName | ( | const G4String & | , | |
G4bool | , | |||
G4bool | = false | |||
) |
Definition at line 174 of file G4GenericMessenger.cc.
References command, G4UIcommand::GetParameter(), G4UIparameter::SetCurrentAsDefault(), G4UIparameter::SetOmittable(), and G4UIparameter::SetParameterName().
00174 { 00175 G4UIparameter* theParam = command->GetParameter(0); 00176 theParam->SetParameterName(name); 00177 theParam->SetOmittable(omittable); 00178 theParam->SetCurrentAsDefault(currentAsDefault); 00179 return *this; 00180 }
Definition at line 69 of file G4GenericMessenger.hh.
References command, and G4UIcommand::SetRange().
Command& G4GenericMessenger::Command::SetStates | ( | G4ApplicationState | s0, | |
G4ApplicationState | s1, | |||
G4ApplicationState | s2, | |||
G4ApplicationState | s3, | |||
G4ApplicationState | s4 | |||
) | [inline] |
Definition at line 68 of file G4GenericMessenger.hh.
References G4UIcommand::AvailableForStates(), and command.
00068 {command->AvailableForStates(s0,s1,s2,s3,s4); return *this;}
Command& G4GenericMessenger::Command::SetStates | ( | G4ApplicationState | s0, | |
G4ApplicationState | s1, | |||
G4ApplicationState | s2, | |||
G4ApplicationState | s3 | |||
) | [inline] |
Definition at line 67 of file G4GenericMessenger.hh.
References G4UIcommand::AvailableForStates(), and command.
00067 {command->AvailableForStates(s0,s1,s2,s3); return *this;}
Command& G4GenericMessenger::Command::SetStates | ( | G4ApplicationState | s0, | |
G4ApplicationState | s1, | |||
G4ApplicationState | s2 | |||
) | [inline] |
Definition at line 66 of file G4GenericMessenger.hh.
References G4UIcommand::AvailableForStates(), and command.
00066 {command->AvailableForStates(s0,s1,s2); return *this;}
Command& G4GenericMessenger::Command::SetStates | ( | G4ApplicationState | s0, | |
G4ApplicationState | s1 | |||
) | [inline] |
Definition at line 65 of file G4GenericMessenger.hh.
References G4UIcommand::AvailableForStates(), and command.
00065 {command->AvailableForStates(s0, s1); return *this;}
Command& G4GenericMessenger::Command::SetStates | ( | G4ApplicationState | s0 | ) | [inline] |
Definition at line 64 of file G4GenericMessenger.hh.
References G4UIcommand::AvailableForStates(), and command.
00064 {command->AvailableForStates(s0); return *this;}
G4GenericMessenger::Command & G4GenericMessenger::Command::SetUnit | ( | const G4String & | , | |
UnitSpec | = UnitDefault | |||
) |
Definition at line 140 of file G4GenericMessenger.cc.
References command, G4cerr, G4endl, G4UIcommand::GetCommandPath(), G4UIcommand::GetGuidanceEntries(), G4UIcommand::GetGuidanceLine(), G4UIcommand::GetMessenger(), G4UIcommand::GetRange(), G4UIcmdWith3VectorAndUnit::SetDefaultUnit(), G4UIcmdWithADoubleAndUnit::SetDefaultUnit(), G4UIcommand::SetGuidance(), G4UIcommand::SetRange(), G4UIcmdWith3VectorAndUnit::SetUnitCategory(), G4UIcmdWithADoubleAndUnit::SetUnitCategory(), type, UnitCategory, and UnitDefault.
Referenced by SetDefaultUnit(), and SetUnitCategory().
00140 { 00141 // Change the type of command (unfortunatelly this is done a posteriory) 00142 // We need to delete the old command before creating the new one and therefore we need to recover the information 00143 // before the deletetion 00144 G4String cmdpath = command->GetCommandPath(); 00145 G4UImessenger* messenger = command->GetMessenger(); 00146 G4String range = command->GetRange(); 00147 std::vector<G4String> guidance; 00148 for (G4int i = 0; i < command->GetGuidanceEntries(); i++) guidance.push_back(command->GetGuidanceLine(i)); 00149 // Before deleting the command we need to add a fake one to avoid deleting the directory entry and with its guidance 00150 G4UIcommand tmp((cmdpath+"_tmp").c_str(), messenger); 00151 delete command; 00152 00153 if (*type == typeid(float) || *type == typeid(double) ) { 00154 G4UIcmdWithADoubleAndUnit* cmd_t = new G4UIcmdWithADoubleAndUnit(cmdpath, messenger); 00155 if(spec == UnitDefault) cmd_t->SetDefaultUnit(unit); 00156 else if(spec == UnitCategory) cmd_t->SetUnitCategory(unit); 00157 command = cmd_t; 00158 } 00159 else if (*type == typeid(G4ThreeVector)) { 00160 G4UIcmdWith3VectorAndUnit* cmd_t = new G4UIcmdWith3VectorAndUnit(cmdpath, messenger); 00161 if(spec == UnitDefault) cmd_t->SetDefaultUnit(unit); 00162 else if(spec == UnitCategory) cmd_t->SetUnitCategory(unit); 00163 command = cmd_t; 00164 } 00165 else { 00166 G4cerr << "Only parameters of type <double> or <float> can be associated with units" << G4endl; 00167 return *this; 00168 } 00169 for (size_t i = 0; i < guidance.size(); i++) command->SetGuidance(guidance[i]); 00170 command->SetRange(range); 00171 return *this; 00172 }
Definition at line 72 of file G4GenericMessenger.hh.
References SetUnit(), and UnitCategory.
00072 {return SetUnit(u, UnitCategory);}
Definition at line 78 of file G4GenericMessenger.hh.
Referenced by SetCandidates(), SetDefaultValue(), SetGuidance(), SetParameterName(), SetRange(), SetStates(), and SetUnit().
const std::type_info* G4GenericMessenger::Command::type |