00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027 #include "G4UIcmdWithNucleusLimits.hh"
00028 #include <sstream>
00030
00031 G4UIcmdWithNucleusLimits::G4UIcmdWithNucleusLimits
00032 (const char * theCommandPath,G4UImessenger * theMessenger)
00033 :G4UIcommand(theCommandPath,theMessenger)
00034 {
00035 G4UIparameter * intParamAMin = new G4UIparameter('i');
00036 SetParameter(intParamAMin);
00037 G4UIparameter * intParamAMax = new G4UIparameter('i');
00038 SetParameter(intParamAMax);
00039 G4UIparameter * intParamZMin = new G4UIparameter('i');
00040 SetParameter(intParamZMin);
00041 G4UIparameter * intParamZMax = new G4UIparameter('i');
00042 SetParameter(intParamZMax);
00043 }
00044
00046
00047 G4UIcmdWithNucleusLimits::~G4UIcmdWithNucleusLimits()
00048 {
00049 ;
00050 }
00052
00053 G4NucleusLimits G4UIcmdWithNucleusLimits::
00054 GetNewNucleusLimitsValue(G4String paramString)
00055 {
00056 G4int aMin;
00057 G4int aMax;
00058 G4int zMin;
00059 G4int zMax;
00060 std::istringstream is(paramString);
00061 is >> aMin >> aMax >> zMin >> zMax;
00062 return G4NucleusLimits(aMin,aMax,zMin,zMax);
00063 }
00065
00066 G4String G4UIcmdWithNucleusLimits::ConvertToString
00067 (G4NucleusLimits defLimits)
00068 {
00069 std::ostringstream os;
00070 os << defLimits.GetAMin() << " " << defLimits.GetAMax()
00071 << defLimits.GetZMin() << " " << defLimits.GetZMax() ;
00072 G4String vl = os.str();
00073 return vl;
00074 }
00076
00077 void G4UIcmdWithNucleusLimits::SetParameterName
00078 (const char * theNameAMin,const char * theNameAMax,const char * theNameZMin,
00079 const char * theNameZMax,G4bool omittable,G4bool currentAsDefault)
00080 {
00081 G4UIparameter * theParamAMin = GetParameter(0);
00082 theParamAMin->SetParameterName(theNameAMin);
00083 theParamAMin->SetOmittable(omittable);
00084 theParamAMin->SetCurrentAsDefault(currentAsDefault);
00085 G4UIparameter * theParamAMax = GetParameter(1);
00086 theParamAMax->SetParameterName(theNameAMax);
00087 theParamAMax->SetOmittable(omittable);
00088 theParamAMax->SetCurrentAsDefault(currentAsDefault);
00089 G4UIparameter * theParamZMin = GetParameter(2);
00090 theParamZMin->SetParameterName(theNameZMin);
00091 theParamZMin->SetOmittable(omittable);
00092 theParamZMin->SetCurrentAsDefault(currentAsDefault);
00093 G4UIparameter * theParamZMax = GetParameter(3);
00094 theParamZMax->SetParameterName(theNameZMax);
00095 theParamZMax->SetOmittable(omittable);
00096 theParamZMax->SetCurrentAsDefault(currentAsDefault);
00097 }
00099
00100 void G4UIcmdWithNucleusLimits::SetDefaultValue(G4NucleusLimits defLimits)
00101 {
00102 G4UIparameter * theParamAMin = GetParameter(0);
00103 theParamAMin->SetDefaultValue(defLimits.GetAMin());
00104 G4UIparameter * theParamAMax = GetParameter(1);
00105 theParamAMax->SetDefaultValue(defLimits.GetAMax());
00106 G4UIparameter * theParamZMin = GetParameter(2);
00107 theParamZMin->SetDefaultValue(defLimits.GetZMin());
00108 G4UIparameter * theParamZMax = GetParameter(3);
00109 theParamZMax->SetDefaultValue(defLimits.GetZMax());
00110 }
00111
00112
00113
00114
00115
00116