G4UIcommand Class Reference

#include <G4UIcommand.hh>

Inheritance diagram for G4UIcommand:

G4UIcmdWith3Vector G4UIcmdWith3VectorAndUnit G4UIcmdWithABool G4UIcmdWithADouble G4UIcmdWithADoubleAndUnit G4UIcmdWithAnInteger G4UIcmdWithAString G4UIcmdWithNucleusLimits G4UIcmdWithoutParameter G4UIdirectory

Public Member Functions

 G4UIcommand ()
 G4UIcommand (const char *theCommandPath, G4UImessenger *theMessenger)
virtual ~G4UIcommand ()
G4int operator== (const G4UIcommand &right) const
G4int operator!= (const G4UIcommand &right) const
virtual G4int DoIt (G4String parameterList)
G4String GetCurrentValue ()
void AvailableForStates (G4ApplicationState s1)
void AvailableForStates (G4ApplicationState s1, G4ApplicationState s2)
void AvailableForStates (G4ApplicationState s1, G4ApplicationState s2, G4ApplicationState s3)
void AvailableForStates (G4ApplicationState s1, G4ApplicationState s2, G4ApplicationState s3, G4ApplicationState s4)
void AvailableForStates (G4ApplicationState s1, G4ApplicationState s2, G4ApplicationState s3, G4ApplicationState s4, G4ApplicationState s5)
G4bool IsAvailable ()
virtual void List ()
void SetRange (const char *rs)
const G4StringGetRange () const
G4int GetGuidanceEntries () const
const G4StringGetGuidanceLine (G4int i) const
const G4StringGetCommandPath () const
const G4StringGetCommandName () const
G4int GetParameterEntries () const
G4UIparameterGetParameter (G4int i) const
std::vector< G4ApplicationState > * GetStateList ()
G4UImessengerGetMessenger () const
void SetParameter (G4UIparameter *const newParameter)
void SetGuidance (const char *aGuidance)
const G4String GetTitle () const

Static Public Member Functions

static G4String ConvertToString (G4bool boolVal)
static G4String ConvertToString (G4int intValue)
static G4String ConvertToString (G4double doubleValue)
static G4String ConvertToString (G4double doubleValue, const char *unitName)
static G4String ConvertToString (G4ThreeVector vec)
static G4String ConvertToString (G4ThreeVector vec, const char *unitName)
static G4bool ConvertToBool (const char *st)
static G4int ConvertToInt (const char *st)
static G4double ConvertToDouble (const char *st)
static G4double ConvertToDimensionedDouble (const char *st)
static G4ThreeVector ConvertTo3Vector (const char *st)
static G4ThreeVector ConvertToDimensioned3Vector (const char *st)
static G4double ValueOf (const char *unitName)
static G4String CategoryOf (const char *unitName)
static G4String UnitsList (const char *unitCategory)

Protected Member Functions

G4int CheckNewValue (const char *newValue)

Detailed Description

Definition at line 51 of file G4UIcommand.hh.


Constructor & Destructor Documentation

G4UIcommand::G4UIcommand (  ) 

Definition at line 41 of file G4UIcommand.cc.

00042   : messenger(0), bp(0), token(IDENTIFIER), paramERR(0)
00043 {
00044 }

G4UIcommand::G4UIcommand ( const char *  theCommandPath,
G4UImessenger theMessenger 
)

Definition at line 46 of file G4UIcommand.cc.

References G4cerr, G4endl, G4State_Abort, G4State_EventProc, G4State_GeomClosed, G4State_Idle, G4State_Init, and G4State_PreInit.

00048 :messenger(theMessenger),token(IDENTIFIER),paramERR(0)
00049 {
00050   G4String comStr = theCommandPath;
00051   if(!theMessenger)
00052   { // this must be a directory
00053     if(comStr(comStr.length()-1)!='/')
00054     {
00055       G4cerr << "G4UIcommand Warning : " << G4endl;
00056       G4cerr << "  <" << theCommandPath << "> must be a directory." << G4endl;
00057       G4cerr << "  '/' is appended." << G4endl;
00058       comStr += "/";
00059     }
00060   }
00061   G4UIcommandCommonConstructorCode (comStr);
00062   G4String nullString;
00063   availabelStateList.clear();
00064   availabelStateList.push_back(G4State_PreInit);
00065   availabelStateList.push_back(G4State_Init);
00066   availabelStateList.push_back(G4State_Idle);
00067   availabelStateList.push_back(G4State_GeomClosed);
00068   availabelStateList.push_back(G4State_EventProc);
00069   availabelStateList.push_back(G4State_Abort);
00070 }

G4UIcommand::~G4UIcommand (  )  [virtual]

Definition at line 83 of file G4UIcommand.cc.

References G4UImanager::GetUIpointer(), and G4UImanager::RemoveCommand().

00084 {
00085   G4UImanager* fUImanager = G4UImanager::GetUIpointer();
00086   if(fUImanager) fUImanager->RemoveCommand(this);
00087   
00088   G4int n_parameterEntry = parameter.size();
00089   for( G4int i_thParameter=0; i_thParameter < n_parameterEntry; i_thParameter++ )
00090   { delete parameter[i_thParameter]; }
00091   parameter.clear();
00092 }


Member Function Documentation

void G4UIcommand::AvailableForStates ( G4ApplicationState  s1,
G4ApplicationState  s2,
G4ApplicationState  s3,
G4ApplicationState  s4,
G4ApplicationState  s5 
)

Definition at line 255 of file G4UIcommand.cc.

00260 {
00261   availabelStateList.clear();
00262   availabelStateList.push_back(s1);
00263   availabelStateList.push_back(s2);
00264   availabelStateList.push_back(s3);
00265   availabelStateList.push_back(s4);
00266   availabelStateList.push_back(s5);
00267 }

void G4UIcommand::AvailableForStates ( G4ApplicationState  s1,
G4ApplicationState  s2,
G4ApplicationState  s3,
G4ApplicationState  s4 
)

Definition at line 243 of file G4UIcommand.cc.

00247 {
00248   availabelStateList.clear();
00249   availabelStateList.push_back(s1);
00250   availabelStateList.push_back(s2);
00251   availabelStateList.push_back(s3);
00252   availabelStateList.push_back(s4);
00253 }

void G4UIcommand::AvailableForStates ( G4ApplicationState  s1,
G4ApplicationState  s2,
G4ApplicationState  s3 
)

Definition at line 233 of file G4UIcommand.cc.

00236 {
00237   availabelStateList.clear();
00238   availabelStateList.push_back(s1);
00239   availabelStateList.push_back(s2);
00240   availabelStateList.push_back(s3);
00241 }

void G4UIcommand::AvailableForStates ( G4ApplicationState  s1,
G4ApplicationState  s2 
)

Definition at line 225 of file G4UIcommand.cc.

00227 {
00228   availabelStateList.clear();
00229   availabelStateList.push_back(s1);
00230   availabelStateList.push_back(s2);
00231 }

void G4UIcommand::AvailableForStates ( G4ApplicationState  s1  ) 

Definition at line 219 of file G4UIcommand.cc.

Referenced by G4QMessenger::Add(), G4AdjointSimMessenger::G4AdjointSimMessenger(), G4AnalysisMessenger::G4AnalysisMessenger(), G4EmMessenger::G4EmMessenger(), G4EmQMessenger::G4EmQMessenger(), G4EnergyLossMessenger::G4EnergyLossMessenger(), G4ErrorMessenger::G4ErrorMessenger(), G4EvManMessenger::G4EvManMessenger(), G4FastSimulationMessenger::G4FastSimulationMessenger(), G4GDMLMessenger::G4GDMLMessenger(), G4GeometryMessenger::G4GeometryMessenger(), G4GMocrenMessenger::G4GMocrenMessenger(), G4MatScanMessenger::G4MatScanMessenger(), G4NeutronKillerMessenger::G4NeutronKillerMessenger(), G4OpticalPhysicsMessenger::G4OpticalPhysicsMessenger(), G4ParticleMessenger::G4ParticleMessenger(), G4ParticlePropertyMessenger::G4ParticlePropertyMessenger(), G4PolarizationMessenger::G4PolarizationMessenger(), G4ProcessManagerMessenger::G4ProcessManagerMessenger(), G4ProcessTableMessenger::G4ProcessTableMessenger(), G4ProductionCutsTableMessenger::G4ProductionCutsTableMessenger(), G4RunMessenger::G4RunMessenger(), G4StackingMessenger::G4StackingMessenger(), G4UserPhysicsListMessenger::G4UserPhysicsListMessenger(), GFlashShowerModelMessenger::GFlashShowerModelMessenger(), and G4GenericMessenger::Command::SetStates().

00220 {
00221   availabelStateList.clear();
00222   availabelStateList.push_back(s1);
00223 }

G4String G4UIcommand::CategoryOf ( const char *  unitName  )  [static]

Definition at line 295 of file G4UIcommand.cc.

References G4UnitDefinition::GetCategory().

Referenced by G4UIcmdWithADoubleAndUnit::ConvertToStringWithBestUnit(), G4UIcmdWith3VectorAndUnit::ConvertToStringWithBestUnit(), G4EnergyLossMessenger::G4EnergyLossMessenger(), G4MatScanMessenger::G4MatScanMessenger(), G4UserPhysicsListMessenger::G4UserPhysicsListMessenger(), G4UIcmdWithADoubleAndUnit::SetDefaultUnit(), and G4UIcmdWith3VectorAndUnit::SetDefaultUnit().

00296 {
00297    return G4UnitDefinition::GetCategory(unitName);
00298 }

G4int G4UIcommand::CheckNewValue ( const char *  newValue  )  [protected]

Definition at line 474 of file G4UIcommand.cc.

References fParameterOutOfRange, and G4String::isNull().

Referenced by DoIt().

00475 {
00476    yystype result;
00477    // if( TypeCheck(newValue) == 0 ) return 1;
00478    if( ! rangeString.isNull() )
00479    { if( RangeCheck(newValue) == 0 ) return fParameterOutOfRange; }
00480    return 0;  // succeeded
00481 }

G4ThreeVector G4UIcommand::ConvertTo3Vector ( const char *  st  )  [static]

Definition at line 441 of file G4UIcommand.cc.

Referenced by G4UIcmdWith3Vector::GetNew3VectorValue(), G4VisCommandsViewerSet::SetNewValue(), and G4AttCheck::Standard().

00442 {
00443   G4double vx;
00444   G4double vy;
00445   G4double vz;
00446   std::istringstream is(st);
00447   is >> vx >> vy >> vz;
00448   return G4ThreeVector(vx,vy,vz);
00449 }

G4bool G4UIcommand::ConvertToBool ( const char *  st  )  [static]

Definition at line 403 of file G4UIcommand.cc.

References G4String::toUpper().

Referenced by G4UIcmdWithABool::GetNewBoolValue(), G4VisCommandsViewerSet::SetNewValue(), G4VisCommandViewerDefaultHiddenEdge::SetNewValue(), G4VisCommandsTouchableSet::SetNewValue(), G4VisCommandSceneAddLogicalVolume::SetNewValue(), G4VisCommandSceneActivateModel::SetNewValue(), G4VisCommandGeometrySetVisibility::SetNewValue(), G4VisCommandGeometrySetForceWireframe::SetNewValue(), G4VisCommandGeometrySetForceSolid::SetNewValue(), G4VisCommandGeometrySetForceAuxEdgeVisible::SetNewValue(), G4VisCommandGeometrySetDaughtersInvisible::SetNewValue(), G4VisCommandEnable::SetNewValue(), G4VisCommandAbortReviewKeptEvents::SetNewValue(), and G4AnalysisMessenger::SetNewValue().

00404 {
00405   G4String v = st;
00406   v.toUpper();
00407   G4bool vl = false;
00408   if( v=="Y" || v=="YES" || v=="1" || v=="T" || v=="TRUE" )
00409   { vl = true; }
00410   return vl;
00411 }

G4ThreeVector G4UIcommand::ConvertToDimensioned3Vector ( const char *  st  )  [static]

Definition at line 451 of file G4UIcommand.cc.

References ValueOf().

Referenced by G4UIcmdWith3VectorAndUnit::GetNew3VectorValue(), G4GenericMessenger::SetNewValue(), and G4AttCheck::Standard().

00452 {
00453   G4double vx;
00454   G4double vy;
00455   G4double vz;
00456   char unts[30];
00457   std::istringstream is(st);
00458   is >> vx >> vy >> vz >> unts;
00459   G4String unt = unts;
00460   G4double uv = ValueOf(unt);
00461   return G4ThreeVector(vx*uv,vy*uv,vz*uv);
00462 }

G4double G4UIcommand::ConvertToDimensionedDouble ( const char *  st  )  [static]

Definition at line 429 of file G4UIcommand.cc.

References ValueOf().

Referenced by G4UIcmdWithADoubleAndUnit::GetNewDoubleValue(), G4TrajectoryDrawerUtils::GetPointsAndTimes(), G4GenericMessenger::SetNewValue(), and G4AttCheck::Standard().

00430 {
00431   G4double vl;
00432   char unts[30];
00433 
00434   std::istringstream is(st);
00435   is >> vl >> unts;
00436   G4String unt = unts;
00437 
00438   return (vl*ValueOf(unt));
00439 }

G4double G4UIcommand::ConvertToDouble ( const char *  st  )  [static]

Definition at line 421 of file G4UIcommand.cc.

Referenced by G4UIcmdWithADoubleAndUnit::DoIt(), G4UIcmdWith3VectorAndUnit::DoIt(), G4UIcmdWithADouble::GetNewDoubleValue(), G4VisCommandsTouchableSet::SetNewValue(), G4VisCommandSetTextColour::SetNewValue(), G4VisCommandSetColour::SetNewValue(), and G4VisCommandGeometrySetColour::SetNewValue().

00422 {
00423   G4double vl;
00424   std::istringstream is(st);
00425   is >> vl;
00426   return vl;
00427 }

G4int G4UIcommand::ConvertToInt ( const char *  st  )  [static]

Definition at line 413 of file G4UIcommand.cc.

Referenced by G4UIcmdWithAnInteger::GetNewIntValue(), G4VisCommandsViewerSet::SetNewValue(), G4VisCommandsTouchableSet::SetNewValue(), and G4TrackingMessenger::SetNewValue().

00414 {
00415   G4int vl;
00416   std::istringstream is(st);
00417   is >> vl;
00418   return vl;
00419 }

G4String G4UIcommand::ConvertToString ( G4ThreeVector  vec,
const char *  unitName 
) [static]

Definition at line 391 of file G4UIcommand.cc.

References ValueOf().

00392 {
00393   G4String unt = unitName;
00394   G4double uv = ValueOf(unitName);
00395 
00396   std::ostringstream os;
00397   os << vec.x()/uv << " " << vec.y()/uv << " " << vec.z()/uv
00398      << " " << unitName;
00399   G4String vl = os.str();
00400   return vl;
00401 }

G4String G4UIcommand::ConvertToString ( G4ThreeVector  vec  )  [static]

Definition at line 383 of file G4UIcommand.cc.

00384 {
00385   std::ostringstream os;
00386   os << vec.x() << " " << vec.y() << " " << vec.z();
00387   G4String vl = os.str();
00388   return vl;
00389 }

G4String G4UIcommand::ConvertToString ( G4double  doubleValue,
const char *  unitName 
) [static]

Definition at line 372 of file G4UIcommand.cc.

References ValueOf().

00373 {
00374   G4String unt = unitName;
00375   G4double uv = ValueOf(unitName);
00376 
00377   std::ostringstream os;
00378   os << doubleValue/uv << " " << unitName;
00379   G4String vl = os.str();
00380   return vl;
00381 }

G4String G4UIcommand::ConvertToString ( G4double  doubleValue  )  [static]

Definition at line 364 of file G4UIcommand.cc.

00365 {
00366   std::ostringstream os;
00367   os << doubleValue;
00368   G4String vl = os.str();
00369   return vl;
00370 }

G4String G4UIcommand::ConvertToString ( G4int  intValue  )  [static]

Definition at line 356 of file G4UIcommand.cc.

00357 {
00358   std::ostringstream os;
00359   os << intValue;
00360   G4String vl = os.str();
00361   return vl;
00362 }

G4String G4UIcommand::ConvertToString ( G4bool  boolVal  )  [static]

Definition at line 349 of file G4UIcommand.cc.

Referenced by G4tgrParameterMgr::AddParameterNumber(), G4tgbRotationMatrix::BuildG4RotMatrix(), G4tgbPlaceParameterisation::CheckNExtraData(), G4tgbVolume::CheckNoSolidParams(), G4tgrUtils::CheckWLsize(), G4UIcmdWithADoubleAndUnit::ConvertToStringWithDefaultUnit(), G4UIcmdWith3VectorAndUnit::ConvertToStringWithDefaultUnit(), G4Trajectory::CreateAttValues(), G4SmoothTrajectory::CreateAttValues(), G4TrajectoriesModel::CreateCurrentAttValues(), G4UIcmdWithADoubleAndUnit::DoIt(), G4UIcmdWith3VectorAndUnit::DoIt(), G4tgrFileIn::DumpException(), G4tgbGeometryDumper::DumpPVParameterised(), G4tgbGeometryDumper::DumpPVPlacement(), G4tgbGeometryDumper::DumpRotationMatrix(), G4tgbVolume::FindOrConstructG4Solid(), G4tgrMaterialSimple::GetComponent(), G4VisCommandViewerZoom::GetCurrentValue(), G4VisCommandViewerScale::GetCurrentValue(), G4VisCommandViewerDolly::GetCurrentValue(), G4UserPhysicsListMessenger::GetCurrentValue(), G4UIcontrolMessenger::GetCurrentValue(), G4TrackingMessenger::GetCurrentValue(), G4tgrMessenger::GetCurrentValue(), G4ScoringMessenger::GetCurrentValue(), G4RunMessenger::GetCurrentValue(), G4RTMessenger::GetCurrentValue(), G4ProductionCutsTableMessenger::GetCurrentValue(), G4PolarizationMessenger::GetCurrentValue(), G4ParticlePropertyMessenger::GetCurrentValue(), G4ParticleMessenger::GetCurrentValue(), G4ParticleGunMessenger::GetCurrentValue(), G4MatScanMessenger::GetCurrentValue(), G4HepRepMessenger::GetCurrentValue(), G4GMocrenMessenger::GetCurrentValue(), G4GeometryMessenger::GetCurrentValue(), G4EvManMessenger::GetCurrentValue(), G4DecayTableMessenger::GetCurrentValue(), G4tgrUtils::GetDouble(), G4tgrMaterialSimple::GetFraction(), G4ScoreLogColorMap::GetMapColor(), G4MolecularConfiguration::GetName(), G4tgrUtils::GetRotationFromDirection(), G4tgrVolume::GetVolume(), G4EnergySplitter::GetVoxelID(), G4MolecularConfiguration::IonizeMolecule(), G4MolecularConfiguration::MoveOneElectron(), G4DNAMolecularReactionTable::PrintTable(), G4MolecularConfiguration::RemoveElectron(), G4VisCommandsViewerSet::SetNewValue(), G4GenericMessenger::SetNewValue(), and G4AttCheck::Standard().

00350 {
00351   G4String vl = "0";
00352   if(boolVal) vl = "1";
00353   return vl;
00354 }

G4int G4UIcommand::DoIt ( G4String  parameterList  )  [virtual]

Reimplemented in G4UIcmdWith3VectorAndUnit, and G4UIcmdWithADoubleAndUnit.

Definition at line 104 of file G4UIcommand.cc.

References G4String::append(), CheckNewValue(), fParameterOutOfRange, fParameterUnreadable, G4UImessenger::GetCurrentValue(), G4String::index(), G4String::isNull(), and G4UImessenger::SetNewValue().

Referenced by G4UImanager::ApplyCommand(), G4UIcmdWithADoubleAndUnit::DoIt(), and G4UIcmdWith3VectorAndUnit::DoIt().

00105 {
00106   G4String correctParameters;
00107   G4int n_parameterEntry = parameter.size();
00108   if( n_parameterEntry != 0 )
00109   {
00110     G4String aToken;
00111     G4String correctToken;
00112     G4Tokenizer parameterToken( parameterList );
00113     for( G4int i_thParameter=0; i_thParameter<n_parameterEntry; i_thParameter++ )
00114     {
00115       if(i_thParameter > 0)
00116       {
00117         correctParameters.append(" ");
00118       }
00119       aToken = parameterToken();
00120       if( aToken.length()>0 && aToken(0)=='"' )
00121       {
00122         while( aToken(aToken.length()-1) != '"'
00123                || ( aToken.length()==1 && aToken(0)=='"' ))
00124         {
00125           G4String additionalToken = parameterToken();
00126           if( additionalToken.isNull() )
00127           { return fParameterUnreadable+i_thParameter; }
00128           aToken += " ";
00129           aToken += additionalToken;
00130         }
00131       }
00132       else if(i_thParameter==n_parameterEntry-1 && parameter[i_thParameter]->GetParameterType()=='s')
00133       {
00134         G4String anotherToken;
00135         while(!((anotherToken=parameterToken()).isNull()))
00136         {
00137           G4int idxs = anotherToken.index("#");
00138           if(idxs==G4int(std::string::npos))
00139           {
00140             aToken += " ";
00141             aToken += anotherToken;
00142           }
00143           else if(idxs>0)
00144           {
00145             aToken += " ";
00146             aToken += anotherToken(0,idxs);
00147             break;
00148           }
00149           else
00150           { break; }
00151         }
00152       }
00153 
00154       if( aToken.isNull() || aToken == "!" )
00155       {
00156         if(parameter[i_thParameter]->IsOmittable())
00157         { 
00158           if(parameter[i_thParameter]->GetCurrentAsDefault())
00159           {
00160             G4Tokenizer cvSt(messenger->GetCurrentValue(this));
00161             G4String parVal;
00162             for(G4int ii=0;ii<i_thParameter;ii++)
00163             {
00164               parVal = cvSt();
00165               if (parVal(0)=='"')
00166                 {
00167                   while( parVal(parVal.length()-1) != '"' )
00168                     {
00169                       G4String additionalToken = cvSt();
00170                       if( additionalToken.isNull() )
00171                         { return fParameterUnreadable+i_thParameter; }
00172                       parVal += " ";
00173                       parVal += additionalToken;
00174                     }
00175                 }
00176             }
00177             G4String aCVToken = cvSt();
00178             if (aCVToken(0)=='"')
00179             {
00180               while( aCVToken(aCVToken.length()-1) != '"' )
00181               {
00182                 G4String additionalToken = cvSt();
00183                 if( additionalToken.isNull() )
00184                 { return fParameterUnreadable+i_thParameter; }
00185                 aCVToken += " ";
00186                 aCVToken += additionalToken;
00187               }
00188               // aCVToken.strip(G4String::both,'"');
00189             }
00190             correctParameters.append(aCVToken);
00191           }
00192           else
00193           { correctParameters.append(parameter[i_thParameter]->GetDefaultValue()); }
00194         }
00195         else
00196         { return fParameterUnreadable+i_thParameter; }
00197       }
00198       else
00199       {
00200         G4int stat = parameter[i_thParameter]->CheckNewValue( aToken );
00201         if(stat) return stat+i_thParameter;
00202         correctParameters.append(aToken);
00203       }
00204     }
00205   }
00206 
00207   if(CheckNewValue( correctParameters ))
00208   { return fParameterOutOfRange+99; }
00209 
00210   messenger->SetNewValue( this, correctParameters );
00211   return 0;
00212 }

const G4String& G4UIcommand::GetCommandName (  )  const [inline]

Definition at line 136 of file G4UIcommand.hh.

Referenced by G4GenericMessenger::GetCurrentValue().

00137       { return commandName; }

const G4String& G4UIcommand::GetCommandPath (  )  const [inline]

Definition at line 134 of file G4UIcommand.hh.

Referenced by G4UIcommandTree::AddNewCommand(), G4UImessenger::AddUIcommand(), G4ScoreQuantityMessenger::CheckMeshPS(), G4CascadeParamMessenger::CreateCommand(), operator!=(), operator==(), G4UIcommandTree::RemoveCommand(), G4ScoringMessenger::SetNewValue(), G4ScoreQuantityMessenger::SetNewValue(), and G4GenericMessenger::Command::SetUnit().

00135       { return commandPath; }

G4String G4UIcommand::GetCurrentValue (  ) 

Definition at line 214 of file G4UIcommand.cc.

References G4UImessenger::GetCurrentValue().

Referenced by G4UImanager::GetCurrentValues().

00215 {
00216   return messenger->GetCurrentValue(this);
00217 }

G4int G4UIcommand::GetGuidanceEntries (  )  const [inline]

Definition at line 130 of file G4UIcommand.hh.

Referenced by G4UIcommandTree::CreateHTML(), and G4GenericMessenger::Command::SetUnit().

00131       { return commandGuidance.size(); }

const G4String& G4UIcommand::GetGuidanceLine ( G4int  i  )  const [inline]

Definition at line 132 of file G4UIcommand.hh.

Referenced by G4UIcommandTree::CreateHTML(), and G4GenericMessenger::Command::SetUnit().

00133       { return commandGuidance[i]; }

G4UImessenger* G4UIcommand::GetMessenger (  )  const [inline]

Definition at line 144 of file G4UIcommand.hh.

Referenced by G4GenericMessenger::Command::SetUnit().

00145       { return messenger; }

G4UIparameter* G4UIcommand::GetParameter ( G4int  i  )  const [inline]

Definition at line 140 of file G4UIcommand.hh.

Referenced by G4UIcmdWithADoubleAndUnit::ConvertToStringWithBestUnit(), G4UIcmdWith3VectorAndUnit::ConvertToStringWithBestUnit(), G4UIcmdWithADoubleAndUnit::ConvertToStringWithDefaultUnit(), G4UIcmdWith3VectorAndUnit::ConvertToStringWithDefaultUnit(), G4UIcmdWithADoubleAndUnit::DoIt(), G4UIcmdWith3VectorAndUnit::DoIt(), G4UImanager::GetCurrentStringValue(), G4ProcessTableMessenger::GetCurrentValue(), G4UIcmdWithAString::SetCandidates(), G4GenericMessenger::Command::SetCandidates(), G4UIcmdWithADoubleAndUnit::SetDefaultUnit(), G4UIcmdWith3VectorAndUnit::SetDefaultUnit(), G4UIcmdWithNucleusLimits::SetDefaultValue(), G4UIcmdWithAString::SetDefaultValue(), G4UIcmdWithAnInteger::SetDefaultValue(), G4UIcmdWithADoubleAndUnit::SetDefaultValue(), G4UIcmdWithADouble::SetDefaultValue(), G4UIcmdWithABool::SetDefaultValue(), G4UIcmdWith3VectorAndUnit::SetDefaultValue(), G4UIcmdWith3Vector::SetDefaultValue(), G4GenericMessenger::Command::SetDefaultValue(), G4GenericMessenger::Command::SetParameterName(), G4UIcmdWithADoubleAndUnit::SetUnitCandidates(), and G4UIcmdWith3VectorAndUnit::SetUnitCandidates().

00141       { return parameter[i]; }

G4int G4UIcommand::GetParameterEntries (  )  const [inline]

Definition at line 138 of file G4UIcommand.hh.

Referenced by G4UImanager::GetCurrentStringValue(), and G4InteractorMessenger::SetNewValue().

00139       { return parameter.size(); }

const G4String& G4UIcommand::GetRange (  )  const [inline]

Definition at line 128 of file G4UIcommand.hh.

Referenced by G4GenericMessenger::Command::SetUnit().

00129       { return rangeString; };

std::vector<G4ApplicationState>* G4UIcommand::GetStateList (  )  [inline]

Definition at line 142 of file G4UIcommand.hh.

00143       { return &availabelStateList; }

const G4String G4UIcommand::GetTitle (  )  const [inline]

Definition at line 165 of file G4UIcommand.hh.

Referenced by G4UIcommandTree::GetTitle().

00166       {
00167       if(commandGuidance.size() == 0)
00168       { return G4String("...Title not available..."); }
00169       else
00170       { return commandGuidance[0]; }
00171       }

G4bool G4UIcommand::IsAvailable (  ) 

Definition at line 269 of file G4UIcommand.cc.

References G4StateManager::GetCurrentState(), and G4StateManager::GetStateManager().

Referenced by G4UImanager::ApplyCommand().

00270 {
00271   G4bool av = false;
00272   G4ApplicationState currentState 
00273    = G4StateManager::GetStateManager()->GetCurrentState();
00274    
00275   G4int nState = availabelStateList.size();
00276   for(G4int i=0;i<nState;i++)
00277   {
00278         if(availabelStateList[i]==currentState)
00279         {
00280           av = true;
00281           break;
00282         }
00283   }
00284 
00285   return av;
00286 }

void G4UIcommand::List (  )  [virtual]

Definition at line 328 of file G4UIcommand.cc.

References G4cout, G4endl, and G4String::isNull().

Referenced by G4UIcommandTree::ListCurrent(), G4UIcommandTree::ListCurrentWithNum(), and G4VBasicShell::TerminalHelp().

00329 {
00330   G4cout << G4endl;
00331   G4cout << G4endl;
00332   if(commandPath(commandPath.length()-1)!='/')
00333   { G4cout << "Command " << commandPath << G4endl; }
00334   G4cout << "Guidance :" << G4endl;
00335   G4int n_guidanceEntry = commandGuidance.size();
00336   for( G4int i_thGuidance=0; i_thGuidance < n_guidanceEntry; i_thGuidance++ )
00337   { G4cout << commandGuidance[i_thGuidance] << G4endl; }
00338   if( ! rangeString.isNull() )
00339   { G4cout << " Range of parameters : " << rangeString << G4endl; }
00340   G4int n_parameterEntry = parameter.size();
00341   if( n_parameterEntry > 0 )
00342   {
00343     for( G4int i_thParameter=0; i_thParameter<n_parameterEntry; i_thParameter++ )
00344     { parameter[i_thParameter]->List(); }
00345   }
00346   G4cout << G4endl;
00347 }

G4int G4UIcommand::operator!= ( const G4UIcommand right  )  const

Definition at line 99 of file G4UIcommand.cc.

References GetCommandPath().

00100 {
00101   return ( commandPath != right.GetCommandPath() );
00102 }

G4int G4UIcommand::operator== ( const G4UIcommand right  )  const

Definition at line 94 of file G4UIcommand.cc.

References GetCommandPath().

00095 {
00096   return ( commandPath == right.GetCommandPath() );
00097 }

void G4UIcommand::SetGuidance ( const char *  aGuidance  )  [inline]

Definition at line 156 of file G4UIcommand.hh.

Referenced by G4QMessenger::Add(), G4CascadeParamMessenger::CreateDirectory(), G4GenericMessenger::DeclareMethod(), G4GenericMessenger::DeclareProperty(), G4AdjointSimMessenger::G4AdjointSimMessenger(), G4AnalysisMessenger::G4AnalysisMessenger(), G4DecayTableMessenger::G4DecayTableMessenger(), G4DMmessenger::G4DMmessenger(), G4EmMessenger::G4EmMessenger(), G4EmQMessenger::G4EmQMessenger(), G4EnergyLossMessenger::G4EnergyLossMessenger(), G4ErrorMessenger::G4ErrorMessenger(), G4EvManMessenger::G4EvManMessenger(), G4FastSimulationMessenger::G4FastSimulationMessenger(), G4GDMLMessenger::G4GDMLMessenger(), G4GenericMessenger::G4GenericMessenger(), G4GeometryMessenger::G4GeometryMessenger(), G4GMocrenMessenger::G4GMocrenMessenger(), G4HadronicEPTestMessenger::G4HadronicEPTestMessenger(), G4INCLXXInterfaceMessenger::G4INCLXXInterfaceMessenger(), G4InteractorMessenger::G4InteractorMessenger(), G4MatScanMessenger::G4MatScanMessenger(), G4ModelCmdActive< M >::G4ModelCmdActive(), G4ModelCmdAddInt< M >::G4ModelCmdAddInt(), G4ModelCmdAddInterval< M >::G4ModelCmdAddInterval(), G4ModelCmdAddIntervalContext< M >::G4ModelCmdAddIntervalContext(), G4ModelCmdAddString< M >::G4ModelCmdAddString(), G4ModelCmdAddValue< M >::G4ModelCmdAddValue(), G4ModelCmdAddValueContext< M >::G4ModelCmdAddValueContext(), G4ModelCmdApplyColour< M >::G4ModelCmdApplyColour(), G4ModelCmdApplyStringColour< M >::G4ModelCmdApplyStringColour(), G4ModelCmdCreateContextDir< M >::G4ModelCmdCreateContextDir(), G4ModelCmdDraw< M >::G4ModelCmdDraw(), G4ModelCmdInvert< M >::G4ModelCmdInvert(), G4ModelCmdReset< M >::G4ModelCmdReset(), G4ModelCmdSetAuxPtsFillStyle< M >::G4ModelCmdSetAuxPtsFillStyle(), G4ModelCmdSetAuxPtsSize< M >::G4ModelCmdSetAuxPtsSize(), G4ModelCmdSetAuxPtsSizeType< M >::G4ModelCmdSetAuxPtsSizeType(), G4ModelCmdSetAuxPtsType< M >::G4ModelCmdSetAuxPtsType(), G4ModelCmdSetAuxPtsVisible< M >::G4ModelCmdSetAuxPtsVisible(), G4ModelCmdSetDrawAuxPts< M >::G4ModelCmdSetDrawAuxPts(), G4ModelCmdSetDrawLine< M >::G4ModelCmdSetDrawLine(), G4ModelCmdSetDrawStepPts< M >::G4ModelCmdSetDrawStepPts(), G4ModelCmdSetLineVisible< M >::G4ModelCmdSetLineVisible(), G4ModelCmdSetStepPtsFillStyle< M >::G4ModelCmdSetStepPtsFillStyle(), G4ModelCmdSetStepPtsSize< M >::G4ModelCmdSetStepPtsSize(), G4ModelCmdSetStepPtsSizeType< M >::G4ModelCmdSetStepPtsSizeType(), G4ModelCmdSetStepPtsType< M >::G4ModelCmdSetStepPtsType(), G4ModelCmdSetStepPtsVisible< M >::G4ModelCmdSetStepPtsVisible(), G4ModelCmdSetString< M >::G4ModelCmdSetString(), G4ModelCmdSetTimeSliceInterval< M >::G4ModelCmdSetTimeSliceInterval(), G4ModelCmdVerbose< M >::G4ModelCmdVerbose(), G4NeutronKillerMessenger::G4NeutronKillerMessenger(), G4NistMessenger::G4NistMessenger(), G4OpticalPhysicsMessenger::G4OpticalPhysicsMessenger(), G4ParticleGunMessenger::G4ParticleGunMessenger(), G4ParticleMessenger::G4ParticleMessenger(), G4ParticlePropertyMessenger::G4ParticlePropertyMessenger(), G4PersistencyCenterMessenger::G4PersistencyCenterMessenger(), G4PolarizationMessenger::G4PolarizationMessenger(), G4ProcessManagerMessenger::G4ProcessManagerMessenger(), G4ProcessTableMessenger::G4ProcessTableMessenger(), G4ProductionCutsTableMessenger::G4ProductionCutsTableMessenger(), G4RunMessenger::G4RunMessenger(), G4ScoringMessenger::G4ScoringMessenger(), G4SDmessenger::G4SDmessenger(), G4StackingMessenger::G4StackingMessenger(), G4tgrMessenger::G4tgrMessenger(), G4TrackingMessenger::G4TrackingMessenger(), G4UIcontrolMessenger::G4UIcontrolMessenger(), G4UnitsMessenger::G4UnitsMessenger(), G4UserPhysicsListMessenger::G4UserPhysicsListMessenger(), G4VisCommandDrawTree::G4VisCommandDrawTree(), G4VisCommandDrawView::G4VisCommandDrawView(), G4VisCommandDrawVolume::G4VisCommandDrawVolume(), G4VisCommandGeometrySetColour::G4VisCommandGeometrySetColour(), G4VisCommandGeometrySetDaughtersInvisible::G4VisCommandGeometrySetDaughtersInvisible(), G4VisCommandGeometrySetForceAuxEdgeVisible::G4VisCommandGeometrySetForceAuxEdgeVisible(), G4VisCommandGeometrySetForceLineSegmentsPerCircle::G4VisCommandGeometrySetForceLineSegmentsPerCircle(), G4VisCommandGeometrySetForceSolid::G4VisCommandGeometrySetForceSolid(), G4VisCommandGeometrySetForceWireframe::G4VisCommandGeometrySetForceWireframe(), G4VisCommandGeometrySetLineStyle::G4VisCommandGeometrySetLineStyle(), G4VisCommandGeometrySetLineWidth::G4VisCommandGeometrySetLineWidth(), G4VisCommandGeometrySetVisibility::G4VisCommandGeometrySetVisibility(), G4VisCommandListManagerList< Manager >::G4VisCommandListManagerList(), G4VisCommandListManagerSelect< Manager >::G4VisCommandListManagerSelect(), G4VisCommandManagerMode< Manager >::G4VisCommandManagerMode(), G4VisCommandModelCreate< Factory >::G4VisCommandModelCreate(), G4VisCommandOpen::G4VisCommandOpen(), G4VisCommandSetColour::G4VisCommandSetColour(), G4VisCommandSetLineWidth::G4VisCommandSetLineWidth(), G4VisCommandSetTextColour::G4VisCommandSetTextColour(), G4VisCommandSetTextLayout::G4VisCommandSetTextLayout(), G4VisCommandSetTouchable::G4VisCommandSetTouchable(), G4VisCommandSpecify::G4VisCommandSpecify(), G4VisCommandsTouchableSet::G4VisCommandsTouchableSet(), G4VisCommandsViewerSet::G4VisCommandsViewerSet(), G4VisCommandViewerDefaultHiddenEdge::G4VisCommandViewerDefaultHiddenEdge(), G4VisCommandViewerDefaultStyle::G4VisCommandViewerDefaultStyle(), GFlashShowerModelMessenger::GFlashShowerModelMessenger(), G4GenericMessenger::Command::SetGuidance(), G4GenericMessenger::SetGuidance(), G4VisCommandModelCreate< Factory >::SetNewValue(), and G4GenericMessenger::Command::SetUnit().

00157       {
00158         commandGuidance.push_back( G4String( aGuidance ) );
00159       }

void G4UIcommand::SetParameter ( G4UIparameter *const   newParameter  )  [inline]

Definition at line 147 of file G4UIcommand.hh.

Referenced by G4GenericMessenger::DeclareMethod(), G4GenericMessenger::DeclareProperty(), G4AdjointSimMessenger::G4AdjointSimMessenger(), G4EnergyLossMessenger::G4EnergyLossMessenger(), G4GMocrenMessenger::G4GMocrenMessenger(), G4InteractorMessenger::G4InteractorMessenger(), G4MatScanMessenger::G4MatScanMessenger(), G4ModelCmdApplyColour< M >::G4ModelCmdApplyColour(), G4ModelCmdApplyStringColour< M >::G4ModelCmdApplyStringColour(), G4ParticleGunMessenger::G4ParticleGunMessenger(), G4PolarizationMessenger::G4PolarizationMessenger(), G4ProcessManagerMessenger::G4ProcessManagerMessenger(), G4ProcessTableMessenger::G4ProcessTableMessenger(), G4RunMessenger::G4RunMessenger(), G4ScoringMessenger::G4ScoringMessenger(), G4UIcontrolMessenger::G4UIcontrolMessenger(), G4UserPhysicsListMessenger::G4UserPhysicsListMessenger(), G4VisCommandGeometrySetColour::G4VisCommandGeometrySetColour(), G4VisCommandGeometrySetDaughtersInvisible::G4VisCommandGeometrySetDaughtersInvisible(), G4VisCommandGeometrySetForceAuxEdgeVisible::G4VisCommandGeometrySetForceAuxEdgeVisible(), G4VisCommandGeometrySetForceLineSegmentsPerCircle::G4VisCommandGeometrySetForceLineSegmentsPerCircle(), G4VisCommandGeometrySetForceSolid::G4VisCommandGeometrySetForceSolid(), G4VisCommandGeometrySetForceWireframe::G4VisCommandGeometrySetForceWireframe(), G4VisCommandGeometrySetLineStyle::G4VisCommandGeometrySetLineStyle(), G4VisCommandGeometrySetLineWidth::G4VisCommandGeometrySetLineWidth(), G4VisCommandGeometrySetVisibility::G4VisCommandGeometrySetVisibility(), G4VisCommandOpen::G4VisCommandOpen(), G4VisCommandSceneAddArrow::G4VisCommandSceneAddArrow(), G4VisCommandSceneAddAxes::G4VisCommandSceneAddAxes(), G4VisCommandSceneAddLine::G4VisCommandSceneAddLine(), G4VisCommandSceneAddLogo::G4VisCommandSceneAddLogo(), G4VisCommandSceneAddScale::G4VisCommandSceneAddScale(), G4VisCommandSceneAddText::G4VisCommandSceneAddText(), G4VisCommandSceneAddText2D::G4VisCommandSceneAddText2D(), G4VisCommandSetColour::G4VisCommandSetColour(), G4VisCommandSetTextColour::G4VisCommandSetTextColour(), G4VisCommandSetTouchable::G4VisCommandSetTouchable(), G4VisCommandSpecify::G4VisCommandSpecify(), G4VisCommandsTouchableSet::G4VisCommandsTouchableSet(), G4VisCommandsViewerSet::G4VisCommandsViewerSet(), G4VisCommandViewerAddCutawayPlane::G4VisCommandViewerAddCutawayPlane(), and G4VisCommandViewerChangeCutawayPlane::G4VisCommandViewerChangeCutawayPlane().

00148       {
00149   parameter.push_back( newParameter );
00150   newVal.resize( parameter.size() );
00151       }

void G4UIcommand::SetRange ( const char *  rs  )  [inline]

Definition at line 120 of file G4UIcommand.hh.

Referenced by G4QMessenger::Add(), G4AnalysisMessenger::G4AnalysisMessenger(), G4DecayTableMessenger::G4DecayTableMessenger(), G4EnergyLossMessenger::G4EnergyLossMessenger(), G4EvManMessenger::G4EvManMessenger(), G4GeometryMessenger::G4GeometryMessenger(), G4HadronicEPTestMessenger::G4HadronicEPTestMessenger(), G4INCLXXInterfaceMessenger::G4INCLXXInterfaceMessenger(), G4NistMessenger::G4NistMessenger(), G4OpticalPhysicsMessenger::G4OpticalPhysicsMessenger(), G4ParticleGunMessenger::G4ParticleGunMessenger(), G4ParticleMessenger::G4ParticleMessenger(), G4ParticlePropertyMessenger::G4ParticlePropertyMessenger(), G4PersistencyCenterMessenger::G4PersistencyCenterMessenger(), G4PolarizationMessenger::G4PolarizationMessenger(), G4ProcessManagerMessenger::G4ProcessManagerMessenger(), G4ProcessTableMessenger::G4ProcessTableMessenger(), G4ProductionCutsTableMessenger::G4ProductionCutsTableMessenger(), G4RunMessenger::G4RunMessenger(), G4ScoringMessenger::G4ScoringMessenger(), G4StackingMessenger::G4StackingMessenger(), G4tgrMessenger::G4tgrMessenger(), G4TrackingMessenger::G4TrackingMessenger(), G4UIcontrolMessenger::G4UIcontrolMessenger(), G4UserPhysicsListMessenger::G4UserPhysicsListMessenger(), G4VisCommandSetLineWidth::G4VisCommandSetLineWidth(), G4GenericMessenger::Command::SetRange(), and G4GenericMessenger::Command::SetUnit().

00121       { rangeString = rs; }

G4String G4UIcommand::UnitsList ( const char *  unitCategory  )  [static]

Definition at line 300 of file G4UIcommand.cc.

References G4cerr, G4endl, and G4UnitDefinition::GetUnitsTable().

Referenced by G4EnergyLossMessenger::G4EnergyLossMessenger(), G4MatScanMessenger::G4MatScanMessenger(), G4UserPhysicsListMessenger::G4UserPhysicsListMessenger(), G4UIcmdWithADoubleAndUnit::SetUnitCategory(), and G4UIcmdWith3VectorAndUnit::SetUnitCategory().

00301 {
00302   G4String retStr;
00303   G4UnitsTable& UTbl = G4UnitDefinition::GetUnitsTable();
00304   size_t i;
00305   for(i=0;i<UTbl.size();i++)
00306   { if(UTbl[i]->GetName()==unitCategory) break; }
00307   if(i==UTbl.size())
00308   { 
00309     G4cerr << "Unit category <" << unitCategory << "> is not defined." << G4endl;
00310     return retStr;
00311   }
00312   G4UnitsContainer& UCnt = UTbl[i]->GetUnitsList();
00313   retStr = UCnt[0]->GetSymbol();
00314   G4int je = UCnt.size();
00315   for(G4int j=1;j<je;j++)
00316   {
00317     retStr += " ";
00318     retStr += UCnt[j]->GetSymbol();
00319   }
00320   for(G4int k=0;k<je;k++)
00321   {
00322     retStr += " ";
00323     retStr += UCnt[k]->GetName();
00324   }
00325   return retStr;
00326 }

G4double G4UIcommand::ValueOf ( const char *  unitName  )  [static]

Definition at line 288 of file G4UIcommand.cc.

References G4UnitDefinition::GetValueOf().

Referenced by ConvertToDimensioned3Vector(), ConvertToDimensionedDouble(), G4VVisCommand::ConvertToDoublePair(), G4VVisCommand::ConvertToString(), ConvertToString(), G4UIcmdWithADoubleAndUnit::DoIt(), G4UIcmdWith3VectorAndUnit::DoIt(), G4UIcmdWithADoubleAndUnit::GetNewUnitValue(), G4UIcmdWith3VectorAndUnit::GetNewUnitValue(), G4VisCommandsViewerSet::SetNewValue(), G4VisCommandViewerChangeCutawayPlane::SetNewValue(), G4VisCommandViewerAddCutawayPlane::SetNewValue(), G4VisCommandSceneAddVolume::SetNewValue(), G4VisCommandSceneAddText::SetNewValue(), G4VisCommandSceneAddScale::SetNewValue(), G4VisCommandSceneAddLogo::SetNewValue(), G4VisCommandSceneAddLine::SetNewValue(), G4VisCommandSceneAddAxes::SetNewValue(), G4VisCommandSceneAddArrow::SetNewValue(), G4UserPhysicsListMessenger::SetNewValue(), G4ScoringMessenger::SetNewValue(), G4MatScanMessenger::SetNewValue(), and G4EnergyLossMessenger::SetNewValue().

00289 {
00290    G4double value = 0.;
00291    value = G4UnitDefinition::GetValueOf(unitName);
00292    return value;              
00293 }


The documentation for this class was generated from the following files:
Generated on Mon May 27 17:53:36 2013 for Geant4 by  doxygen 1.4.7