Geant4-11
Public Types | Public Member Functions | Static Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | Private Member Functions | Private Attributes
G4UIcmdWithADoubleAndUnit Class Reference

#include <G4UIcmdWithADoubleAndUnit.hh>

Inheritance diagram for G4UIcmdWithADoubleAndUnit:
G4UIcommand

Public Types

enum  CommandType {
  BaseClassCmd , WithoutParameterCmd , WithABoolCmd , WithAnIntegerCmd ,
  WithALongIntCmd , WithADoubleCmd , WithADoubleAndUnitCmd , With3VectorCmd ,
  With3VectorAndUnitCmd , WithAStringCmd , CmdDirectory = -1
}
 

Public Member Functions

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)
 
void CommandFailed (G4ExceptionDescription &ed)
 
void CommandFailed (G4int errCode, G4ExceptionDescription &ed)
 
G4String ConvertToStringWithBestUnit (G4double val)
 
G4String ConvertToStringWithDefaultUnit (G4double val)
 
virtual G4int DoIt (G4String parameterList)
 
 G4UIcmdWithADoubleAndUnit (const char *theCommandPath, G4UImessenger *theMessenger)
 
const G4StringGetCommandName () const
 
const G4StringGetCommandPath () const
 
CommandType GetCommandType () const
 
G4String GetCurrentValue ()
 
const G4StringGetFailureDescription ()
 
std::size_t GetGuidanceEntries () const
 
const G4StringGetGuidanceLine (G4int i) const
 
G4UImessengerGetMessenger () const
 
G4UIparameterGetParameter (G4int i) const
 
std::size_t GetParameterEntries () const
 
const G4StringGetRange () const
 
std::vector< G4ApplicationState > * GetStateList ()
 
const G4String GetTitle () const
 
G4int IfCommandFailed ()
 
G4bool IsAvailable ()
 
G4bool IsWorkerThreadOnly () const
 
virtual void List ()
 
G4bool operator!= (const G4UIcommand &right) const
 
G4bool operator== (const G4UIcommand &right) const
 
void ResetFailure ()
 
void SetCommandType (CommandType)
 
void SetDefaultSortFlag (G4bool val)
 
void SetDefaultUnit (const char *defUnit)
 
void SetDefaultValue (G4double defVal)
 
void SetGuidance (const char *aGuidance)
 
void SetParameter (G4UIparameter *const newParameter)
 
void SetParameterName (const char *theName, G4bool omittable, G4bool currentAsDefault=false)
 
void SetRange (const char *rs)
 
void SetToBeBroadcasted (G4bool val)
 
void SetToBeFlushed (G4bool val)
 
void SetUnitCandidates (const char *candidateList)
 
void SetUnitCategory (const char *unitCategory)
 
void SetWorkerThreadOnly (G4bool val=true)
 
G4bool ToBeBroadcasted () const
 
G4bool ToBeFlushed () const
 

Static Public Member Functions

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

Protected Types

using tokenNum = G4UItokenNum::tokenNum
 
using yystype = G4UItokenNum::yystype
 

Protected Member Functions

G4int CheckNewValue (const char *newValue)
 

Protected Attributes

G4int commandFailureCode = 0
 
G4String failureDescription = ""
 
G4bool ifSort = false
 
G4bool toBeBroadcasted = false
 
G4bool toBeFlushed = false
 
G4bool workerThreadOnly = false
 

Private Member Functions

yystype AdditiveExpression (void)
 
G4int Backslash (G4int c)
 
G4int CompareDouble (G4double arg1, G4int op, G4double arg2)
 
G4int CompareInt (G4int arg1, G4int op, G4int arg2)
 
G4int CompareLong (G4long arg1, G4int op, G4long arg2)
 
yystype EqualityExpression (void)
 
G4int Eval2 (yystype arg1, G4int op, yystype arg2)
 
G4int ExpectExponent (const char *str)
 
yystype Expression (void)
 
G4int Follow (G4int expect, G4int ifyes, G4int ifno)
 
void G4UIcommandCommonConstructorCode (const char *theCommandPath)
 
G4int G4UIpGetc (void)
 
G4int G4UIpUngetc (G4int c)
 
unsigned IndexOf (const char *)
 
G4int IsDouble (const char *str)
 
G4int IsInt (const char *str, short maxLength)
 
unsigned IsParameter (const char *)
 
yystype LogicalANDExpression (void)
 
yystype LogicalORExpression (void)
 
yystype MultiplicativeExpression (void)
 
yystype PrimaryExpression (void)
 
G4int RangeCheck (const char *t)
 
yystype RelationalExpression (void)
 
G4int TypeCheck (const char *t)
 
yystype UnaryExpression (void)
 
tokenNum Yylex (void)
 

Private Attributes

std::vector< G4ApplicationStateavailabelStateList
 
G4int bp = 0
 
std::vector< G4StringcommandGuidance
 
G4String commandName
 
G4String commandPath
 
CommandType commandType = BaseClassCmd
 
G4UImessengermessenger = nullptr
 
std::vector< yystypenewVal
 
G4int paramERR = 0
 
std::vector< G4UIparameter * > parameter
 
G4String rangeBuf
 
G4String rangeString
 
tokenNum token = G4UItokenNum::IDENTIFIER
 
yystype yylval
 

Detailed Description

Definition at line 41 of file G4UIcmdWithADoubleAndUnit.hh.

Member Typedef Documentation

◆ tokenNum

using G4UIcommand::tokenNum = G4UItokenNum::tokenNum
protectedinherited

Definition at line 215 of file G4UIcommand.hh.

◆ yystype

using G4UIcommand::yystype = G4UItokenNum::yystype
protectedinherited

Definition at line 214 of file G4UIcommand.hh.

Member Enumeration Documentation

◆ CommandType

enum G4UIcommand::CommandType
inherited
Enumerator
BaseClassCmd 
WithoutParameterCmd 
WithABoolCmd 
WithAnIntegerCmd 
WithALongIntCmd 
WithADoubleCmd 
WithADoubleAndUnitCmd 
With3VectorCmd 
With3VectorAndUnitCmd 
WithAStringCmd 
CmdDirectory 

Definition at line 198 of file G4UIcommand.hh.

Constructor & Destructor Documentation

◆ G4UIcmdWithADoubleAndUnit()

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

Definition at line 39 of file G4UIcmdWithADoubleAndUnit.cc.

41 : G4UIcommand(theCommandPath, theMessenger)
42{
43 G4UIparameter* dblParam = new G4UIparameter('d');
44 SetParameter(dblParam);
45 G4UIparameter* untParam = new G4UIparameter('s');
46 untParam->SetParameterName("Unit");
47 SetParameter(untParam);
49}
void SetCommandType(CommandType)
Definition: G4UIcommand.cc:94
void SetParameter(G4UIparameter *const newParameter)
Definition: G4UIcommand.hh:146
void SetParameterName(const char *pName)

References G4UIcommand::SetCommandType(), G4UIcommand::SetParameter(), G4UIparameter::SetParameterName(), and G4UIcommand::WithADoubleAndUnitCmd.

Member Function Documentation

◆ AdditiveExpression()

yystype G4UIcommand::AdditiveExpression ( void  )
privateinherited

Definition at line 1063 of file G4UIcommand.cc.

1064{
1065 yystype result;
1066 result = MultiplicativeExpression();
1067 if(token != '+' && token != '-')
1068 return result;
1069 G4cerr << "Parameter range: operator " << (char) token << " is not supported."
1070 << G4endl;
1071 paramERR = 1;
1072 return result;
1073}
G4GLOB_DLL std::ostream G4cerr
#define G4endl
Definition: G4ios.hh:57
yystype MultiplicativeExpression(void)
G4int paramERR
Definition: G4UIcommand.hh:280
tokenNum token
Definition: G4UIcommand.hh:277

References G4cerr, G4endl, G4UIcommand::MultiplicativeExpression(), G4UIcommand::paramERR, and G4UIcommand::token.

Referenced by G4UIcommand::RelationalExpression().

◆ AvailableForStates() [1/5]

void G4UIcommand::AvailableForStates ( G4ApplicationState  s1)
inherited

Definition at line 288 of file G4UIcommand.cc.

289{
290 availabelStateList.clear();
291 availabelStateList.push_back(s1);
292}
std::vector< G4ApplicationState > availabelStateList
Definition: G4UIcommand.hh:273

References G4UIcommand::availabelStateList.

Referenced by DetectorMessenger::DetectorMessenger(), ExN03DetectorMessenger::ExN03DetectorMessenger(), G4AdjointSimMessenger::G4AdjointSimMessenger(), G4DeexParametersMessenger::G4DeexParametersMessenger(), G4EmExtraParametersMessenger::G4EmExtraParametersMessenger(), G4EmLowEParametersMessenger::G4EmLowEParametersMessenger(), G4EmMessenger::G4EmMessenger(), G4EmParametersMessenger::G4EmParametersMessenger(), G4ErrorMessenger::G4ErrorMessenger(), G4EvManMessenger::G4EvManMessenger(), G4FastSimulationMessenger::G4FastSimulationMessenger(), G4GDMLMessenger::G4GDMLMessenger(), G4GeometryMessenger::G4GeometryMessenger(), G4GlobalMagFieldMessenger::G4GlobalMagFieldMessenger(), G4GMocrenMessenger::G4GMocrenMessenger(), G4HadronicParametersMessenger::G4HadronicParametersMessenger(), G4HepRepMessenger::G4HepRepMessenger(), G4INCLXXInterfaceMessenger::G4INCLXXInterfaceMessenger(), G4LocalThreadCoutMessenger::G4LocalThreadCoutMessenger(), G4MatScanMessenger::G4MatScanMessenger(), G4NeutronKillerMessenger::G4NeutronKillerMessenger(), G4NuclideTableMessenger::G4NuclideTableMessenger(), G4OpticalParametersMessenger::G4OpticalParametersMessenger(), G4ParticleHPMessenger::G4ParticleHPMessenger(), G4ParticleMessenger::G4ParticleMessenger(), G4ParticlePropertyMessenger::G4ParticlePropertyMessenger(), G4PhysListFactoryMessenger::G4PhysListFactoryMessenger(), G4PolarizationMessenger::G4PolarizationMessenger(), G4ProcessManagerMessenger::G4ProcessManagerMessenger(), G4ProcessTableMessenger::G4ProcessTableMessenger(), G4ProductionCutsTableMessenger::G4ProductionCutsTableMessenger(), G4RTMessenger::G4RTMessenger(), G4RunMessenger::G4RunMessenger(), G4SchedulerMessenger::G4SchedulerMessenger(), G4StackingMessenger::G4StackingMessenger(), G4UCNBoundaryProcessMessenger::G4UCNBoundaryProcessMessenger(), G4UserPhysicsListMessenger::G4UserPhysicsListMessenger(), GFlashShowerModelMessenger::GFlashShowerModelMessenger(), PhysicsListMessenger::PhysicsListMessenger(), and G4GenericMessenger::Command::SetStates().

◆ AvailableForStates() [2/5]

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

Definition at line 295 of file G4UIcommand.cc.

297{
298 availabelStateList.clear();
299 availabelStateList.push_back(s1);
300 availabelStateList.push_back(s2);
301}

References G4UIcommand::availabelStateList.

◆ AvailableForStates() [3/5]

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

Definition at line 304 of file G4UIcommand.cc.

307{
308 availabelStateList.clear();
309 availabelStateList.push_back(s1);
310 availabelStateList.push_back(s2);
311 availabelStateList.push_back(s3);
312}

References G4UIcommand::availabelStateList.

◆ AvailableForStates() [4/5]

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

Definition at line 315 of file G4UIcommand.cc.

319{
320 availabelStateList.clear();
321 availabelStateList.push_back(s1);
322 availabelStateList.push_back(s2);
323 availabelStateList.push_back(s3);
324 availabelStateList.push_back(s4);
325}

References G4UIcommand::availabelStateList.

◆ AvailableForStates() [5/5]

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

Definition at line 328 of file G4UIcommand.cc.

333{
334 availabelStateList.clear();
335 availabelStateList.push_back(s1);
336 availabelStateList.push_back(s2);
337 availabelStateList.push_back(s3);
338 availabelStateList.push_back(s4);
339 availabelStateList.push_back(s5);
340}

References G4UIcommand::availabelStateList.

◆ Backslash()

G4int G4UIcommand::Backslash ( G4int  c)
privateinherited

◆ CategoryOf()

G4String G4UIcommand::CategoryOf ( const char *  unitName)
staticinherited

◆ CheckNewValue()

G4int G4UIcommand::CheckNewValue ( const char *  newValue)
protectedinherited

Definition at line 625 of file G4UIcommand.cc.

626{
627 yystype result;
628 // if( TypeCheck(newValue) == 0 ) return 1;
629 if(!rangeString.empty())
630 {
631 if(RangeCheck(newValue) == 0)
633 }
634 return 0; // succeeded
635}
@ fParameterOutOfRange
G4String rangeString
Definition: G4UIcommand.hh:270
G4int RangeCheck(const char *t)
Definition: G4UIcommand.cc:849

References fParameterOutOfRange, G4UIcommand::RangeCheck(), and G4UIcommand::rangeString.

Referenced by G4UIcommand::DoIt().

◆ CommandFailed() [1/2]

void G4UIcommand::CommandFailed ( G4ExceptionDescription ed)
inlineinherited

Definition at line 184 of file G4UIcommand.hh.

185 {
187 failureDescription = ed.str();
188 }
G4int commandFailureCode
Definition: G4UIcommand.hh:223
G4String failureDescription
Definition: G4UIcommand.hh:224

References G4UIcommand::commandFailureCode, and G4UIcommand::failureDescription.

◆ CommandFailed() [2/2]

void G4UIcommand::CommandFailed ( G4int  errCode,
G4ExceptionDescription ed 
)
inlineinherited

◆ CompareDouble()

G4int G4UIcommand::CompareDouble ( G4double  arg1,
G4int  op,
G4double  arg2 
)
privateinherited

Definition at line 1432 of file G4UIcommand.cc.

1433{
1434 G4int result = -1;
1435 G4String opr;
1436 switch(op)
1437 {
1438 case GT:
1439 result = (arg1 > arg2);
1440 opr = ">";
1441 break;
1442 case GE:
1443 result = (arg1 >= arg2);
1444 opr = ">=";
1445 break;
1446 case LT:
1447 result = (arg1 < arg2);
1448 opr = "<";
1449 break;
1450 case LE:
1451 result = (arg1 <= arg2);
1452 opr = "<=";
1453 break;
1454 case EQ:
1455 result = (arg1 == arg2);
1456 opr = "==";
1457 break;
1458 case NE:
1459 result = (arg1 != arg2);
1460 opr = "!=";
1461 break;
1462 default:
1463 G4cerr << "Parameter range: error at CompareDouble" << G4endl;
1464 paramERR = 1;
1465 }
1466#ifdef DEBUG
1467 G4cerr << "CompareDouble " << arg1 << " " << opr << " " << arg2
1468 << " result: " << result << G4endl;
1469#endif
1470 return result;
1471}
@ GT
Definition: Evaluator.cc:65
@ LT
Definition: Evaluator.cc:65
@ NE
Definition: Evaluator.cc:65
@ GE
Definition: Evaluator.cc:65
@ LE
Definition: Evaluator.cc:65
@ EQ
Definition: Evaluator.cc:65
int G4int
Definition: G4Types.hh:85

References EQ, G4cerr, G4endl, GE, GT, LE, LT, NE, and G4UIcommand::paramERR.

Referenced by G4UIcommand::Eval2().

◆ CompareInt()

G4int G4UIcommand::CompareInt ( G4int  arg1,
G4int  op,
G4int  arg2 
)
privateinherited

Definition at line 1348 of file G4UIcommand.cc.

1349{
1350 G4int result = -1;
1351 G4String opr;
1352 switch(op)
1353 {
1354 case GT:
1355 result = (arg1 > arg2);
1356 opr = ">";
1357 break;
1358 case GE:
1359 result = (arg1 >= arg2);
1360 opr = ">=";
1361 break;
1362 case LT:
1363 result = (arg1 < arg2);
1364 opr = "<";
1365 break;
1366 case LE:
1367 result = (arg1 <= arg2);
1368 opr = "<=";
1369 break;
1370 case EQ:
1371 result = (arg1 == arg2);
1372 opr = "==";
1373 break;
1374 case NE:
1375 result = (arg1 != arg2);
1376 opr = "!=";
1377 break;
1378 default:
1379 G4cerr << "Parameter range: error at CompareInt" << G4endl;
1380 paramERR = 1;
1381 }
1382#ifdef DEBUG
1383 G4cerr << "CompareInt " << arg1 << " " << opr << arg2 << " result: " << result
1384 << G4endl;
1385#endif
1386 return result;
1387}

References EQ, G4cerr, G4endl, GE, GT, LE, LT, NE, and G4UIcommand::paramERR.

Referenced by G4UIcommand::Eval2().

◆ CompareLong()

G4int G4UIcommand::CompareLong ( G4long  arg1,
G4int  op,
G4long  arg2 
)
privateinherited

Definition at line 1390 of file G4UIcommand.cc.

1391{
1392 G4int result = -1;
1393 G4String opr;
1394 switch(op)
1395 {
1396 case GT:
1397 result = (arg1 > arg2);
1398 opr = ">";
1399 break;
1400 case GE:
1401 result = (arg1 >= arg2);
1402 opr = ">=";
1403 break;
1404 case LT:
1405 result = (arg1 < arg2);
1406 opr = "<";
1407 break;
1408 case LE:
1409 result = (arg1 <= arg2);
1410 opr = "<=";
1411 break;
1412 case EQ:
1413 result = (arg1 == arg2);
1414 opr = "==";
1415 break;
1416 case NE:
1417 result = (arg1 != arg2);
1418 opr = "!=";
1419 break;
1420 default:
1421 G4cerr << "Parameter range: error at CompareInt" << G4endl;
1422 paramERR = 1;
1423 }
1424#ifdef DEBUG
1425 G4cerr << "CompareInt " << arg1 << " " << opr << arg2 << " result: " << result
1426 << G4endl;
1427#endif
1428 return result;
1429}

References EQ, G4cerr, G4endl, GE, GT, LE, LT, NE, and G4UIcommand::paramERR.

Referenced by G4UIcommand::Eval2().

◆ ConvertTo3Vector()

G4ThreeVector G4UIcommand::ConvertTo3Vector ( const char *  st)
staticinherited

Definition at line 597 of file G4UIcommand.cc.

598{
599 G4double vx;
600 G4double vy;
601 G4double vz;
602 std::istringstream is(st);
603 is >> vx >> vy >> vz;
604 return G4ThreeVector(vx, vy, vz);
605}
CLHEP::Hep3Vector G4ThreeVector
double G4double
Definition: G4Types.hh:83

Referenced by G4AnyType::Ref< ValueType >::FromString(), G4UIcmdWith3Vector::GetNew3VectorValue(), G4VisCommandsViewerSet::SetNewValue(), and G4AttCheck::Standard().

◆ ConvertToBool()

G4bool G4UIcommand::ConvertToBool ( const char *  st)
staticinherited

Definition at line 545 of file G4UIcommand.cc.

546{
548 G4bool vl = false;
549 if(v == "Y" || v == "YES" || v == "1" || v == "T" || v == "TRUE")
550 {
551 vl = true;
552 }
553 return vl;
554}
bool G4bool
Definition: G4Types.hh:86
G4String to_upper_copy(G4String str)
Return uppercase copy of string.

References G4StrUtil::to_upper_copy().

Referenced by G4AnyType::Ref< ValueType >::FromString(), G4HepRepMessenger::G4HepRepMessenger(), G4UIcmdWithABool::GetNewBoolValue(), G4OpticalParametersMessenger::SetNewValue(), G4OpenGLViewerMessenger::SetNewValue(), G4InteractorMessenger::SetNewValue(), G4VisCommandAbortReviewKeptEvents::SetNewValue(), G4VisCommandDrawOnlyToBeKeptEvents::SetNewValue(), G4VisCommandEnable::SetNewValue(), G4VisCommandGeometrySetDaughtersInvisible::SetNewValue(), G4VisCommandGeometrySetForceAuxEdgeVisible::SetNewValue(), G4VisCommandGeometrySetForceCloud::SetNewValue(), G4VisCommandGeometrySetForceSolid::SetNewValue(), G4VisCommandGeometrySetForceWireframe::SetNewValue(), G4VisCommandGeometrySetVisibility::SetNewValue(), G4VisCommandSceneActivateModel::SetNewValue(), G4VisCommandSceneAddAxes::SetNewValue(), G4VisCommandSceneAddLogicalVolume::SetNewValue(), G4VisCommandSetVolumeForField::SetNewValue(), G4VisCommandsTouchableSet::SetNewValue(), G4VisCommandViewerDefaultHiddenEdge::SetNewValue(), G4VisCommandsViewerSet::SetNewValue(), G4H1Messenger::SetNewValue(), G4H2Messenger::SetNewValue(), G4H3Messenger::SetNewValue(), G4HnMessenger::SetNewValue(), G4NtupleMessenger::SetNewValue(), G4P1Messenger::SetNewValue(), and G4P2Messenger::SetNewValue().

◆ ConvertToDimensioned3Vector()

G4ThreeVector G4UIcommand::ConvertToDimensioned3Vector ( const char *  st)
staticinherited

Definition at line 608 of file G4UIcommand.cc.

609{
610 G4double vx;
611 G4double vy;
612 G4double vz;
613 char unts[30];
614 std::istringstream is(st);
615 is >> vx >> vy >> vz >> unts;
616 G4String unt = unts;
617 G4double uv = ValueOf(unt);
618 return G4ThreeVector(vx * uv, vy * uv, vz * uv);
619}
static G4double ValueOf(const char *unitName)
Definition: G4UIcommand.cc:363

References G4UIcommand::ValueOf().

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

◆ ConvertToDimensionedDouble()

G4double G4UIcommand::ConvertToDimensionedDouble ( const char *  st)
staticinherited

Definition at line 584 of file G4UIcommand.cc.

585{
586 G4double vl;
587 char unts[30];
588
589 std::istringstream is(st);
590 is >> vl >> unts;
591 G4String unt = unts;
592
593 return (vl * ValueOf(unt));
594}

References G4UIcommand::ValueOf().

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

◆ ConvertToDouble()

G4double G4UIcommand::ConvertToDouble ( const char *  st)
staticinherited

◆ ConvertToInt()

G4int G4UIcommand::ConvertToInt ( const char *  st)
staticinherited

◆ ConvertToLongInt()

G4long G4UIcommand::ConvertToLongInt ( const char *  st)
staticinherited

Definition at line 566 of file G4UIcommand.cc.

567{
568 G4long vl;
569 std::istringstream is(st);
570 is >> vl;
571 return vl;
572}
long G4long
Definition: G4Types.hh:87

Referenced by G4UIcmdWithALongInt::GetNewLongIntValue().

◆ ConvertToString() [1/7]

G4String G4UIcommand::ConvertToString ( G4bool  boolVal)
staticinherited

Definition at line 445 of file G4UIcommand.cc.

446{
447 G4String vl = "0";
448 if(boolVal)
449 vl = "1";
450 return vl;
451}

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

◆ ConvertToString() [2/7]

G4String G4UIcommand::ConvertToString ( G4double  doubleValue)
staticinherited

Definition at line 472 of file G4UIcommand.cc.

473{
474 std::ostringstream os;
476 {
477 os << std::setprecision(17) << doubleValue;
478 }
479 else
480 {
481 os << doubleValue;
482 }
483 G4String vl = os.str();
484 return vl;
485}
static G4bool DoublePrecisionStr()
Definition: G4UImanager.cc:158

References G4UImanager::DoublePrecisionStr().

◆ ConvertToString() [3/7]

G4String G4UIcommand::ConvertToString ( G4double  doubleValue,
const char *  unitName 
)
staticinherited

Definition at line 488 of file G4UIcommand.cc.

490{
491 G4String unt = unitName;
492 G4double uv = ValueOf(unitName);
493
494 std::ostringstream os;
496 {
497 os << std::setprecision(17) << doubleValue / uv << " " << unitName;
498 }
499 else
500 {
501 os << doubleValue / uv << " " << unitName;
502 }
503 G4String vl = os.str();
504 return vl;
505}

References G4UImanager::DoublePrecisionStr(), and G4UIcommand::ValueOf().

◆ ConvertToString() [4/7]

G4String G4UIcommand::ConvertToString ( G4int  intValue)
staticinherited

Definition at line 454 of file G4UIcommand.cc.

455{
456 std::ostringstream os;
457 os << intValue;
458 G4String vl = os.str();
459 return vl;
460}

◆ ConvertToString() [5/7]

G4String G4UIcommand::ConvertToString ( G4long  longValue)
staticinherited

Definition at line 463 of file G4UIcommand.cc.

464{
465 std::ostringstream os;
466 os << longValue;
467 G4String vl = os.str();
468 return vl;
469}

◆ ConvertToString() [6/7]

G4String G4UIcommand::ConvertToString ( G4ThreeVector  vec)
staticinherited

Definition at line 508 of file G4UIcommand.cc.

509{
510 std::ostringstream os;
512 {
513 os << std::setprecision(17) << vec.x() << " " << vec.y() << " " << vec.z();
514 }
515 else
516 {
517 os << vec.x() << " " << vec.y() << " " << vec.z();
518 }
519 G4String vl = os.str();
520 return vl;
521}
double z() const
double x() const
double y() const

References G4UImanager::DoublePrecisionStr(), CLHEP::Hep3Vector::x(), CLHEP::Hep3Vector::y(), and CLHEP::Hep3Vector::z().

◆ ConvertToString() [7/7]

G4String G4UIcommand::ConvertToString ( G4ThreeVector  vec,
const char *  unitName 
)
staticinherited

Definition at line 524 of file G4UIcommand.cc.

525{
526 G4String unt = unitName;
527 G4double uv = ValueOf(unitName);
528
529 std::ostringstream os;
531 {
532 os << std::setprecision(17) << vec.x() / uv << " " << vec.y() / uv << " "
533 << vec.z() / uv << " " << unitName;
534 }
535 else
536 {
537 os << vec.x() / uv << " " << vec.y() / uv << " " << vec.z() / uv << " "
538 << unitName;
539 }
540 G4String vl = os.str();
541 return vl;
542}

References G4UImanager::DoublePrecisionStr(), G4UIcommand::ValueOf(), CLHEP::Hep3Vector::x(), CLHEP::Hep3Vector::y(), and CLHEP::Hep3Vector::z().

◆ ConvertToStringWithBestUnit()

G4String G4UIcmdWithADoubleAndUnit::ConvertToStringWithBestUnit ( G4double  val)

Definition at line 126 of file G4UIcmdWithADoubleAndUnit.cc.

127{
128 G4UIparameter* unitParam = GetParameter(1);
129 G4String canList = unitParam->GetParameterCandidates();
130 G4Tokenizer candidateTokenizer(canList);
131 G4String aToken = candidateTokenizer();
132 std::ostringstream os;
133 os << G4BestUnit(val, CategoryOf(aToken));
134
135 G4String st = os.str();
136 return st;
137}
#define G4BestUnit(a, b)
G4UIparameter * GetParameter(G4int i) const
Definition: G4UIcommand.hh:139
static G4String CategoryOf(const char *unitName)
Definition: G4UIcommand.cc:371
const G4String & GetParameterCandidates() const

References G4UIcommand::CategoryOf(), G4BestUnit, G4UIcommand::GetParameter(), and G4UIparameter::GetParameterCandidates().

Referenced by ConvertToStringWithDefaultUnit(), and G4MoleculeShootMessenger::GetCurrentValue().

◆ ConvertToStringWithDefaultUnit()

G4String G4UIcmdWithADoubleAndUnit::ConvertToStringWithDefaultUnit ( G4double  val)

Definition at line 140 of file G4UIcmdWithADoubleAndUnit.cc.

141{
142 G4UIparameter* unitParam = GetParameter(1);
143 G4String st;
144 if(unitParam->IsOmittable())
145 {
146 st = ConvertToString(val, unitParam->GetDefaultValue());
147 }
148 else
149 {
151 }
152 return st;
153}
G4String ConvertToStringWithBestUnit(G4double val)
static G4String ConvertToString(G4bool boolVal)
Definition: G4UIcommand.cc:445
G4bool IsOmittable() const
const G4String & GetDefaultValue() const

References G4UIcommand::ConvertToString(), ConvertToStringWithBestUnit(), G4UIparameter::GetDefaultValue(), G4UIcommand::GetParameter(), and G4UIparameter::IsOmittable().

◆ DoIt()

G4int G4UIcmdWithADoubleAndUnit::DoIt ( G4String  parameterList)
virtual

Reimplemented from G4UIcommand.

Definition at line 52 of file G4UIcmdWithADoubleAndUnit.cc.

53{
54 std::vector<G4String> token_vector;
55 G4Tokenizer tkn(parameterList);
56 G4String str;
57 while((str = tkn()) != "")
58 {
59 token_vector.push_back(str);
60 }
61
62 // convert a value in default unit
63 G4String converted_parameter;
64 G4String default_unit = GetParameter(1)->GetDefaultValue();
65 if(default_unit != "" && token_vector.size() >= 2)
66 {
67 if(CategoryOf(token_vector[1]) != CategoryOf(default_unit))
68 {
70 }
71 G4double value_given = ValueOf(token_vector[1]);
72 G4double value_default = ValueOf(default_unit);
73 G4double value =
74 ConvertToDouble(token_vector[0]) * value_given / value_default;
75 // reconstruct parameter list
76 converted_parameter += ConvertToString(value);
77 converted_parameter += " ";
78 converted_parameter += default_unit;
79 for(std::size_t i = 2; i < token_vector.size(); ++i)
80 {
81 converted_parameter += " ";
82 converted_parameter += token_vector[i];
83 }
84 }
85 else
86 {
87 converted_parameter = parameterList;
88 }
89
90 return G4UIcommand::DoIt(converted_parameter);
91}
@ fParameterOutOfCandidates
virtual G4int DoIt(G4String parameterList)
Definition: G4UIcommand.cc:151
static G4double ConvertToDouble(const char *st)
Definition: G4UIcommand.cc:575

References G4UIcommand::CategoryOf(), G4UIcommand::ConvertToDouble(), G4UIcommand::ConvertToString(), G4UIcommand::DoIt(), fParameterOutOfCandidates, G4UIparameter::GetDefaultValue(), G4UIcommand::GetParameter(), and G4UIcommand::ValueOf().

◆ EqualityExpression()

yystype G4UIcommand::EqualityExpression ( void  )
privateinherited

Definition at line 998 of file G4UIcommand.cc.

999{
1000 yystype arg1, arg2;
1001 G4int operat;
1002 yystype result;
1003#ifdef DEBUG
1004 G4cerr << " EqualityExpression()" << G4endl;
1005#endif
1006 result = RelationalExpression();
1007 if(token == EQ || token == NE)
1008 {
1009 operat = token;
1010 token = Yylex();
1011 arg1 = result;
1012 arg2 = RelationalExpression();
1013 result.I = Eval2(arg1, operat, arg2); // semantic action
1014 result.type = CONSTINT;
1015#ifdef DEBUG
1016 G4cerr << " return code of Eval2(): " << result.I << G4endl;
1017#endif
1018 }
1019 else
1020 {
1021 if(result.type != CONSTINT && result.type != CONSTDOUBLE)
1022 {
1023 G4cerr << "Parameter range: error at EqualityExpression" << G4endl;
1024 paramERR = 1;
1025 }
1026 }
1027 return result;
1028}
tokenNum Yylex(void)
yystype RelationalExpression(void)
G4int Eval2(yystype arg1, G4int op, yystype arg2)

References G4UItokenNum::CONSTDOUBLE, G4UItokenNum::CONSTINT, EQ, G4UIcommand::Eval2(), G4cerr, G4endl, G4UItokenNum::yystype::I, NE, G4UIcommand::paramERR, G4UIcommand::RelationalExpression(), G4UIcommand::token, G4UItokenNum::yystype::type, and G4UIcommand::Yylex().

Referenced by G4UIcommand::LogicalANDExpression().

◆ Eval2()

G4int G4UIcommand::Eval2 ( yystype  arg1,
G4int  op,
yystype  arg2 
)
privateinherited

Definition at line 1181 of file G4UIcommand.cc.

1182{
1183 char newValtype;
1184 if((arg1.type != IDENTIFIER) && (arg2.type != IDENTIFIER))
1185 {
1186 G4cerr << commandName << ": meaningless comparison" << G4endl;
1187 paramERR = 1;
1188 }
1189
1190 if(arg1.type == IDENTIFIER)
1191 {
1192 unsigned i = IndexOf(arg1.S);
1193 newValtype = toupper(parameter[i]->GetParameterType());
1194 switch(newValtype)
1195 {
1196 case 'I':
1197 if(arg2.type == CONSTINT)
1198 {
1199 return CompareInt(newVal[i].I, op, arg2.I);
1200 //===================================================================
1201 // MA - 2018.07.23
1202 }
1203 else if(arg2.type == IDENTIFIER)
1204 {
1205 unsigned iii = IndexOf(arg2.S);
1206 char newValtype2 = toupper(parameter[iii]->GetParameterType());
1207 if(newValtype2 == 'I')
1208 {
1209 return CompareInt(newVal[i].I, op, newVal[iii].I);
1210 }
1211 else if(newValtype2 == 'L')
1212 {
1213 G4cerr << "Warning : Integer is compared with long int : "
1214 << rangeString << G4endl;
1215 return CompareLong(newVal[i].I, op, newVal[iii].L);
1216 }
1217 else if(newValtype2 == 'D')
1218 {
1219 G4cerr << "Warning : Integer is compared with double : "
1220 << rangeString << G4endl;
1221 return CompareDouble(newVal[i].I, op, newVal[iii].D);
1222 }
1223 //===================================================================
1224 }
1225 else
1226 {
1227 G4cerr << "integer operand expected for " << rangeString << '.'
1228 << G4endl;
1229 }
1230 break;
1231 case 'L':
1232 if(arg2.type == CONSTINT)
1233 {
1234 return CompareLong(newVal[i].L, op, arg2.I);
1235 }
1236 else if(arg2.type == CONSTLONG)
1237 {
1238 return CompareLong(newVal[i].L, op, arg2.L);
1239 }
1240 else if(arg2.type == IDENTIFIER)
1241 {
1242 unsigned iii = IndexOf(arg2.S);
1243 char newValtype2 = toupper(parameter[iii]->GetParameterType());
1244 if(newValtype2 == 'I')
1245 {
1246 return CompareLong(newVal[i].L, op, newVal[iii].I);
1247 }
1248 if(newValtype2 == 'L')
1249 {
1250 return CompareLong(newVal[i].L, op, newVal[iii].L);
1251 }
1252 else if(newValtype2 == 'D')
1253 {
1254 G4cerr << "Warning : Long int is compared with double : "
1255 << rangeString << G4endl;
1256 return CompareDouble(newVal[i].L, op, newVal[iii].D);
1257 }
1258 //===================================================================
1259 }
1260 else
1261 {
1262 G4cerr << "integer operand expected for " << rangeString << '.'
1263 << G4endl;
1264 }
1265 break;
1266 case 'D':
1267 if(arg2.type == CONSTDOUBLE)
1268 {
1269 return CompareDouble(newVal[i].D, op, arg2.D);
1270 }
1271 else if(arg2.type == CONSTINT)
1272 { // integral promotion
1273 return CompareDouble(newVal[i].D, op, arg2.I);
1274 //===================================================================
1275 // MA - 2018.07.23
1276 }
1277 else if(arg2.type == CONSTLONG)
1278 {
1279 return CompareDouble(newVal[i].D, op, arg2.L);
1280 }
1281 else if(arg2.type == IDENTIFIER)
1282 {
1283 unsigned iii = IndexOf(arg2.S);
1284 char newValtype2 = toupper(parameter[iii]->GetParameterType());
1285 if(newValtype2 == 'I')
1286 {
1287 return CompareDouble(newVal[i].D, op, newVal[iii].I);
1288 }
1289 else if(newValtype2 == 'L')
1290 {
1291 return CompareDouble(newVal[i].D, op, newVal[iii].L);
1292 }
1293 else if(newValtype2 == 'D')
1294 {
1295 return CompareDouble(newVal[i].D, op, newVal[iii].D);
1296 }
1297 //===================================================================
1298 }
1299 break;
1300 default:;
1301 }
1302 }
1303 if(arg2.type == IDENTIFIER)
1304 {
1305 unsigned i = IndexOf(arg2.S);
1306 newValtype = toupper(parameter[i]->GetParameterType());
1307 switch(newValtype)
1308 {
1309 case 'I':
1310 if(arg1.type == CONSTINT)
1311 {
1312 return CompareInt(arg1.I, op, newVal[i].I);
1313 }
1314 else
1315 {
1316 G4cerr << "integer operand expected for " << rangeString << '.'
1317 << G4endl;
1318 }
1319 break;
1320 case 'L':
1321 if(arg1.type == CONSTLONG)
1322 {
1323 return CompareLong(arg1.L, op, newVal[i].L);
1324 }
1325 else
1326 {
1327 G4cerr << "long int operand expected for " << rangeString << '.'
1328 << G4endl;
1329 }
1330 break;
1331 case 'D':
1332 if(arg1.type == CONSTDOUBLE)
1333 {
1334 return CompareDouble(arg1.D, op, newVal[i].D);
1335 }
1336 else if(arg1.type == CONSTINT)
1337 { // integral promotion
1338 return CompareDouble(arg1.I, op, newVal[i].D);
1339 }
1340 break;
1341 default:;
1342 }
1343 }
1344 return 0;
1345}
G4double D(G4double temp)
static constexpr double L
Definition: G4SIunits.hh:104
G4String commandName
Definition: G4UIcommand.hh:269
unsigned IndexOf(const char *)
G4int CompareDouble(G4double arg1, G4int op, G4double arg2)
std::vector< G4UIparameter * > parameter
Definition: G4UIcommand.hh:271
G4int CompareInt(G4int arg1, G4int op, G4int arg2)
G4int CompareLong(G4long arg1, G4int op, G4long arg2)
std::vector< yystype > newVal
Definition: G4UIcommand.hh:279

References G4UIcommand::commandName, G4UIcommand::CompareDouble(), G4UIcommand::CompareInt(), G4UIcommand::CompareLong(), G4UItokenNum::CONSTDOUBLE, G4UItokenNum::CONSTINT, G4UItokenNum::CONSTLONG, G4UItokenNum::yystype::D, D(), G4cerr, G4endl, G4UItokenNum::yystype::I, G4UItokenNum::IDENTIFIER, G4UIcommand::IndexOf(), L, G4UItokenNum::yystype::L, G4UIcommand::newVal, G4UIcommand::paramERR, G4UIcommand::parameter, G4UIcommand::rangeString, G4UItokenNum::yystype::S, and G4UItokenNum::yystype::type.

Referenced by G4UIcommand::EqualityExpression(), and G4UIcommand::RelationalExpression().

◆ ExpectExponent()

G4int G4UIcommand::ExpectExponent ( const char *  str)
privateinherited

Definition at line 726 of file G4UIcommand.cc.

727{
728 G4int maxExplength;
729 if(IsInt(str, maxExplength = 7))
730 return 1;
731 else
732 return 0;
733}
G4int IsInt(const char *str, short maxLength)
Definition: G4UIcommand.cc:689

References G4UIcommand::IsInt().

Referenced by G4UIcommand::IsDouble().

◆ Expression()

yystype G4UIcommand::Expression ( void  )
privateinherited

Definition at line 897 of file G4UIcommand.cc.

898{
899 yystype result;
900#ifdef DEBUG
901 G4cerr << " Expression()" << G4endl;
902#endif
903 result = LogicalORExpression();
904 return result;
905}
yystype LogicalORExpression(void)
Definition: G4UIcommand.cc:908

References G4cerr, G4endl, and G4UIcommand::LogicalORExpression().

Referenced by G4UIcommand::PrimaryExpression(), and G4UIcommand::RangeCheck().

◆ Follow()

G4int G4UIcommand::Follow ( G4int  expect,
G4int  ifyes,
G4int  ifno 
)
privateinherited

Definition at line 1581 of file G4UIcommand.cc.

1582{
1583 G4int c = G4UIpGetc();
1584 if(c == expect)
1585 return ifyes;
1586 G4UIpUngetc(c);
1587 return ifno;
1588}
G4int G4UIpUngetc(G4int c)
G4int G4UIpGetc(void)

References G4UIcommand::G4UIpGetc(), and G4UIcommand::G4UIpUngetc().

Referenced by G4UIcommand::Yylex().

◆ G4UIcommandCommonConstructorCode()

void G4UIcommand::G4UIcommandCommonConstructorCode ( const char *  theCommandPath)
privateinherited

Definition at line 71 of file G4UIcommand.cc.

72{
73 commandPath = theCommandPath;
74 commandName = theCommandPath;
75 G4int commandNameIndex = commandName.rfind('/');
76 commandName.erase(0, commandNameIndex + 1);
77#ifdef G4MULTITHREADED
80 {
81 toBeBroadcasted = false;
83 }
84 else
85 {
87 }
88#else
90#endif
91}
G4bool toBeBroadcasted
Definition: G4UIcommand.hh:219
G4UImessenger * messenger
Definition: G4UIcommand.hh:267
G4String commandPath
Definition: G4UIcommand.hh:268
static G4UImanager * GetMasterUIpointer()
Definition: G4UImanager.cc:91
void AddNewCommand(G4UIcommand *newCommand)
Definition: G4UImanager.cc:271
static G4UImanager * GetUIpointer()
Definition: G4UImanager.cc:77
G4bool CommandsShouldBeInMaster() const
G4bool IsWorkerThread()
Definition: G4Threading.cc:123

References G4UImanager::AddNewCommand(), G4UIcommand::commandName, G4UIcommand::commandPath, G4UImessenger::CommandsShouldBeInMaster(), G4UImanager::GetMasterUIpointer(), G4UImanager::GetUIpointer(), G4Threading::IsWorkerThread(), G4UIcommand::messenger, and G4UIcommand::toBeBroadcasted.

Referenced by G4UIcommand::G4UIcommand().

◆ G4UIpGetc()

G4int G4UIcommand::G4UIpGetc ( void  )
privateinherited

Definition at line 1592 of file G4UIcommand.cc.

1593{ // emulation of getc()
1594 G4int length = rangeString.length();
1595 if(bp < length)
1596 return rangeString[bp++];
1597 else
1598 return EOF;
1599}

References G4UIcommand::bp, and G4UIcommand::rangeString.

Referenced by G4UIcommand::Follow(), and G4UIcommand::Yylex().

◆ G4UIpUngetc()

G4int G4UIcommand::G4UIpUngetc ( G4int  c)
privateinherited

Definition at line 1602 of file G4UIcommand.cc.

1603{ // emulation of ungetc()
1604 if(c < 0)
1605 return -1;
1606 if(bp > 0 && c == rangeString[bp - 1])
1607 {
1608 --bp;
1609 }
1610 else
1611 {
1612 G4cerr << "G4UIpUngetc() failed." << G4endl;
1613 G4cerr << "bp=" << bp << " c=" << c << " pR(bp-1)=" << rangeString[bp - 1]
1614 << G4endl;
1615 paramERR = 1;
1616 return -1;
1617 }
1618 return 0;
1619}

References G4UIcommand::bp, G4cerr, G4endl, G4UIcommand::paramERR, and G4UIcommand::rangeString.

Referenced by G4UIcommand::Follow(), and G4UIcommand::Yylex().

◆ GetCommandName()

const G4String & G4UIcommand::GetCommandName ( ) const
inlineinherited

◆ GetCommandPath()

const G4String & G4UIcommand::GetCommandPath ( ) const
inlineinherited

◆ GetCommandType()

CommandType G4UIcommand::GetCommandType ( ) const
inlineinherited

Definition at line 204 of file G4UIcommand.hh.

205 { return commandType; }
CommandType commandType
Definition: G4UIcommand.hh:266

References G4UIcommand::commandType.

◆ GetCurrentValue()

G4String G4UIcommand::GetCurrentValue ( )
inherited

Definition at line 282 of file G4UIcommand.cc.

283{
284 return messenger->GetCurrentValue(this);
285}
virtual G4String GetCurrentValue(G4UIcommand *command)

References G4UImessenger::GetCurrentValue(), and G4UIcommand::messenger.

Referenced by export_G4UIcommand(), and G4UImanager::GetCurrentValues().

◆ GetFailureDescription()

const G4String & G4UIcommand::GetFailureDescription ( )
inlineinherited

Definition at line 190 of file G4UIcommand.hh.

190{return failureDescription;}

References G4UIcommand::failureDescription.

Referenced by G4UImanager::ApplyCommand().

◆ GetGuidanceEntries()

std::size_t G4UIcommand::GetGuidanceEntries ( ) const
inlineinherited

◆ GetGuidanceLine()

const G4String & G4UIcommand::GetGuidanceLine ( G4int  i) const
inlineinherited

◆ GetMessenger()

G4UImessenger * G4UIcommand::GetMessenger ( ) const
inlineinherited

Definition at line 144 of file G4UIcommand.hh.

144{ return messenger; }

References G4UIcommand::messenger.

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

◆ GetNewDoubleRawValue()

G4double G4UIcmdWithADoubleAndUnit::GetNewDoubleRawValue ( const char *  paramString)
static

Definition at line 100 of file G4UIcmdWithADoubleAndUnit.cc.

102{
103 G4double vl;
104 char unts[30];
105
106 std::istringstream is(paramString);
107 is >> vl >> unts;
108
109 return vl;
110}

◆ GetNewDoubleValue()

G4double G4UIcmdWithADoubleAndUnit::GetNewDoubleValue ( const char *  paramString)
static

◆ GetNewUnitValue()

G4double G4UIcmdWithADoubleAndUnit::GetNewUnitValue ( const char *  paramString)
static

Definition at line 113 of file G4UIcmdWithADoubleAndUnit.cc.

114{
115 G4double vl;
116 char unts[30];
117
118 std::istringstream is(paramString);
119 is >> vl >> unts;
120 G4String unt = unts;
121
122 return ValueOf(unt);
123}

References G4UIcommand::ValueOf().

Referenced by G4GeometryMessenger::SetNewValue().

◆ GetParameter()

G4UIparameter * G4UIcommand::GetParameter ( G4int  i) const
inlineinherited

Definition at line 139 of file G4UIcommand.hh.

139{ return parameter[i]; }

References G4UIcommand::parameter.

Referenced by ConvertToStringWithBestUnit(), G4UIcmdWith3VectorAndUnit::ConvertToStringWithBestUnit(), ConvertToStringWithDefaultUnit(), G4UIcmdWith3VectorAndUnit::ConvertToStringWithDefaultUnit(), G4VVisCommand::CopyParametersFrom(), G4UIQt::CreateCommandWidget(), G4UIQt::CreateCompleterModel(), G4UIcommandTree::CreateHTML(), G4UIcmdWith3VectorAndUnit::DoIt(), DoIt(), G4UIterminal::ExecuteCommand(), export_G4UIcommand(), G4UIQt::GetCommandList(), G4OpenGLQtViewer::GetCommandParameterList(), G4UImanager::GetCurrentStringValue(), G4UIQt::IsGUICommand(), G4UIcmdWithAString::SetCandidates(), G4UIcmdWith3VectorAndUnit::SetDefaultUnit(), SetDefaultUnit(), G4UIcmdWithAString::SetDefaultValue(), G4UIcmdWithABool::SetDefaultValue(), G4UIcmdWithADouble::SetDefaultValue(), SetDefaultValue(), G4UIcmdWithAnInteger::SetDefaultValue(), G4UIcmdWithALongInt::SetDefaultValue(), G4UIcmdWithNucleusLimits::SetDefaultValue(), G4UIcmdWith3Vector::SetDefaultValue(), G4UIcmdWith3VectorAndUnit::SetDefaultValue(), G4UIcmdWithABool::SetParameterName(), G4UIcmdWithADouble::SetParameterName(), SetParameterName(), G4UIcmdWithALongInt::SetParameterName(), G4UIcmdWithAnInteger::SetParameterName(), G4UIcmdWithAString::SetParameterName(), G4UIcmdWithNucleusLimits::SetParameterName(), G4UIcmdWith3Vector::SetParameterName(), G4UIcmdWith3VectorAndUnit::SetParameterName(), G4GenericMessenger::Command::SetUnit(), G4UIcmdWith3VectorAndUnit::SetUnitCandidates(), SetUnitCandidates(), G4UIQt::updateHelpArea(), and G4OpenGLQtViewer::updateViewerPropertiesTableWidget().

◆ GetParameterEntries()

std::size_t G4UIcommand::GetParameterEntries ( ) const
inlineinherited

◆ GetRange()

const G4String & G4UIcommand::GetRange ( ) const
inlineinherited

◆ GetStateList()

std::vector< G4ApplicationState > * G4UIcommand::GetStateList ( )
inlineinherited

Definition at line 140 of file G4UIcommand.hh.

141 {
142 return &availabelStateList;
143 }

References G4UIcommand::availabelStateList.

Referenced by G4UIcommandTree::CreateHTML(), and pyG4UIcommand::f_GetStateList().

◆ GetTitle()

const G4String G4UIcommand::GetTitle ( ) const
inlineinherited

Definition at line 165 of file G4UIcommand.hh.

166 {
167 return (commandGuidance.size() == 0)
168 ? G4String("...Title not available...")
169 : commandGuidance[0];
170 }

References G4UIcommand::commandGuidance.

Referenced by export_G4UIcommand(), and G4UIcommandTree::GetTitle().

◆ IfCommandFailed()

G4int G4UIcommand::IfCommandFailed ( )
inlineinherited

Definition at line 189 of file G4UIcommand.hh.

189{ return commandFailureCode; }

References G4UIcommand::commandFailureCode.

Referenced by G4UImanager::ApplyCommand().

◆ IndexOf()

unsigned G4UIcommand::IndexOf ( const char *  nam)
privateinherited

Definition at line 1474 of file G4UIcommand.cc.

1475{
1476 unsigned i;
1478 for(i = 0; i < parameter.size(); ++i)
1479 {
1480 pname = parameter[i]->GetParameterName();
1481 if(pname == nam)
1482 {
1483 return i;
1484 }
1485 }
1486 paramERR = 1;
1487 G4cerr << "parameter name:" << nam << " not found." << G4endl;
1488 return 0;
1489}
string pname
Definition: eplot.py:33

References G4cerr, G4endl, G4UIcommand::paramERR, G4UIcommand::parameter, and eplot::pname.

Referenced by G4UIcommand::Eval2().

◆ IsAvailable()

G4bool G4UIcommand::IsAvailable ( )
inherited

Definition at line 343 of file G4UIcommand.cc.

344{
345 G4bool av = false;
346 G4ApplicationState currentState =
348
349 G4int nState = availabelStateList.size();
350 for(G4int i = 0; i < nState; ++i)
351 {
352 if(availabelStateList[i] == currentState)
353 {
354 av = true;
355 break;
356 }
357 }
358
359 return av;
360}
G4ApplicationState
const G4ApplicationState & GetCurrentState() const
static G4StateManager * GetStateManager()

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

Referenced by G4UImanager::ApplyCommand(), and export_G4UIcommand().

◆ IsDouble()

G4int G4UIcommand::IsDouble ( const char *  str)
privateinherited

Definition at line 736 of file G4UIcommand.cc.

737{
738 const char* p = buf;
739 switch(*p)
740 {
741 case '+':
742 case '-':
743 ++p;
744 if(isdigit(*p))
745 {
746 while(isdigit((G4int)(*p)))
747 {
748 ++p;
749 }
750 switch(*p)
751 {
752 case '\0':
753 return 1;
754 // break;
755 case 'E':
756 case 'e':
757 return ExpectExponent(++p);
758 // break;
759 case '.':
760 ++p;
761 if(*p == '\0')
762 return 1;
763 if(*p == 'e' || *p == 'E')
764 return ExpectExponent(++p);
765 if(isdigit(*p))
766 {
767 while(isdigit((G4int)(*p)))
768 {
769 ++p;
770 }
771 if(*p == '\0')
772 return 1;
773 if(*p == 'e' || *p == 'E')
774 return ExpectExponent(++p);
775 }
776 else
777 return 0;
778 break;
779 default:
780 return 0;
781 }
782 }
783 if(*p == '.')
784 {
785 ++p;
786 if(isdigit(*p))
787 {
788 while(isdigit((G4int)(*p)))
789 {
790 ++p;
791 }
792 if(*p == '\0')
793 return 1;
794 if(*p == 'e' || *p == 'E')
795 return ExpectExponent(++p);
796 }
797 }
798 break;
799 case '.':
800 ++p;
801 if(isdigit(*p))
802 {
803 while(isdigit((G4int)(*p)))
804 {
805 ++p;
806 }
807 if(*p == '\0')
808 return 1;
809 if(*p == 'e' || *p == 'E')
810 return ExpectExponent(++p);
811 }
812 break;
813 default: // digit is expected
814 if(isdigit(*p))
815 {
816 while(isdigit((G4int)(*p)))
817 {
818 ++p;
819 }
820 if(*p == '\0')
821 return 1;
822 if(*p == 'e' || *p == 'E')
823 return ExpectExponent(++p);
824 if(*p == '.')
825 {
826 ++p;
827 if(*p == '\0')
828 return 1;
829 if(*p == 'e' || *p == 'E')
830 return ExpectExponent(++p);
831 if(isdigit(*p))
832 {
833 while(isdigit((G4int)(*p)))
834 {
835 ++p;
836 }
837 if(*p == '\0')
838 return 1;
839 if(*p == 'e' || *p == 'E')
840 return ExpectExponent(++p);
841 }
842 }
843 }
844 }
845 return 0;
846}
G4int ExpectExponent(const char *str)
Definition: G4UIcommand.cc:726

References G4UIcommand::ExpectExponent().

Referenced by G4UIcommand::TypeCheck(), and G4UIcommand::Yylex().

◆ IsInt()

G4int G4UIcommand::IsInt ( const char *  str,
short  maxLength 
)
privateinherited

Definition at line 689 of file G4UIcommand.cc.

690{
691 const char* p = buf;
692 G4int length = 0;
693 if(*p == '+' || *p == '-')
694 {
695 ++p;
696 }
697 if(isdigit((G4int)(*p)))
698 {
699 while(isdigit((G4int)(*p)))
700 {
701 ++p;
702 ++length;
703 }
704 if(*p == '\0')
705 {
706 if(length > maxDigits)
707 {
708 G4cerr << "digit length exceeds" << G4endl;
709 return 0;
710 }
711 return 1;
712 }
713 else
714 {
715 // G4cerr <<"illegal character after int:"<<buf<<G4endl;
716 }
717 }
718 else
719 {
720 // G4cerr <<"illegal int:"<<buf<<G4endl;
721 }
722 return 0;
723}

References G4cerr, and G4endl.

Referenced by G4UIcommand::ExpectExponent(), G4UIcommand::TypeCheck(), and G4UIcommand::Yylex().

◆ IsParameter()

unsigned G4UIcommand::IsParameter ( const char *  nam)
privateinherited

Definition at line 1492 of file G4UIcommand.cc.

1493{
1495 for(unsigned i = 0; i < parameter.size(); ++i)
1496 {
1497 pname = parameter[i]->GetParameterName();
1498 if(pname == nam)
1499 return 1;
1500 }
1501 return 0;
1502}

References G4UIcommand::parameter, and eplot::pname.

Referenced by G4UIcommand::Yylex().

◆ IsWorkerThreadOnly()

G4bool G4UIcommand::IsWorkerThreadOnly ( ) const
inlineinherited

Definition at line 177 of file G4UIcommand.hh.

177{ return workerThreadOnly; }
G4bool workerThreadOnly
Definition: G4UIcommand.hh:221

References G4UIcommand::workerThreadOnly.

Referenced by G4UIcommandTree::RemoveCommand().

◆ List()

void G4UIcommand::List ( )
virtualinherited

Definition at line 410 of file G4UIcommand.cc.

411{
412 G4cout << G4endl;
413 G4cout << G4endl;
414 if(commandPath.back() != '/')
415 {
416 G4cout << "Command " << commandPath << G4endl;
417 }
419 {
420 G4cout << " ---- available only in worker thread" << G4endl;
421 }
422 G4cout << "Guidance :" << G4endl;
423 G4int n_guidanceEntry = commandGuidance.size();
424 for(G4int i_thGuidance = 0; i_thGuidance < n_guidanceEntry; ++i_thGuidance)
425 {
426 G4cout << commandGuidance[i_thGuidance] << G4endl;
427 }
428 if(!rangeString.empty())
429 {
430 G4cout << " Range of parameters : " << rangeString << G4endl;
431 }
432 G4int n_parameterEntry = parameter.size();
433 if(n_parameterEntry > 0)
434 {
435 for(G4int i_thParameter = 0; i_thParameter < n_parameterEntry;
436 ++i_thParameter)
437 {
438 parameter[i_thParameter]->List();
439 }
440 }
441 G4cout << G4endl;
442}
G4GLOB_DLL std::ostream G4cout

References G4UIcommand::commandGuidance, G4UIcommand::commandPath, G4cout, G4endl, G4UIcommand::parameter, G4UIcommand::rangeString, and G4UIcommand::workerThreadOnly.

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

◆ LogicalANDExpression()

yystype G4UIcommand::LogicalANDExpression ( void  )
privateinherited

Definition at line 953 of file G4UIcommand.cc.

954{
955 yystype result;
956 yystype p;
957 p = EqualityExpression();
958 if(token != LOGICALAND)
959 return p;
960 if(p.type == CONSTSTRING || p.type == IDENTIFIER)
961 {
962 G4cerr << "Parameter range: illegal type at '&&'" << G4endl;
963 paramERR = 1;
964 }
965 result.I = p.I;
966 while(token == LOGICALAND)
967 {
968 token = Yylex();
969 p = EqualityExpression();
970 if(p.type == CONSTSTRING || p.type == IDENTIFIER)
971 {
972 G4cerr << "Parameter range: illegal type at '&&'" << G4endl;
973 paramERR = 1;
974 }
975 switch(p.type)
976 {
977 case CONSTINT:
978 result.I *= p.I;
979 result.type = CONSTINT;
980 break;
981 case CONSTLONG:
982 result.I *= (p.L != 0L);
983 result.type = CONSTINT;
984 break;
985 case CONSTDOUBLE:
986 result.I *= (p.D != 0.0);
987 result.type = CONSTINT;
988 break;
989 default:
990 G4cerr << "Parameter range: unknown type." << G4endl;
991 paramERR = 1;
992 }
993 }
994 return result;
995}
yystype EqualityExpression(void)
Definition: G4UIcommand.cc:998

References G4UItokenNum::CONSTDOUBLE, G4UItokenNum::CONSTINT, G4UItokenNum::CONSTLONG, G4UItokenNum::CONSTSTRING, G4UItokenNum::yystype::D, G4UIcommand::EqualityExpression(), G4cerr, G4endl, G4UItokenNum::yystype::I, G4UItokenNum::IDENTIFIER, L, G4UItokenNum::yystype::L, G4UItokenNum::LOGICALAND, G4UIcommand::paramERR, G4UIcommand::token, G4UItokenNum::yystype::type, and G4UIcommand::Yylex().

Referenced by G4UIcommand::LogicalORExpression().

◆ LogicalORExpression()

yystype G4UIcommand::LogicalORExpression ( void  )
privateinherited

Definition at line 908 of file G4UIcommand.cc.

909{
910 yystype result;
911 yystype p;
913 if(token != LOGICALOR)
914 return p;
915 if(p.type == CONSTSTRING || p.type == IDENTIFIER)
916 {
917 G4cerr << "Parameter range: illegal type at '||'" << G4endl;
918 paramERR = 1;
919 }
920 result.I = p.I;
921 while(token == LOGICALOR)
922 {
923 token = Yylex();
925 if(p.type == CONSTSTRING || p.type == IDENTIFIER)
926 {
927 G4cerr << "Parameter range: illegal type at '||'" << G4endl;
928 paramERR = 1;
929 }
930 switch(p.type)
931 {
932 case CONSTINT:
933 result.I += p.I;
934 result.type = CONSTINT;
935 break;
936 case CONSTLONG:
937 result.I += (p.L != 0L);
938 result.type = CONSTINT;
939 break;
940 case CONSTDOUBLE:
941 result.I += (p.D != 0.0);
942 result.type = CONSTINT;
943 break;
944 default:
945 G4cerr << "Parameter range: unknown type" << G4endl;
946 paramERR = 1;
947 }
948 }
949 return result;
950}
yystype LogicalANDExpression(void)
Definition: G4UIcommand.cc:953

References G4UItokenNum::CONSTDOUBLE, G4UItokenNum::CONSTINT, G4UItokenNum::CONSTLONG, G4UItokenNum::CONSTSTRING, G4UItokenNum::yystype::D, G4cerr, G4endl, G4UItokenNum::yystype::I, G4UItokenNum::IDENTIFIER, L, G4UItokenNum::yystype::L, G4UIcommand::LogicalANDExpression(), G4UItokenNum::LOGICALOR, G4UIcommand::paramERR, G4UIcommand::token, G4UItokenNum::yystype::type, and G4UIcommand::Yylex().

Referenced by G4UIcommand::Expression().

◆ MultiplicativeExpression()

yystype G4UIcommand::MultiplicativeExpression ( void  )
privateinherited

Definition at line 1076 of file G4UIcommand.cc.

1077{
1078 yystype result;
1079 result = UnaryExpression();
1080 if(token != '*' && token != '/' && token != '%')
1081 return result;
1082 G4cerr << "Parameter range: operator " << (char) token << " is not supported."
1083 << G4endl;
1084 paramERR = 1;
1085 return result;
1086}
yystype UnaryExpression(void)

References G4cerr, G4endl, G4UIcommand::paramERR, G4UIcommand::token, and G4UIcommand::UnaryExpression().

Referenced by G4UIcommand::AdditiveExpression().

◆ operator!=()

G4bool G4UIcommand::operator!= ( const G4UIcommand right) const
inherited

Definition at line 145 of file G4UIcommand.cc.

146{
147 return (commandPath != right.GetCommandPath());
148}
const G4String & GetCommandPath() const
Definition: G4UIcommand.hh:136

References G4UIcommand::commandPath, and G4UIcommand::GetCommandPath().

◆ operator==()

G4bool G4UIcommand::operator== ( const G4UIcommand right) const
inherited

Definition at line 139 of file G4UIcommand.cc.

140{
141 return (commandPath == right.GetCommandPath());
142}

References G4UIcommand::commandPath, and G4UIcommand::GetCommandPath().

◆ PrimaryExpression()

yystype G4UIcommand::PrimaryExpression ( void  )
privateinherited

Definition at line 1135 of file G4UIcommand.cc.

1136{
1137 yystype result;
1138#ifdef DEBUG
1139 G4cerr << " primary_exp" << G4endl;
1140#endif
1141 switch(token)
1142 {
1143 case IDENTIFIER:
1144 result.S = yylval.S;
1145 result.type = token;
1146 token = Yylex();
1147 break;
1148 case CONSTINT:
1149 result.I = yylval.I;
1150 result.type = token;
1151 token = Yylex();
1152 break;
1153 case CONSTLONG:
1154 result.L = yylval.L;
1155 result.type = token;
1156 token = Yylex();
1157 break;
1158 case CONSTDOUBLE:
1159 result.D = yylval.D;
1160 result.type = token;
1161 token = Yylex();
1162 break;
1163 case '(':
1164 token = Yylex();
1165 result = Expression();
1166 if(token != ')')
1167 {
1168 G4cerr << " ')' expected" << G4endl;
1169 paramERR = 1;
1170 }
1171 token = Yylex();
1172 break;
1173 default:
1174 return result;
1175 }
1176 return result; // never executed
1177}
yystype yylval
Definition: G4UIcommand.hh:278
yystype Expression(void)
Definition: G4UIcommand.cc:897

References G4UItokenNum::CONSTDOUBLE, G4UItokenNum::CONSTINT, G4UItokenNum::CONSTLONG, G4UItokenNum::yystype::D, G4UIcommand::Expression(), G4cerr, G4endl, G4UItokenNum::yystype::I, G4UItokenNum::IDENTIFIER, G4UItokenNum::yystype::L, G4UIcommand::paramERR, G4UItokenNum::yystype::S, G4UIcommand::token, G4UItokenNum::yystype::type, G4UIcommand::Yylex(), and G4UIcommand::yylval.

Referenced by G4UIcommand::UnaryExpression().

◆ RangeCheck()

G4int G4UIcommand::RangeCheck ( const char *  t)
privateinherited

Definition at line 849 of file G4UIcommand.cc.

850{
851 yystype result;
852 char type;
853 bp = 0; // reset buffer pointer for G4UIpGetc()
854 std::istringstream is(t);
855 for(unsigned i = 0; i < parameter.size(); ++i)
856 {
857 type = toupper(parameter[i]->GetParameterType());
858 switch(type)
859 {
860 case 'D':
861 is >> newVal[i].D;
862 break;
863 case 'I':
864 is >> newVal[i].I;
865 break;
866 case 'L':
867 is >> newVal[i].L;
868 break;
869 case 'S':
870 is >> newVal[i].S;
871 break;
872 case 'B':
873 is >> newVal[i].C;
874 break;
875 default:;
876 }
877 }
878 // PrintToken(); // Print tokens (consumes all tokens)
879 token = Yylex();
880 result = Expression();
881
882 if(paramERR == 1)
883 return 0;
884 if(result.type != CONSTINT)
885 {
886 G4cerr << "Illegal Expression in parameter range." << G4endl;
887 return 0;
888 }
889 if(result.I)
890 return 1;
891 G4cerr << "parameter out of range: " << rangeString << G4endl;
892 return 0;
893}

References G4UIcommand::bp, G4UItokenNum::CONSTINT, G4UIcommand::Expression(), G4cerr, G4endl, G4UItokenNum::yystype::I, G4UIcommand::newVal, G4UIcommand::paramERR, G4UIcommand::parameter, G4UIcommand::rangeString, G4UIcommand::token, G4UItokenNum::yystype::type, and G4UIcommand::Yylex().

Referenced by G4UIcommand::CheckNewValue().

◆ RelationalExpression()

yystype G4UIcommand::RelationalExpression ( void  )
privateinherited

Definition at line 1031 of file G4UIcommand.cc.

1032{
1033 yystype arg1, arg2;
1034 G4int operat;
1035 yystype result;
1036#ifdef DEBUG
1037 G4cerr << " RelationalExpression()" << G4endl;
1038#endif
1039
1040 arg1 = AdditiveExpression();
1041 if(token == GT || token == GE || token == LT || token == LE)
1042 {
1043 operat = token;
1044 token = Yylex();
1045 arg2 = AdditiveExpression();
1046 result.I = Eval2(arg1, operat, arg2); // semantic action
1047 result.type = CONSTINT;
1048#ifdef DEBUG
1049 G4cerr << " return code of Eval2(): " << result.I << G4endl;
1050#endif
1051 }
1052 else
1053 {
1054 result = arg1;
1055 }
1056#ifdef DEBUG
1057 G4cerr << " return RelationalExpression()" << G4endl;
1058#endif
1059 return result;
1060}
yystype AdditiveExpression(void)

References G4UIcommand::AdditiveExpression(), G4UItokenNum::CONSTINT, G4UIcommand::Eval2(), G4cerr, G4endl, GE, GT, G4UItokenNum::yystype::I, LE, LT, G4UIcommand::token, G4UItokenNum::yystype::type, and G4UIcommand::Yylex().

Referenced by G4UIcommand::EqualityExpression().

◆ ResetFailure()

void G4UIcommand::ResetFailure ( )
inlineinherited

◆ SetCommandType()

void G4UIcommand::SetCommandType ( CommandType  typ)
inherited

Definition at line 94 of file G4UIcommand.cc.

95{
96 if(messenger==nullptr)
97 { // this must be a directory
98 if(typ != CmdDirectory)
99 {
101 ed << "A UI command <" << commandPath
102 << "> is defined without vaild messenger.";
103 G4Exception("G4UIcommand::SetCommandType","UI2031",
104 FatalException,ed);
105 }
106 else if(commandPath.back() != '/')
107 {
109 ed << "G4UIcommand Warning : \n"
110 << " <" << commandPath << "> must be a directory."
111 << " '/' is appended.";
112 G4Exception("G4UIcommand::SetCommandType","UI2032",
113 JustWarning,ed);
114 commandPath += "/";
115 }
116 }
118}
@ JustWarning
@ FatalException
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
Definition: G4Exception.cc:35
std::ostringstream G4ExceptionDescription
Definition: G4Exception.hh:40
G4ProcessVectorTypeIndex typ

References G4UIcommand::CmdDirectory, G4UIcommand::commandPath, G4UIcommand::commandType, FatalException, G4Exception(), JustWarning, G4UIcommand::messenger, and pyG4ProcessManager::typ.

Referenced by G4UIcmdWith3Vector::G4UIcmdWith3Vector(), G4UIcmdWith3VectorAndUnit::G4UIcmdWith3VectorAndUnit(), G4UIcmdWithABool::G4UIcmdWithABool(), G4UIcmdWithADouble::G4UIcmdWithADouble(), G4UIcmdWithADoubleAndUnit(), G4UIcmdWithALongInt::G4UIcmdWithALongInt(), G4UIcmdWithAnInteger::G4UIcmdWithAnInteger(), G4UIcmdWithAString::G4UIcmdWithAString(), G4UIcmdWithoutParameter::G4UIcmdWithoutParameter(), and G4UIdirectory::G4UIdirectory().

◆ SetDefaultSortFlag()

void G4UIcommand::SetDefaultSortFlag ( G4bool  val)
inlineinherited

Definition at line 208 of file G4UIcommand.hh.

209 { ifSort = val; }
G4bool ifSort
Definition: G4UIcommand.hh:226

References G4UIcommand::ifSort.

Referenced by G4UIcommandTree::AddNewCommand().

◆ SetDefaultUnit()

void G4UIcmdWithADoubleAndUnit::SetDefaultUnit ( const char *  defUnit)

◆ SetDefaultValue()

void G4UIcmdWithADoubleAndUnit::SetDefaultValue ( G4double  defVal)

◆ SetGuidance()

void G4UIcommand::SetGuidance ( const char *  aGuidance)
inlineinherited

Definition at line 156 of file G4UIcommand.hh.

161 {
162 commandGuidance.push_back(G4String(aGuidance));
163 }

References G4UIcommand::commandGuidance.

Referenced by G4VVisCommand::CopyGuidanceFrom(), G4CascadeParamMessenger::CreateDirectory(), G4UImessenger::CreateDirectory(), G4GenericMessenger::DeclareMethod(), G4GenericMessenger::DeclareMethodWithUnit(), G4GenericMessenger::DeclareProperty(), G4GenericMessenger::DeclarePropertyWithUnit(), DetectorMessenger::DetectorMessenger(), ExN03DetectorMessenger::ExN03DetectorMessenger(), G4ScoreQuantityMessenger::FilterCommands(), G4AdjointSimMessenger::G4AdjointSimMessenger(), G4DecayTableMessenger::G4DecayTableMessenger(), G4DeexParametersMessenger::G4DeexParametersMessenger(), G4DMmessenger::G4DMmessenger(), G4EmExtraParametersMessenger::G4EmExtraParametersMessenger(), G4EmLowEParametersMessenger::G4EmLowEParametersMessenger(), G4EmMessenger::G4EmMessenger(), G4EmParametersMessenger::G4EmParametersMessenger(), G4ErrorMessenger::G4ErrorMessenger(), G4EvManMessenger::G4EvManMessenger(), G4FastSimulationMessenger::G4FastSimulationMessenger(), G4GDMLMessenger::G4GDMLMessenger(), G4GeneralParticleSourceMessenger::G4GeneralParticleSourceMessenger(), G4GenericMessenger::G4GenericMessenger(), G4GeometryMessenger::G4GeometryMessenger(), G4GlobalMagFieldMessenger::G4GlobalMagFieldMessenger(), G4GMocrenMessenger::G4GMocrenMessenger(), G4HadronicEPTestMessenger::G4HadronicEPTestMessenger(), G4HadronicParametersMessenger::G4HadronicParametersMessenger(), G4HepRepMessenger::G4HepRepMessenger(), G4INCLXXInterfaceMessenger::G4INCLXXInterfaceMessenger(), G4InteractorMessenger::G4InteractorMessenger(), G4LocalThreadCoutMessenger::G4LocalThreadCoutMessenger(), 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(), G4NuclideTableMessenger::G4NuclideTableMessenger(), G4OpenGLViewerMessenger::G4OpenGLViewerMessenger(), G4OpenGLXmViewerMessenger::G4OpenGLXmViewerMessenger(), G4OpenInventorXtExaminerViewerMessenger::G4OpenInventorXtExaminerViewerMessenger(), G4OpticalParametersMessenger::G4OpticalParametersMessenger(), G4ParticleGunMessenger::G4ParticleGunMessenger(), G4ParticleHPMessenger::G4ParticleHPMessenger(), G4ParticleMessenger::G4ParticleMessenger(), G4ParticlePropertyMessenger::G4ParticlePropertyMessenger(), G4PersistencyCenterMessenger::G4PersistencyCenterMessenger(), G4PhysListFactoryMessenger::G4PhysListFactoryMessenger(), G4PolarizationMessenger::G4PolarizationMessenger(), G4ProcessManagerMessenger::G4ProcessManagerMessenger(), G4ProcessTableMessenger::G4ProcessTableMessenger(), G4ProductionCutsTableMessenger::G4ProductionCutsTableMessenger(), G4ProfilerMessenger::G4ProfilerMessenger(), G4RadioactivationMessenger::G4RadioactivationMessenger(), G4RadioactiveDecayMessenger::G4RadioactiveDecayMessenger(), G4RTMessenger::G4RTMessenger(), G4RunMessenger::G4RunMessenger(), G4SchedulerMessenger::G4SchedulerMessenger(), G4ScoringMessenger::G4ScoringMessenger(), G4SDmessenger::G4SDmessenger(), G4StackingMessenger::G4StackingMessenger(), G4tgrMessenger::G4tgrMessenger(), G4TrackingMessenger::G4TrackingMessenger(), G4UCNBoundaryProcessMessenger::G4UCNBoundaryProcessMessenger(), G4UIcontrolMessenger::G4UIcontrolMessenger(), G4UnitsMessenger::G4UnitsMessenger(), G4UserPhysicsListMessenger::G4UserPhysicsListMessenger(), G4VisCommandDrawLogicalVolume::G4VisCommandDrawLogicalVolume(), G4VisCommandDrawTree::G4VisCommandDrawTree(), G4VisCommandDrawView::G4VisCommandDrawView(), G4VisCommandDrawVolume::G4VisCommandDrawVolume(), G4VisCommandGeometrySetColour::G4VisCommandGeometrySetColour(), G4VisCommandGeometrySetDaughtersInvisible::G4VisCommandGeometrySetDaughtersInvisible(), G4VisCommandGeometrySetForceAuxEdgeVisible::G4VisCommandGeometrySetForceAuxEdgeVisible(), G4VisCommandGeometrySetForceCloud::G4VisCommandGeometrySetForceCloud(), 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(), G4VisCommandSceneAddGPS::G4VisCommandSceneAddGPS(), G4VisCommandSetArrow3DLineSegmentsPerCircle::G4VisCommandSetArrow3DLineSegmentsPerCircle(), G4VisCommandSetColour::G4VisCommandSetColour(), G4VisCommandSetExtentForField::G4VisCommandSetExtentForField(), G4VisCommandSetLineWidth::G4VisCommandSetLineWidth(), G4VisCommandSetTextColour::G4VisCommandSetTextColour(), G4VisCommandSetTextLayout::G4VisCommandSetTextLayout(), G4VisCommandSetTextSize::G4VisCommandSetTextSize(), G4VisCommandSetTouchable::G4VisCommandSetTouchable(), G4VisCommandSetVolumeForField::G4VisCommandSetVolumeForField(), G4VisCommandSpecify::G4VisCommandSpecify(), G4VisCommandsTouchable::G4VisCommandsTouchable(), G4VisCommandsTouchableSet::G4VisCommandsTouchableSet(), G4VisCommandsViewerSet::G4VisCommandsViewerSet(), G4VisCommandViewerCentreOn::G4VisCommandViewerCentreOn(), G4VisCommandViewerDefaultHiddenEdge::G4VisCommandViewerDefaultHiddenEdge(), G4VisCommandViewerDefaultStyle::G4VisCommandViewerDefaultStyle(), G4VtkMessenger::G4VtkMessenger(), GFlashShowerModelMessenger::GFlashShowerModelMessenger(), G4ToolsSGSceneHandler::Messenger::Messenger(), G4ToolsSGViewer< SG_SESSION, SG_VIEWER >::Messenger::Messenger(), G4PlotterManager::Messenger::Messenger(), PhysicsListMessenger::PhysicsListMessenger(), G4ScoreQuantityMessenger::QuantityCommands(), G4GenericMessenger::SetGuidance(), G4GenericMessenger::Command::SetGuidance(), G4VisCommandModelCreate< Factory >::SetNewValue(), and G4GenericMessenger::Command::SetUnit().

◆ SetParameter()

void G4UIcommand::SetParameter ( G4UIparameter *const  newParameter)
inlineinherited

Definition at line 146 of file G4UIcommand.hh.

151 {
152 parameter.push_back(newParameter);
153 newVal.resize(parameter.size());
154 }

References G4UIcommand::newVal, and G4UIcommand::parameter.

Referenced by G4VVisCommand::CopyParametersFrom(), G4GenericMessenger::DeclareMethod(), G4GenericMessenger::DeclareProperty(), G4ScoreQuantityMessenger::FilterCommands(), G4AdjointSimMessenger::G4AdjointSimMessenger(), G4EmExtraParametersMessenger::G4EmExtraParametersMessenger(), G4EmLowEParametersMessenger::G4EmLowEParametersMessenger(), G4GeneralParticleSourceMessenger::G4GeneralParticleSourceMessenger(), G4GMocrenMessenger::G4GMocrenMessenger(), G4InteractorMessenger::G4InteractorMessenger(), G4LocalThreadCoutMessenger::G4LocalThreadCoutMessenger(), G4MatScanMessenger::G4MatScanMessenger(), G4ModelCmdApplyColour< M >::G4ModelCmdApplyColour(), G4ModelCmdApplyStringColour< M >::G4ModelCmdApplyStringColour(), G4OpenGLViewerMessenger::G4OpenGLViewerMessenger(), G4OpticalParametersMessenger::G4OpticalParametersMessenger(), G4ParticleGunMessenger::G4ParticleGunMessenger(), G4PolarizationMessenger::G4PolarizationMessenger(), G4ProcessManagerMessenger::G4ProcessManagerMessenger(), G4ProcessTableMessenger::G4ProcessTableMessenger(), G4RadioactiveDecayMessenger::G4RadioactiveDecayMessenger(), G4RunMessenger::G4RunMessenger(), G4ScoringMessenger::G4ScoringMessenger(), G4UIcmdWith3Vector::G4UIcmdWith3Vector(), G4UIcmdWith3VectorAndUnit::G4UIcmdWith3VectorAndUnit(), G4UIcmdWithABool::G4UIcmdWithABool(), G4UIcmdWithADouble::G4UIcmdWithADouble(), G4UIcmdWithADoubleAndUnit(), G4UIcmdWithALongInt::G4UIcmdWithALongInt(), G4UIcmdWithAnInteger::G4UIcmdWithAnInteger(), G4UIcmdWithAString::G4UIcmdWithAString(), G4UIcmdWithNucleusLimits::G4UIcmdWithNucleusLimits(), G4UIcontrolMessenger::G4UIcontrolMessenger(), G4UserPhysicsListMessenger::G4UserPhysicsListMessenger(), G4VisCommandGeometrySetColour::G4VisCommandGeometrySetColour(), G4VisCommandGeometrySetDaughtersInvisible::G4VisCommandGeometrySetDaughtersInvisible(), G4VisCommandGeometrySetForceAuxEdgeVisible::G4VisCommandGeometrySetForceAuxEdgeVisible(), G4VisCommandGeometrySetForceCloud::G4VisCommandGeometrySetForceCloud(), G4VisCommandGeometrySetForceLineSegmentsPerCircle::G4VisCommandGeometrySetForceLineSegmentsPerCircle(), G4VisCommandGeometrySetForceSolid::G4VisCommandGeometrySetForceSolid(), G4VisCommandGeometrySetForceWireframe::G4VisCommandGeometrySetForceWireframe(), G4VisCommandGeometrySetLineStyle::G4VisCommandGeometrySetLineStyle(), G4VisCommandGeometrySetLineWidth::G4VisCommandGeometrySetLineWidth(), G4VisCommandGeometrySetVisibility::G4VisCommandGeometrySetVisibility(), G4VisCommandOpen::G4VisCommandOpen(), G4VisCommandSceneAddArrow::G4VisCommandSceneAddArrow(), G4VisCommandSceneAddAxes::G4VisCommandSceneAddAxes(), G4VisCommandSceneAddLine::G4VisCommandSceneAddLine(), G4VisCommandSceneAddLogicalVolume::G4VisCommandSceneAddLogicalVolume(), G4VisCommandSceneAddLogo::G4VisCommandSceneAddLogo(), G4VisCommandSceneAddPlotter::G4VisCommandSceneAddPlotter(), G4VisCommandSceneAddScale::G4VisCommandSceneAddScale(), G4VisCommandSceneAddText::G4VisCommandSceneAddText(), G4VisCommandSceneAddText2D::G4VisCommandSceneAddText2D(), G4VisCommandSetColour::G4VisCommandSetColour(), G4VisCommandSetExtentForField::G4VisCommandSetExtentForField(), G4VisCommandSetTextColour::G4VisCommandSetTextColour(), G4VisCommandSetTouchable::G4VisCommandSetTouchable(), G4VisCommandSpecify::G4VisCommandSpecify(), G4VisCommandsTouchableSet::G4VisCommandsTouchableSet(), G4VisCommandsViewerSet::G4VisCommandsViewerSet(), G4VisCommandViewerAddCutawayPlane::G4VisCommandViewerAddCutawayPlane(), G4VisCommandViewerCentreOn::G4VisCommandViewerCentreOn(), G4VisCommandViewerChangeCutawayPlane::G4VisCommandViewerChangeCutawayPlane(), G4VisCommandViewerColourByDensity::G4VisCommandViewerColourByDensity(), G4VtkMessenger::G4VtkMessenger(), G4ToolsSGViewer< SG_SESSION, SG_VIEWER >::Messenger::Messenger(), G4PlotterManager::Messenger::Messenger(), and G4ScoreQuantityMessenger::QuantityCommands().

◆ SetParameterName()

void G4UIcmdWithADoubleAndUnit::SetParameterName ( const char *  theName,
G4bool  omittable,
G4bool  currentAsDefault = false 
)

Definition at line 156 of file G4UIcmdWithADoubleAndUnit.cc.

159{
160 G4UIparameter* theParam = GetParameter(0);
161 theParam->SetParameterName(theName);
162 theParam->SetOmittable(omittable);
163 theParam->SetCurrentAsDefault(currentAsDefault);
164}
void SetCurrentAsDefault(G4bool val)

References G4UIcommand::GetParameter(), G4UIparameter::SetCurrentAsDefault(), G4UIparameter::SetOmittable(), and G4UIparameter::SetParameterName().

Referenced by ExN03DetectorMessenger::ExN03DetectorMessenger(), G4AdjointSimMessenger::G4AdjointSimMessenger(), G4EmMessenger::G4EmMessenger(), G4EmParametersMessenger::G4EmParametersMessenger(), G4GeneralParticleSourceMessenger::G4GeneralParticleSourceMessenger(), G4GeometryMessenger::G4GeometryMessenger(), G4HadronicEPTestMessenger::G4HadronicEPTestMessenger(), G4HadronicParametersMessenger::G4HadronicParametersMessenger(), G4INCLXXInterfaceMessenger::G4INCLXXInterfaceMessenger(), G4ModelCmdApplyDoubleAndUnit< M >::G4ModelCmdApplyDoubleAndUnit(), G4NeutronKillerMessenger::G4NeutronKillerMessenger(), G4NuclideTableMessenger::G4NuclideTableMessenger(), G4OpenGLXmViewerMessenger::G4OpenGLXmViewerMessenger(), G4ParticleGunMessenger::G4ParticleGunMessenger(), G4ParticlePropertyMessenger::G4ParticlePropertyMessenger(), G4ProductionCutsTableMessenger::G4ProductionCutsTableMessenger(), G4RadioactivationMessenger::G4RadioactivationMessenger(), G4RadioactiveDecayMessenger::G4RadioactiveDecayMessenger(), G4RTMessenger::G4RTMessenger(), G4ScoringMessenger::G4ScoringMessenger(), G4UserPhysicsListMessenger::G4UserPhysicsListMessenger(), GFlashShowerModelMessenger::GFlashShowerModelMessenger(), PhysicsListMessenger::PhysicsListMessenger(), and G4GenericMessenger::Command::SetUnit().

◆ SetRange()

void G4UIcommand::SetRange ( const char *  rs)
inlineinherited

Definition at line 120 of file G4UIcommand.hh.

120{ rangeString = rs; }

References G4UIcommand::rangeString.

Referenced by ExN03DetectorMessenger::ExN03DetectorMessenger(), G4DecayTableMessenger::G4DecayTableMessenger(), G4EmParametersMessenger::G4EmParametersMessenger(), G4EvManMessenger::G4EvManMessenger(), G4GeneralParticleSourceMessenger::G4GeneralParticleSourceMessenger(), G4GeometryMessenger::G4GeometryMessenger(), G4GlobalMagFieldMessenger::G4GlobalMagFieldMessenger(), G4HadronicEPTestMessenger::G4HadronicEPTestMessenger(), G4HadronicParametersMessenger::G4HadronicParametersMessenger(), G4HepRepMessenger::G4HepRepMessenger(), G4INCLXXInterfaceMessenger::G4INCLXXInterfaceMessenger(), G4NistMessenger::G4NistMessenger(), G4NuclideTableMessenger::G4NuclideTableMessenger(), G4OpenGLViewerMessenger::G4OpenGLViewerMessenger(), G4OpenInventorXtExaminerViewerMessenger::G4OpenInventorXtExaminerViewerMessenger(), G4OpticalParametersMessenger::G4OpticalParametersMessenger(), G4ParticleGunMessenger::G4ParticleGunMessenger(), G4ParticleHPMessenger::G4ParticleHPMessenger(), G4ParticleMessenger::G4ParticleMessenger(), G4ParticlePropertyMessenger::G4ParticlePropertyMessenger(), G4PersistencyCenterMessenger::G4PersistencyCenterMessenger(), G4PolarizationMessenger::G4PolarizationMessenger(), G4ProcessManagerMessenger::G4ProcessManagerMessenger(), G4ProcessTableMessenger::G4ProcessTableMessenger(), G4ProductionCutsTableMessenger::G4ProductionCutsTableMessenger(), G4RadioactivationMessenger::G4RadioactivationMessenger(), G4RadioactiveDecayMessenger::G4RadioactiveDecayMessenger(), G4RTMessenger::G4RTMessenger(), G4RunMessenger::G4RunMessenger(), G4SchedulerMessenger::G4SchedulerMessenger(), G4ScoringMessenger::G4ScoringMessenger(), G4StackingMessenger::G4StackingMessenger(), G4tgrMessenger::G4tgrMessenger(), G4TrackingMessenger::G4TrackingMessenger(), G4UIcontrolMessenger::G4UIcontrolMessenger(), G4UserPhysicsListMessenger::G4UserPhysicsListMessenger(), G4VisCommandSetArrow3DLineSegmentsPerCircle::G4VisCommandSetArrow3DLineSegmentsPerCircle(), G4VisCommandSetLineWidth::G4VisCommandSetLineWidth(), G4VisCommandSetTextSize::G4VisCommandSetTextSize(), G4VisCommandsViewerSet::G4VisCommandsViewerSet(), PhysicsListMessenger::PhysicsListMessenger(), G4GenericMessenger::Command::SetRange(), and G4GenericMessenger::Command::SetUnit().

◆ SetToBeBroadcasted()

void G4UIcommand::SetToBeBroadcasted ( G4bool  val)
inlineinherited

◆ SetToBeFlushed()

void G4UIcommand::SetToBeFlushed ( G4bool  val)
inlineinherited

Definition at line 174 of file G4UIcommand.hh.

174{ toBeFlushed = val; }
G4bool toBeFlushed
Definition: G4UIcommand.hh:220

References G4UIcommand::toBeFlushed.

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

◆ SetUnitCandidates()

void G4UIcmdWithADoubleAndUnit::SetUnitCandidates ( const char *  candidateList)

Definition at line 180 of file G4UIcmdWithADoubleAndUnit.cc.

181{
182 G4UIparameter* untParam = GetParameter(1);
183 G4String canList = candidateList;
184 untParam->SetParameterCandidates(canList);
185}
void SetParameterCandidates(const char *theString)

References G4UIcommand::GetParameter(), and G4UIparameter::SetParameterCandidates().

Referenced by SetUnitCategory().

◆ SetUnitCategory()

void G4UIcmdWithADoubleAndUnit::SetUnitCategory ( const char *  unitCategory)

◆ SetWorkerThreadOnly()

void G4UIcommand::SetWorkerThreadOnly ( G4bool  val = true)
inlineinherited

◆ ToBeBroadcasted()

G4bool G4UIcommand::ToBeBroadcasted ( ) const
inlineinherited

Definition at line 173 of file G4UIcommand.hh.

173{ return toBeBroadcasted; }

References G4UIcommand::toBeBroadcasted.

Referenced by G4UIcommandTree::AddNewCommand(), and G4UImanager::ApplyCommand().

◆ ToBeFlushed()

G4bool G4UIcommand::ToBeFlushed ( ) const
inlineinherited

Definition at line 175 of file G4UIcommand.hh.

175{ return toBeFlushed; }

References G4UIcommand::toBeFlushed.

◆ TypeCheck()

G4int G4UIcommand::TypeCheck ( const char *  t)
privateinherited

Definition at line 638 of file G4UIcommand.cc.

639{
640 G4String aNewValue;
641 char type;
642 std::istringstream is(t);
643 for(unsigned i = 0; i < parameter.size(); ++i)
644 {
645 is >> aNewValue;
646 type = toupper(parameter[i]->GetParameterType());
647 switch(type)
648 {
649 case 'D':
650 if(IsDouble(aNewValue) == 0)
651 {
652 G4cerr << aNewValue << ": double value expected." << G4endl;
653 return 0;
654 }
655 break;
656 case 'I':
657 if(IsInt(aNewValue, 10) == 0)
658 {
659 G4cerr << aNewValue << ": integer expected." << G4endl;
660 return 0;
661 }
662 break;
663 case 'L':
664 if(IsInt(aNewValue, 20) == 0)
665 {
666 G4cerr << aNewValue << ": long int expected." << G4endl;
667 return 0;
668 }
669 break;
670 case 'S':
671 break;
672 case 'B':
673 G4StrUtil::to_upper(aNewValue);
674 if(aNewValue == "Y" || aNewValue == "N" || aNewValue == "YES" ||
675 aNewValue == "NO" || aNewValue == "1" || aNewValue == "0" ||
676 aNewValue == "T" || aNewValue == "F" || aNewValue == "TRUE" ||
677 aNewValue == "FALSE")
678 return 1;
679 else
680 return 0;
681 break;
682 default:;
683 }
684 }
685 return 1;
686}
G4int IsDouble(const char *str)
Definition: G4UIcommand.cc:736
void to_upper(G4String &str)
Convert string to uppercase.

References G4cerr, G4endl, G4UIcommand::IsDouble(), G4UIcommand::IsInt(), G4UIcommand::parameter, and G4StrUtil::to_upper().

◆ UnaryExpression()

yystype G4UIcommand::UnaryExpression ( void  )
privateinherited

Definition at line 1089 of file G4UIcommand.cc.

1090{
1091 yystype result;
1092 yystype p;
1093#ifdef DEBUG
1094 G4cerr << " UnaryExpression" << G4endl;
1095#endif
1096 switch(token)
1097 {
1098 case '-':
1099 token = Yylex();
1100 p = UnaryExpression();
1101 if(p.type == CONSTINT)
1102 {
1103 result.I = -p.I;
1104 result.type = CONSTINT;
1105 }
1106 if(p.type == CONSTLONG)
1107 {
1108 result.L = -p.L;
1109 result.type = CONSTLONG;
1110 }
1111 if(p.type == CONSTDOUBLE)
1112 {
1113 result.D = -p.D;
1114 result.type = CONSTDOUBLE;
1115 }
1116 break;
1117 case '+':
1118 token = Yylex();
1119 result = UnaryExpression();
1120 break;
1121 case '!':
1122 token = Yylex();
1123 G4cerr << "Parameter range error: "
1124 << "operator '!' is not supported (sorry)." << G4endl;
1125 paramERR = 1;
1126 result = UnaryExpression();
1127 break;
1128 default:
1129 result = PrimaryExpression();
1130 }
1131 return result;
1132}
yystype PrimaryExpression(void)

References G4UItokenNum::CONSTDOUBLE, G4UItokenNum::CONSTINT, G4UItokenNum::CONSTLONG, G4UItokenNum::yystype::D, G4cerr, G4endl, G4UItokenNum::yystype::I, G4UItokenNum::yystype::L, G4UIcommand::paramERR, G4UIcommand::PrimaryExpression(), G4UIcommand::token, G4UItokenNum::yystype::type, G4UIcommand::UnaryExpression(), and G4UIcommand::Yylex().

Referenced by G4UIcommand::MultiplicativeExpression(), and G4UIcommand::UnaryExpression().

◆ UnitsList()

G4String G4UIcommand::UnitsList ( const char *  unitCategory)
staticinherited

Definition at line 377 of file G4UIcommand.cc.

378{
379 G4String retStr;
381 std::size_t i;
382 for(i = 0; i < UTbl.size(); ++i)
383 {
384 if(UTbl[i]->GetName() == unitCategory)
385 break;
386 }
387 if(i == UTbl.size())
388 {
389 G4cerr << "Unit category <" << unitCategory << "> is not defined."
390 << G4endl;
391 return retStr;
392 }
393 G4UnitsContainer& UCnt = UTbl[i]->GetUnitsList();
394 retStr = UCnt[0]->GetSymbol();
395 G4int je = UCnt.size();
396 for(G4int j = 1; j < je; ++j)
397 {
398 retStr += " ";
399 retStr += UCnt[j]->GetSymbol();
400 }
401 for(G4int k = 0; k < je; ++k)
402 {
403 retStr += " ";
404 retStr += UCnt[k]->GetName();
405 }
406 return retStr;
407}
std::vector< G4UnitDefinition * > G4UnitsContainer
std::vector< G4UnitsCategory * > G4UnitsTable
Definition: G4UnitsTable.hh:68
static G4UnitsTable & GetUnitsTable()

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

Referenced by G4MatScanMessenger::G4MatScanMessenger(), G4UserPhysicsListMessenger::G4UserPhysicsListMessenger(), G4UIparameter::SetDefaultUnit(), G4UIcmdWith3VectorAndUnit::SetUnitCategory(), and SetUnitCategory().

◆ ValueOf()

G4double G4UIcommand::ValueOf ( const char *  unitName)
staticinherited

◆ Yylex()

tokenNum G4UIcommand::Yylex ( void  )
privateinherited

Definition at line 1506 of file G4UIcommand.cc.

1507{ // (returns EOF)
1508 G4int c;
1509 G4String buf;
1510
1511 while((c = G4UIpGetc()) == ' ' || c == '\t' || c == '\n')
1512 ;
1513 if(c == EOF)
1514 return (tokenNum) EOF; // KR488
1515 buf = "";
1516 if(isdigit(c) || c == '.')
1517 { // I or D
1518 do
1519 {
1520 buf += (unsigned char)c;
1521 c = G4UIpGetc();
1522 } while(c == '.' || isdigit(c) || c == 'e' || c == 'E' || c == '+' ||
1523 c == '-');
1524 G4UIpUngetc(c);
1525 const char* t = buf;
1526 std::istringstream is(t);
1527 if(IsInt(buf.data(), 20))
1528 {
1529 is >> yylval.I;
1530 return CONSTINT;
1531 }
1532 else if(IsDouble(buf.data()))
1533 {
1534 is >> yylval.D;
1535 return CONSTDOUBLE;
1536 }
1537 else
1538 {
1539 G4cerr << buf << ": numeric format error." << G4endl;
1540 }
1541 }
1542 buf = "";
1543 if(isalpha(c) || c == '_')
1544 { // IDENTIFIER
1545 do
1546 {
1547 buf += (unsigned char) c;
1548 } while((c = G4UIpGetc()) != EOF && (isalnum(c) || c == '_'));
1549 G4UIpUngetc(c);
1550 if(IsParameter(buf))
1551 {
1552 yylval.S = buf;
1553 return IDENTIFIER;
1554 }
1555 else
1556 {
1557 G4cerr << buf << " is not a parameter name." << G4endl;
1558 paramERR = 1;
1559 }
1560 }
1561 switch(c)
1562 {
1563 case '>':
1564 return (tokenNum) Follow('=', GE, GT);
1565 case '<':
1566 return (tokenNum) Follow('=', LE, LT);
1567 case '=':
1568 return (tokenNum) Follow('=', EQ, '=');
1569 case '!':
1570 return (tokenNum) Follow('=', NE, '!');
1571 case '|':
1572 return (tokenNum) Follow('|', LOGICALOR, '|');
1573 case '&':
1574 return (tokenNum) Follow('&', LOGICALAND, '&');
1575 default:
1576 return (tokenNum) c;
1577 }
1578}
unsigned IsParameter(const char *)
G4int Follow(G4int expect, G4int ifyes, G4int ifno)

References G4UItokenNum::CONSTDOUBLE, G4UItokenNum::CONSTINT, G4UItokenNum::yystype::D, EQ, G4UIcommand::Follow(), G4cerr, G4endl, G4UIcommand::G4UIpGetc(), G4UIcommand::G4UIpUngetc(), GE, GT, G4UItokenNum::yystype::I, G4UItokenNum::IDENTIFIER, G4UIcommand::IsDouble(), G4UIcommand::IsInt(), G4UIcommand::IsParameter(), LE, G4UItokenNum::LOGICALAND, G4UItokenNum::LOGICALOR, LT, NE, G4UIcommand::paramERR, G4UItokenNum::yystype::S, and G4UIcommand::yylval.

Referenced by G4UIcommand::EqualityExpression(), G4UIcommand::LogicalANDExpression(), G4UIcommand::LogicalORExpression(), G4UIcommand::PrimaryExpression(), G4UIcommand::RangeCheck(), G4UIcommand::RelationalExpression(), and G4UIcommand::UnaryExpression().

Field Documentation

◆ availabelStateList

std::vector<G4ApplicationState> G4UIcommand::availabelStateList
privateinherited

◆ bp

G4int G4UIcommand::bp = 0
privateinherited

◆ commandFailureCode

G4int G4UIcommand::commandFailureCode = 0
protectedinherited

◆ commandGuidance

std::vector<G4String> G4UIcommand::commandGuidance
privateinherited

◆ commandName

G4String G4UIcommand::commandName
privateinherited

◆ commandPath

G4String G4UIcommand::commandPath
privateinherited

◆ commandType

CommandType G4UIcommand::commandType = BaseClassCmd
privateinherited

Definition at line 266 of file G4UIcommand.hh.

Referenced by G4UIcommand::GetCommandType(), and G4UIcommand::SetCommandType().

◆ failureDescription

G4String G4UIcommand::failureDescription = ""
protectedinherited

◆ ifSort

G4bool G4UIcommand::ifSort = false
protectedinherited

◆ messenger

G4UImessenger* G4UIcommand::messenger = nullptr
privateinherited

◆ newVal

std::vector<yystype> G4UIcommand::newVal
privateinherited

◆ paramERR

G4int G4UIcommand::paramERR = 0
privateinherited

◆ parameter

std::vector<G4UIparameter*> G4UIcommand::parameter
privateinherited

◆ rangeBuf

G4String G4UIcommand::rangeBuf
privateinherited

Definition at line 275 of file G4UIcommand.hh.

◆ rangeString

G4String G4UIcommand::rangeString
privateinherited

◆ toBeBroadcasted

G4bool G4UIcommand::toBeBroadcasted = false
protectedinherited

◆ toBeFlushed

G4bool G4UIcommand::toBeFlushed = false
protectedinherited

Definition at line 220 of file G4UIcommand.hh.

Referenced by G4UIcommand::SetToBeFlushed(), and G4UIcommand::ToBeFlushed().

◆ token

tokenNum G4UIcommand::token = G4UItokenNum::IDENTIFIER
privateinherited

◆ workerThreadOnly

G4bool G4UIcommand::workerThreadOnly = false
protectedinherited

◆ yylval

yystype G4UIcommand::yylval
privateinherited

Definition at line 278 of file G4UIcommand.hh.

Referenced by G4UIcommand::PrimaryExpression(), and G4UIcommand::Yylex().


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