Geant4 11.2.2
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4UIcommand Class Reference

#include <G4UIcommand.hh>

+ Inheritance diagram for G4UIcommand:

Public Types

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

Public Member Functions

 G4UIcommand ()=default
 
 G4UIcommand (const char *theCommandPath, G4UImessenger *theMessenger, G4bool tBB=true)
 
virtual ~G4UIcommand ()
 
G4bool operator== (const G4UIcommand &right) const
 
G4bool 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
 
std::size_t GetGuidanceEntries () const
 
const G4StringGetGuidanceLine (G4int i) const
 
const G4StringGetCommandPath () const
 
const G4StringGetCommandName () const
 
std::size_t 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
 
void SetToBeBroadcasted (G4bool val)
 
G4bool ToBeBroadcasted () const
 
void SetToBeFlushed (G4bool val)
 
G4bool ToBeFlushed () const
 
void SetWorkerThreadOnly (G4bool val=true)
 
G4bool IsWorkerThreadOnly () const
 
void CommandFailed (G4int errCode, G4ExceptionDescription &ed)
 
void CommandFailed (G4ExceptionDescription &ed)
 
G4int IfCommandFailed ()
 
const G4StringGetFailureDescription ()
 
void ResetFailure ()
 
CommandType GetCommandType () const
 
void SetCommandType (CommandType)
 
void SetDefaultSortFlag (G4bool val)
 

Static Public Member Functions

static G4String ConvertToString (G4bool boolVal)
 
static G4String ConvertToString (G4int intValue)
 
static G4String ConvertToString (G4long longValue)
 
static G4String ConvertToString (G4double doubleValue)
 
static G4String ConvertToString (G4double doubleValue, const char *unitName)
 
static G4String ConvertToString (const G4ThreeVector &vec)
 
static G4String ConvertToString (const G4ThreeVector &vec, const char *unitName)
 
static G4bool ConvertToBool (const char *st)
 
static G4int ConvertToInt (const char *st)
 
static G4long ConvertToLongInt (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 Types

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

Protected Member Functions

G4int CheckNewValue (const char *newValue)
 

Protected Attributes

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

Detailed Description

Definition at line 51 of file G4UIcommand.hh.

Member Typedef Documentation

◆ tokenNum

Definition at line 203 of file G4UIcommand.hh.

◆ yystype

Definition at line 202 of file G4UIcommand.hh.

Member Enumeration Documentation

◆ CommandType

Enumerator
BaseClassCmd 
WithoutParameterCmd 
WithABoolCmd 
WithAnIntegerCmd 
WithALongIntCmd 
WithADoubleCmd 
WithADoubleAndUnitCmd 
With3VectorCmd 
With3VectorAndUnitCmd 
WithAStringCmd 
CmdDirectory 

Definition at line 180 of file G4UIcommand.hh.

Constructor & Destructor Documentation

◆ G4UIcommand() [1/2]

G4UIcommand::G4UIcommand ( )
default

◆ G4UIcommand() [2/2]

G4UIcommand::G4UIcommand ( const char * theCommandPath,
G4UImessenger * theMessenger,
G4bool tBB = true )

Definition at line 51 of file G4UIcommand.cc.

52 : toBeBroadcasted(tBB), messenger(theMessenger)
53{
54 G4String comStr = theCommandPath;
55 G4UIcommandCommonConstructorCode(comStr);
56 availabelStateList = {G4State_PreInit, G4State_Init, G4State_Idle,
58}
@ G4State_EventProc
@ G4State_Init
@ G4State_Idle
@ G4State_Abort
@ G4State_GeomClosed
@ G4State_PreInit
G4bool toBeBroadcasted

◆ ~G4UIcommand()

G4UIcommand::~G4UIcommand ( )
virtual

Definition at line 104 of file G4UIcommand.cc.

105{
107 if (fUImanager != nullptr) {
108 fUImanager->RemoveCommand(this);
109 }
110
111 for (const auto& p : parameter) {
112 delete p;
113 }
114}
void RemoveCommand(G4UIcommand *aCommand)
static G4UImanager * GetUIpointer()

Member Function Documentation

◆ AvailableForStates() [1/5]

void G4UIcommand::AvailableForStates ( G4ApplicationState s1)

Definition at line 241 of file G4UIcommand.cc.

242{
243 availabelStateList = {s1};
244}

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

◆ AvailableForStates() [2/5]

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

Definition at line 247 of file G4UIcommand.cc.

248{
249 availabelStateList = {s1, s2};
250}

◆ AvailableForStates() [3/5]

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

Definition at line 253 of file G4UIcommand.cc.

255{
256 availabelStateList = {s1, s2, s3};
257}

◆ AvailableForStates() [4/5]

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

Definition at line 260 of file G4UIcommand.cc.

262{
263 availabelStateList = {s1, s2, s3, s4};
264}

◆ AvailableForStates() [5/5]

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

Definition at line 267 of file G4UIcommand.cc.

270{
271 availabelStateList = {s1, s2, s3, s4, s5};
272}

◆ CategoryOf()

◆ CheckNewValue()

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

Definition at line 485 of file G4UIcommand.cc.

486{
487 yystype result;
488 if (!RangeCheck(newValue)) {
490 }
491 return 0; // succeeded
492}
@ fParameterOutOfRange

Referenced by DoIt().

◆ CommandFailed() [1/2]

void G4UIcommand::CommandFailed ( G4ExceptionDescription & ed)
inline

Definition at line 166 of file G4UIcommand.hh.

167 {
169 failureDescription = ed.str();
170 }
G4int commandFailureCode
G4String failureDescription

◆ CommandFailed() [2/2]

◆ ConvertTo3Vector()

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

Definition at line 459 of file G4UIcommand.cc.

460{
461 G4double vx;
462 G4double vy;
463 G4double vz;
464 std::istringstream is(st);
465 is >> vx >> vy >> vz;
466 return G4ThreeVector(vx, vy, vz);
467}
CLHEP::Hep3Vector G4ThreeVector
double G4double
Definition G4Types.hh:83

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

◆ ConvertToBool()

◆ ConvertToDimensioned3Vector()

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

Definition at line 470 of file G4UIcommand.cc.

471{
472 G4double vx;
473 G4double vy;
474 G4double vz;
475 char unts[30];
476 std::istringstream is(st);
477 is >> vx >> vy >> vz >> unts;
478 G4String unt = unts;
479 G4double uv = ValueOf(unt);
480 return G4ThreeVector(vx * uv, vy * uv, vz * uv);
481}
static G4double ValueOf(const char *unitName)

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

◆ ConvertToDimensionedDouble()

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

Definition at line 446 of file G4UIcommand.cc.

447{
448 G4double vl;
449 char unts[30];
450
451 std::istringstream is(st);
452 is >> vl >> unts;
453 G4String unt = unts;
454
455 return (vl * ValueOf(unt));
456}

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

◆ ConvertToDouble()

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

◆ ConvertToInt()

◆ ConvertToLongInt()

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

Definition at line 434 of file G4UIcommand.cc.

435{
436 return G4UIparsing::StoT<G4long>(st);
437}

Referenced by G4UIcmdWithALongInt::GetNewLongIntValue().

◆ ConvertToString() [1/7]

G4String G4UIcommand::ConvertToString ( const G4ThreeVector & vec)
static

Definition at line 397 of file G4UIcommand.cc.

398{
399 std::ostringstream os;
401 os << std::setprecision(17);
402 }
403 os << vec.x() << " " << vec.y() << " " << vec.z();
404 return os.str();
405}
double z() const
double x() const
double y() const
static G4bool DoublePrecisionStr()

◆ ConvertToString() [2/7]

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

Definition at line 408 of file G4UIcommand.cc.

409{
410 G4double uv = ValueOf(unitName);
411
412 std::ostringstream os;
414 os << std::setprecision(17);
415 }
416 os << vec.x() / uv << " " << vec.y() / uv << " " << vec.z() / uv << " " << unitName;
417 return os.str();
418}

◆ ConvertToString() [3/7]

G4String G4UIcommand::ConvertToString ( G4bool boolVal)
static

Definition at line 357 of file G4UIcommand.cc.

358{
359 return boolVal ? "1" : "0";
360}

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

◆ ConvertToString() [4/7]

G4String G4UIcommand::ConvertToString ( G4double doubleValue)
static

Definition at line 375 of file G4UIcommand.cc.

376{
377 std::ostringstream os;
379 os << std::setprecision(17);
380 }
381 os << doubleValue;
382 return os.str();
383}

◆ ConvertToString() [5/7]

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

Definition at line 386 of file G4UIcommand.cc.

387{
388 std::ostringstream os;
390 os << std::setprecision(17);
391 }
392 os << doubleValue / ValueOf(unitName) << " " << unitName;
393 return os.str();
394}

◆ ConvertToString() [6/7]

G4String G4UIcommand::ConvertToString ( G4int intValue)
static

Definition at line 363 of file G4UIcommand.cc.

364{
365 return G4UIparsing::TtoS(intValue);
366}
G4String TtoS(T value)

◆ ConvertToString() [7/7]

G4String G4UIcommand::ConvertToString ( G4long longValue)
static

Definition at line 369 of file G4UIcommand.cc.

370{
371 return G4UIparsing::TtoS(longValue);
372}

◆ DoIt()

G4int G4UIcommand::DoIt ( G4String parameterList)
virtual

Reimplemented in G4UIcmdWith3VectorAndUnit, and G4UIcmdWithADoubleAndUnit.

Definition at line 129 of file G4UIcommand.cc.

130{
131 G4String correctParameters;
132 std::size_t n_parameterEntry = parameter.size();
133 if (n_parameterEntry != 0) {
134 G4String aToken;
135 G4String correctToken;
136 G4Tokenizer parameterToken(parameterList);
137 for (std::size_t i_thParameter = 0; i_thParameter < n_parameterEntry; ++i_thParameter) {
138 if (i_thParameter > 0) {
139 correctParameters.append(" ");
140 }
141 aToken = parameterToken();
142 if (aToken.length() > 0 && aToken[0] == '"') {
143 while (aToken.back() != '"' || (aToken.length() == 1 && aToken[0] == '"')) {
144 G4String additionalToken = parameterToken();
145 if (additionalToken.empty()) {
146 return G4int(fParameterUnreadable + i_thParameter);
147 }
148 aToken += " ";
149 aToken += additionalToken;
150 }
151 }
152 else if (i_thParameter == n_parameterEntry - 1
153 && parameter[i_thParameter]->GetParameterType() == 's')
154 {
155 G4String anotherToken;
156 while (!((anotherToken = parameterToken()).empty())) {
157 std::size_t idxs = anotherToken.find('#');
158 if (idxs == std::string::npos) {
159 aToken += " ";
160 aToken += anotherToken;
161 }
162 else if (idxs > 0) {
163 aToken += " ";
164 aToken += anotherToken.substr(0, idxs);
165 break;
166 }
167 else {
168 break;
169 }
170 }
171 }
172
173 if (aToken.empty() || aToken == "!") {
174 if (parameter[i_thParameter]->IsOmittable()) {
175 if (parameter[i_thParameter]->GetCurrentAsDefault()) {
176 G4Tokenizer cvSt(messenger->GetCurrentValue(this));
177 G4String parVal;
178 for (std::size_t ii = 0; ii < i_thParameter; ++ii) {
179 parVal = cvSt();
180 if (parVal[0] == '"') {
181 while (parVal.back() != '"') {
182 G4String additionalToken = cvSt();
183 if (additionalToken.empty()) {
184 return G4int(fParameterUnreadable + i_thParameter);
185 }
186 parVal += " ";
187 parVal += additionalToken;
188 }
189 }
190 }
191 G4String aCVToken = cvSt();
192 if (aCVToken[0] == '"') {
193 while (aCVToken.back() != '"') {
194 G4String additionalToken = cvSt();
195 if (additionalToken.empty()) {
196 return G4int(fParameterUnreadable + i_thParameter);
197 }
198 aCVToken += " ";
199 aCVToken += additionalToken;
200 }
201 }
202 correctParameters.append(aCVToken);
203 }
204 else {
205 correctParameters.append(parameter[i_thParameter]->GetDefaultValue());
206 }
207 }
208 else {
209 return G4int(fParameterUnreadable + i_thParameter);
210 }
211 }
212 else {
213 G4int stat = parameter[i_thParameter]->CheckNewValue(aToken);
214 if (stat != 0) {
215 return stat + G4int(i_thParameter);
216 }
217 correctParameters.append(aToken);
218 }
219 }
220 }
221
222 if (CheckNewValue(correctParameters) != 0) {
223 return fParameterOutOfRange + 99;
224 }
225
227 return 0;
228 }
229
230 messenger->SetNewValue(this, correctParameters);
231 return 0;
232}
int G4int
Definition G4Types.hh:85
@ fParameterUnreadable
G4int CheckNewValue(const char *newValue)
G4bool workerThreadOnly
virtual G4String GetCurrentValue(G4UIcommand *command)
virtual void SetNewValue(G4UIcommand *command, G4String newValue)
G4bool IsMasterThread()

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

◆ GetCommandName()

◆ GetCommandPath()

◆ GetCommandType()

CommandType G4UIcommand::GetCommandType ( ) const
inline

Definition at line 195 of file G4UIcommand.hh.

195{ return commandType; }

◆ GetCurrentValue()

G4String G4UIcommand::GetCurrentValue ( )

Definition at line 235 of file G4UIcommand.cc.

236{
237 return messenger->GetCurrentValue(this);
238}

Referenced by G4UImanager::GetCurrentValues().

◆ GetFailureDescription()

const G4String & G4UIcommand::GetFailureDescription ( )
inline

Definition at line 172 of file G4UIcommand.hh.

172{ return failureDescription; }

Referenced by G4UImanager::ApplyCommand().

◆ GetGuidanceEntries()

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

◆ GetGuidanceLine()

◆ GetMessenger()

G4UImessenger * G4UIcommand::GetMessenger ( ) const
inline

Definition at line 131 of file G4UIcommand.hh.

131{ return messenger; }

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

◆ GetParameter()

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

Definition at line 129 of file G4UIcommand.hh.

129{ return parameter[i]; }

Referenced by G4UIcmdWith3VectorAndUnit::ConvertToStringWithBestUnit(), G4UIcmdWithADoubleAndUnit::ConvertToStringWithBestUnit(), G4UIcmdWith3VectorAndUnit::ConvertToStringWithDefaultUnit(), G4UIcmdWithADoubleAndUnit::ConvertToStringWithDefaultUnit(), G4VVisCommand::CopyParametersFrom(), G4UIcommandTree::CreateHTML(), G4UIcmdWith3VectorAndUnit::DoIt(), G4UIcmdWithADoubleAndUnit::DoIt(), G4UImanager::GetCurrentStringValue(), G4UIcmdWithAString::SetCandidates(), G4UIcmdWith3VectorAndUnit::SetDefaultUnit(), G4UIcmdWithADoubleAndUnit::SetDefaultUnit(), G4UIcmdWith3Vector::SetDefaultValue(), G4UIcmdWith3VectorAndUnit::SetDefaultValue(), G4UIcmdWithABool::SetDefaultValue(), G4UIcmdWithADouble::SetDefaultValue(), G4UIcmdWithADoubleAndUnit::SetDefaultValue(), G4UIcmdWithALongInt::SetDefaultValue(), G4UIcmdWithAnInteger::SetDefaultValue(), G4UIcmdWithAString::SetDefaultValue(), G4UIcmdWithNucleusLimits::SetDefaultValue(), G4UIcmdWith3Vector::SetParameterName(), G4UIcmdWith3VectorAndUnit::SetParameterName(), G4UIcmdWithABool::SetParameterName(), G4UIcmdWithADouble::SetParameterName(), G4UIcmdWithADoubleAndUnit::SetParameterName(), G4UIcmdWithALongInt::SetParameterName(), G4UIcmdWithAnInteger::SetParameterName(), G4UIcmdWithAString::SetParameterName(), G4UIcmdWithNucleusLimits::SetParameterName(), G4GenericMessenger::Command::SetUnit(), G4UIcmdWith3VectorAndUnit::SetUnitCandidates(), G4UIcmdWithADoubleAndUnit::SetUnitCandidates(), and G4OpenGLQtViewer::updateViewerPropertiesTableWidget().

◆ GetParameterEntries()

◆ GetRange()

const G4String & G4UIcommand::GetRange ( ) const
inline

Definition at line 123 of file G4UIcommand.hh.

123{ return rangeExpression; }

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

◆ GetStateList()

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

Definition at line 130 of file G4UIcommand.hh.

130{ return &availabelStateList; }

Referenced by G4UIcommandTree::CreateHTML().

◆ GetTitle()

const G4String G4UIcommand::GetTitle ( ) const
inline

Definition at line 149 of file G4UIcommand.hh.

150 {
151 return (commandGuidance.empty()) ? G4String("...Title not available...") : commandGuidance[0];
152 }

Referenced by G4UIcommandTree::GetTitle().

◆ IfCommandFailed()

G4int G4UIcommand::IfCommandFailed ( )
inline

Definition at line 171 of file G4UIcommand.hh.

171{ return commandFailureCode; }

Referenced by G4UImanager::ApplyCommand().

◆ IsAvailable()

G4bool G4UIcommand::IsAvailable ( )

Definition at line 275 of file G4UIcommand.cc.

276{
278
279 for (const auto& s : availabelStateList) {
280 if (s == currentState) {
281 return true;
282 }
283 }
284
285 return false;
286}
G4ApplicationState
const G4ApplicationState & GetCurrentState() const
static G4StateManager * GetStateManager()

Referenced by G4UImanager::ApplyCommand().

◆ IsWorkerThreadOnly()

G4bool G4UIcommand::IsWorkerThreadOnly ( ) const
inline

Definition at line 159 of file G4UIcommand.hh.

159{ return workerThreadOnly; }

Referenced by G4UIcommandTree::RemoveCommand().

◆ List()

void G4UIcommand::List ( )
virtual

Definition at line 330 of file G4UIcommand.cc.

331{
332 G4cout << G4endl;
333 G4cout << G4endl;
334 if (commandPath.back() != '/') {
335 G4cout << "Command " << commandPath << G4endl;
336 }
337 if (workerThreadOnly) {
338 G4cout << " ---- available only in worker thread" << G4endl;
339 }
340
341 G4cout << "Guidance :" << G4endl;
342 for (const auto& i_thGuidance : commandGuidance) {
343 G4cout << i_thGuidance << G4endl;
344 }
345
346 if (!rangeExpression.empty()) {
347 G4cout << " Range of parameters : " << rangeExpression << G4endl;
348 }
349
350 for (const auto& i_thParameter : parameter) {
351 i_thParameter->List();
352 }
353 G4cout << G4endl;
354}
#define G4endl
Definition G4ios.hh:67
G4GLOB_DLL std::ostream G4cout

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

◆ operator!=()

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

Definition at line 123 of file G4UIcommand.cc.

124{
125 return (commandPath != right.GetCommandPath());
126}
const G4String & GetCommandPath() const

◆ operator==()

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

Definition at line 117 of file G4UIcommand.cc.

118{
119 return (commandPath == right.GetCommandPath());
120}

◆ ResetFailure()

void G4UIcommand::ResetFailure ( )
inline

Definition at line 173 of file G4UIcommand.hh.

174 {
177 }

Referenced by G4UImanager::ApplyCommand(), and G4UIcontrolMessenger::SetNewValue().

◆ SetCommandType()

void G4UIcommand::SetCommandType ( CommandType typ)

Definition at line 83 of file G4UIcommand.cc.

84{
85 if (messenger == nullptr) { // this must be a directory
86 if (typ != CmdDirectory) {
88 ed << "A UI command <" << commandPath << "> is defined without vaild messenger.";
89 G4Exception("G4UIcommand::SetCommandType", "UI2031", FatalException, ed);
90 }
91 else if (commandPath.back() != '/') {
93 ed << "G4UIcommand Warning : \n"
94 << " <" << commandPath << "> must be a directory."
95 << " '/' is appended.";
96 G4Exception("G4UIcommand::SetCommandType", "UI2032", JustWarning, ed);
97 commandPath += "/";
98 }
99 }
100 commandType = typ;
101}
@ JustWarning
@ FatalException
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
std::ostringstream G4ExceptionDescription

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

◆ SetDefaultSortFlag()

void G4UIcommand::SetDefaultSortFlag ( G4bool val)
inline

Definition at line 198 of file G4UIcommand.hh.

198{ ifSort = val; }

Referenced by G4UIcommandTree::AddNewCommand().

◆ SetGuidance()

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

Definition at line 147 of file G4UIcommand.hh.

147{ commandGuidance.emplace_back(aGuidance); }

Referenced by G4VVisCommand::CopyGuidanceFrom(), G4UImessenger::CreateDirectory(), G4GenericMessenger::DeclareMethodWithUnit(), G4GenericMessenger::DeclareProperty(), G4GenericMessenger::DeclarePropertyWithUnit(), G4AdjointSimMessenger::G4AdjointSimMessenger(), G4CascadeParamMessenger::G4CascadeParamMessenger(), G4ChargeExchangeMessenger::G4ChargeExchangeMessenger(), G4DecayTableMessenger::G4DecayTableMessenger(), G4DeexParametersMessenger::G4DeexParametersMessenger(), G4DMmessenger::G4DMmessenger(), G4EmExtraParametersMessenger::G4EmExtraParametersMessenger(), G4EmLowEParametersMessenger::G4EmLowEParametersMessenger(), G4EmMessenger::G4EmMessenger(), G4EmParametersMessenger::G4EmParametersMessenger(), G4ErrorMessenger::G4ErrorMessenger(), G4EvManMessenger::G4EvManMessenger(), G4FastSimulationMessenger::G4FastSimulationMessenger(), G4FTFTuningsMessenger::G4FTFTuningsMessenger(), G4GDMLMessenger::G4GDMLMessenger(), G4GenericMessenger::G4GenericMessenger(), G4GeometryMessenger::G4GeometryMessenger(), G4GlobalMagFieldMessenger::G4GlobalMagFieldMessenger(), G4GMocrenMessenger::G4GMocrenMessenger(), G4HadronicEPTestMessenger::G4HadronicEPTestMessenger(), G4HadronicParametersMessenger::G4HadronicParametersMessenger(), 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(), G4NeutrinoPhysicsMessenger::G4NeutrinoPhysicsMessenger(), G4NeutronKillerMessenger::G4NeutronKillerMessenger(), G4NistMessenger::G4NistMessenger(), G4NuclideTableMessenger::G4NuclideTableMessenger(), G4OpticalParametersMessenger::G4OpticalParametersMessenger(), G4ParticleGunMessenger::G4ParticleGunMessenger(), G4ParticleHPMessenger::G4ParticleHPMessenger(), G4ParticleMessenger::G4ParticleMessenger(), G4ParticlePropertyMessenger::G4ParticlePropertyMessenger(), G4PersistencyCenterMessenger::G4PersistencyCenterMessenger(), G4PhysListFactoryMessenger::G4PhysListFactoryMessenger(), G4PolarizationMessenger::G4PolarizationMessenger(), G4ProcessManagerMessenger::G4ProcessManagerMessenger(), G4ProcessTableMessenger::G4ProcessTableMessenger(), G4ProductionCutsTableMessenger::G4ProductionCutsTableMessenger(), G4ProfilerMessenger::G4ProfilerMessenger(), G4QSSMessenger::G4QSSMessenger(), G4RadioactivationMessenger::G4RadioactivationMessenger(), G4RadioactiveDecayMessenger::G4RadioactiveDecayMessenger(), G4RunMessenger::G4RunMessenger(), 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(), GFlashShowerModelMessenger::GFlashShowerModelMessenger(), G4GenericMessenger::Command::SetGuidance(), G4GenericMessenger::SetGuidance(), G4VisCommandModelCreate< Factory >::SetNewValue(), and G4GenericMessenger::Command::SetUnit().

◆ SetParameter()

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

Definition at line 137 of file G4UIcommand.hh.

138 {
139 parameter.push_back(newParameter);
140 newVal.resize(parameter.size());
141 }

Referenced by G4VVisCommand::CopyParametersFrom(), G4GenericMessenger::DeclareProperty(), G4AdjointSimMessenger::G4AdjointSimMessenger(), G4EmExtraParametersMessenger::G4EmExtraParametersMessenger(), G4EmLowEParametersMessenger::G4EmLowEParametersMessenger(), G4GMocrenMessenger::G4GMocrenMessenger(), G4InteractorMessenger::G4InteractorMessenger(), G4LocalThreadCoutMessenger::G4LocalThreadCoutMessenger(), G4MatScanMessenger::G4MatScanMessenger(), G4ModelCmdApplyColour< M >::G4ModelCmdApplyColour(), G4ModelCmdApplyStringColour< M >::G4ModelCmdApplyStringColour(), 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::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(), and G4VisCommandViewerColourByDensity::G4VisCommandViewerColourByDensity().

◆ SetRange()

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

Definition at line 121 of file G4UIcommand.hh.

121{ rangeExpression = rs; }

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

◆ SetToBeBroadcasted()

◆ SetToBeFlushed()

void G4UIcommand::SetToBeFlushed ( G4bool val)
inline

Definition at line 156 of file G4UIcommand.hh.

156{ toBeFlushed = val; }
G4bool toBeFlushed

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

◆ SetWorkerThreadOnly()

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

◆ ToBeBroadcasted()

G4bool G4UIcommand::ToBeBroadcasted ( ) const
inline

Definition at line 155 of file G4UIcommand.hh.

155{ return toBeBroadcasted; }

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

◆ ToBeFlushed()

G4bool G4UIcommand::ToBeFlushed ( ) const
inline

Definition at line 157 of file G4UIcommand.hh.

157{ return toBeFlushed; }

◆ UnitsList()

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

Definition at line 301 of file G4UIcommand.cc.

302{
304
305 auto ucatIter = std::find_if(std::cbegin(UTbl), std::cend(UTbl), [&unitCategory](const auto& ud) {
306 return ud->GetName() == unitCategory;
307 });
308
309 if (ucatIter == std::cend(UTbl)) {
310 G4cerr << "Unit category <" << unitCategory << "> is not defined." << G4endl;
311 return G4String();
312 }
313
314 G4String symList;
315 G4String nameList;
316 G4UnitsContainer& UCnt = (*ucatIter)->GetUnitsList();
317
318 for (const auto& uDef : UCnt) {
319 symList += uDef->GetSymbol();
320 symList += " ";
321 nameList += uDef->GetName();
322 nameList += " ";
323 }
324 symList += nameList;
325 G4StrUtil::rstrip(symList);
326 return symList;
327}
std::vector< G4UnitDefinition * > G4UnitsContainer
std::vector< G4UnitsCategory * > G4UnitsTable
G4GLOB_DLL std::ostream G4cerr
static G4UnitsTable & GetUnitsTable()

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

◆ ValueOf()

Member Data Documentation

◆ commandFailureCode

G4int G4UIcommand::commandFailureCode = 0
protected

Definition at line 211 of file G4UIcommand.hh.

Referenced by CommandFailed(), CommandFailed(), IfCommandFailed(), and ResetFailure().

◆ failureDescription

G4String G4UIcommand::failureDescription = ""
protected

Definition at line 212 of file G4UIcommand.hh.

Referenced by CommandFailed(), CommandFailed(), GetFailureDescription(), and ResetFailure().

◆ ifSort

G4bool G4UIcommand::ifSort = false
protected

Definition at line 214 of file G4UIcommand.hh.

Referenced by G4UIdirectory::IfSort(), SetDefaultSortFlag(), and G4UIdirectory::Sort().

◆ toBeBroadcasted

G4bool G4UIcommand::toBeBroadcasted = false
protected

Definition at line 207 of file G4UIcommand.hh.

Referenced by SetToBeBroadcasted(), and ToBeBroadcasted().

◆ toBeFlushed

G4bool G4UIcommand::toBeFlushed = false
protected

Definition at line 208 of file G4UIcommand.hh.

Referenced by SetToBeFlushed(), and ToBeFlushed().

◆ workerThreadOnly

G4bool G4UIcommand::workerThreadOnly = false
protected

Definition at line 209 of file G4UIcommand.hh.

Referenced by DoIt(), IsWorkerThreadOnly(), List(), and SetWorkerThreadOnly().


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