G4UIcmdWithNucleusLimits.cc

Go to the documentation of this file.
00001 //
00002 // ********************************************************************
00003 // * License and Disclaimer                                           *
00004 // *                                                                  *
00005 // * The  Geant4 software  is  copyright of the Copyright Holders  of *
00006 // * the Geant4 Collaboration.  It is provided  under  the terms  and *
00007 // * conditions of the Geant4 Software License,  included in the file *
00008 // * LICENSE and available at  http://cern.ch/geant4/license .  These *
00009 // * include a list of copyright holders.                             *
00010 // *                                                                  *
00011 // * Neither the authors of this software system, nor their employing *
00012 // * institutes,nor the agencies providing financial support for this *
00013 // * work  make  any representation or  warranty, express or implied, *
00014 // * regarding  this  software system or assume any liability for its *
00015 // * use.  Please see the license in the file  LICENSE  and URL above *
00016 // * for the full disclaimer and the limitation of liability.         *
00017 // *                                                                  *
00018 // * This  code  implementation is the result of  the  scientific and *
00019 // * technical work of the GEANT4 collaboration.                      *
00020 // * By using,  copying,  modifying or  distributing the software (or *
00021 // * any work based  on the software)  you  agree  to acknowledge its *
00022 // * use  in  resulting  scientific  publications,  and indicate your *
00023 // * acceptance of all terms of the Geant4 Software license.          *
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 

Generated on Mon May 27 17:50:05 2013 for Geant4 by  doxygen 1.4.7