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

#include <G4UIparameter.hh>

Public Member Functions

 G4UIparameter ()
 
 G4UIparameter (char theType)
 
 G4UIparameter (const char *theName, char theType, G4bool theOmittable)
 
 ~G4UIparameter ()
 
G4bool operator== (const G4UIparameter &right) const
 
G4bool operator!= (const G4UIparameter &right) const
 
G4int CheckNewValue (const char *newValue)
 
void List ()
 
void SetDefaultValue (const char *theDefaultValue)
 
void SetDefaultValue (G4int theDefaultValue)
 
void SetDefaultValue (G4long theDefaultValue)
 
void SetDefaultValue (G4double theDefaultValue)
 
void SetDefaultUnit (const char *theDefaultUnit)
 
const G4StringGetDefaultValue () const
 
char GetParameterType () const
 
void SetParameterRange (const char *theRange)
 
const G4StringGetParameterRange () const
 
void SetParameterName (const char *pName)
 
const G4StringGetParameterName () const
 
void SetParameterCandidates (const char *theString)
 
const G4StringGetParameterCandidates () const
 
void SetOmittable (G4bool om)
 
G4bool IsOmittable () const
 
void SetCurrentAsDefault (G4bool val)
 
G4bool GetCurrentAsDefault () const
 
void SetWidget (G4int theWidget)
 
const G4StringGetParameterGuidance () const
 
void SetGuidance (const char *theGuidance)
 

Protected Types

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

Detailed Description

Definition at line 45 of file G4UIparameter.hh.

Member Typedef Documentation

◆ tokenNum

Definition at line 135 of file G4UIparameter.hh.

◆ yystype

Definition at line 134 of file G4UIparameter.hh.

Constructor & Destructor Documentation

◆ G4UIparameter() [1/3]

G4UIparameter::G4UIparameter ( )

Definition at line 43 of file G4UIparameter.cc.

44{
45}

◆ G4UIparameter() [2/3]

G4UIparameter::G4UIparameter ( char  theType)

Definition at line 48 of file G4UIparameter.cc.

49{
50 parameterType = theType;
51}

◆ G4UIparameter() [3/3]

G4UIparameter::G4UIparameter ( const char *  theName,
char  theType,
G4bool  theOmittable 
)

Definition at line 54 of file G4UIparameter.cc.

56{
57 parameterName = theName;
58 parameterType = theType;
59 omittable = theOmittable;
60}

◆ ~G4UIparameter()

G4UIparameter::~G4UIparameter ( )

Definition at line 63 of file G4UIparameter.cc.

64{
65}

Member Function Documentation

◆ CheckNewValue()

G4int G4UIparameter::CheckNewValue ( const char *  newValue)

Definition at line 173 of file G4UIparameter.cc.

174{
175 if(TypeCheck(newValue) == 0)
177 if(!parameterRange.isNull())
178 {
179 if(RangeCheck(newValue) == 0)
181 }
182 if(!parameterCandidate.isNull())
183 {
184 if(CandidateCheck(newValue) == 0)
186 }
187 return 0; // succeeded
188}
@ fParameterOutOfCandidates
@ fParameterUnreadable
@ fParameterOutOfRange
G4bool isNull() const

◆ GetCurrentAsDefault()

G4bool G4UIparameter::GetCurrentAsDefault ( ) const
inline

Definition at line 118 of file G4UIparameter.hh.

118{ return currentAsDefaultFlag; }

Referenced by G4UIcommandTree::CreateHTML().

◆ GetDefaultValue()

◆ GetParameterCandidates()

const G4String & G4UIparameter::GetParameterCandidates ( ) const
inline

◆ GetParameterGuidance()

const G4String & G4UIparameter::GetParameterGuidance ( ) const
inline

Definition at line 123 of file G4UIparameter.hh.

124 {
125 return parameterGuidance;
126 }

◆ GetParameterName()

const G4String & G4UIparameter::GetParameterName ( ) const
inline

Definition at line 100 of file G4UIparameter.hh.

100{ return parameterName; }

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

◆ GetParameterRange()

const G4String & G4UIparameter::GetParameterRange ( ) const
inline

Definition at line 97 of file G4UIparameter.hh.

97{ return parameterRange; }

Referenced by G4UIcommandTree::CreateHTML().

◆ GetParameterType()

char G4UIparameter::GetParameterType ( ) const
inline

Definition at line 85 of file G4UIparameter.hh.

85{ return parameterType; }

Referenced by G4UIcommandTree::CreateHTML().

◆ IsOmittable()

◆ List()

void G4UIparameter::List ( )

Definition at line 80 of file G4UIparameter.cc.

81{
82 G4cout << G4endl << "Parameter : " << parameterName << G4endl;
83 if(!parameterGuidance.isNull())
84 G4cout << parameterGuidance << G4endl;
85 G4cout << " Parameter type : " << parameterType << G4endl;
86 if(omittable)
87 {
88 G4cout << " Omittable : True" << G4endl;
89 }
90 else
91 {
92 G4cout << " Omittable : False" << G4endl;
93 }
94 if(currentAsDefaultFlag)
95 {
96 G4cout << " Default value : taken from the current value" << G4endl;
97 }
98 else if(!defaultValue.isNull())
99 {
100 G4cout << " Default value : " << defaultValue << G4endl;
101 }
102 if(!parameterRange.isNull())
103 G4cout << " Parameter range : " << parameterRange << G4endl;
104 if(!parameterCandidate.isNull())
105 G4cout << " Candidates : " << parameterCandidate << G4endl;
106}
#define G4endl
Definition: G4ios.hh:57
G4GLOB_DLL std::ostream G4cout

◆ operator!=()

G4bool G4UIparameter::operator!= ( const G4UIparameter right) const

Definition at line 74 of file G4UIparameter.cc.

75{
76 return (this != &right);
77}

◆ operator==()

G4bool G4UIparameter::operator== ( const G4UIparameter right) const

Definition at line 68 of file G4UIparameter.cc.

69{
70 return (this == &right);
71}

◆ SetCurrentAsDefault()

◆ SetDefaultUnit()

void G4UIparameter::SetDefaultUnit ( const char *  theDefaultUnit)

Definition at line 133 of file G4UIparameter.cc.

134{
135 char type = toupper(parameterType);
136 if(type != 'S')
137 {
139 ed << "This method can be used only for a string-type parameter that is "
140 "used to specify a unit.\n"
141 << "This parameter <" << parameterName << "> is defined as ";
142 switch(type)
143 {
144 case 'D':
145 ed << "double.";
146 break;
147 case 'I':
148 ed << "integer.";
149 break;
150 case 'L':
151 ed << "long int.";
152 break;
153 case 'B':
154 ed << "bool.";
155 break;
156 default:
157 ed << "undefined.";
158 }
159 G4Exception("G4UIparameter::SetDefaultUnit", "INTERCOM2010", FatalException,
160 ed);
161 }
162 SetDefaultValue(theDefaultUnit);
165}
@ 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
static G4String CategoryOf(const char *unitName)
Definition: G4UIcommand.cc:356
static G4String UnitsList(const char *unitCategory)
Definition: G4UIcommand.cc:362
void SetDefaultValue(const char *theDefaultValue)
void SetParameterCandidates(const char *theString)

Referenced by G4EmExtraParametersMessenger::G4EmExtraParametersMessenger(), G4ScoringMessenger::G4ScoringMessenger(), and G4UserPhysicsListMessenger::G4UserPhysicsListMessenger().

◆ SetDefaultValue() [1/4]

void G4UIparameter::SetDefaultValue ( const char *  theDefaultValue)
inline

Definition at line 70 of file G4UIparameter.hh.

71 {
72 defaultValue = theDefaultValue;
73 }

Referenced by G4AdjointSimMessenger::G4AdjointSimMessenger(), G4EmExtraParametersMessenger::G4EmExtraParametersMessenger(), G4GMocrenMessenger::G4GMocrenMessenger(), G4InteractorMessenger::G4InteractorMessenger(), G4MatScanMessenger::G4MatScanMessenger(), G4OpticalParametersMessenger::G4OpticalParametersMessenger(), G4ParticleGunMessenger::G4ParticleGunMessenger(), G4PolarizationMessenger::G4PolarizationMessenger(), G4ProcessManagerMessenger::G4ProcessManagerMessenger(), G4ProcessTableMessenger::G4ProcessTableMessenger(), G4RunMessenger::G4RunMessenger(), G4ScoringMessenger::G4ScoringMessenger(), 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(), G4VisCommandSceneAddScale::G4VisCommandSceneAddScale(), G4VisCommandSceneAddText::G4VisCommandSceneAddText(), G4VisCommandSceneAddText2D::G4VisCommandSceneAddText2D(), G4VisCommandSetColour::G4VisCommandSetColour(), G4VisCommandSetExtentForField::G4VisCommandSetExtentForField(), G4VisCommandSetTextColour::G4VisCommandSetTextColour(), G4VisCommandSpecify::G4VisCommandSpecify(), G4VisCommandsTouchableSet::G4VisCommandsTouchableSet(), G4VisCommandsViewerSet::G4VisCommandsViewerSet(), G4VisCommandViewerCentreOn::G4VisCommandViewerCentreOn(), G4VisCommandViewerCreate::G4VisCommandViewerCreate(), G4UIcmdWith3VectorAndUnit::SetDefaultUnit(), G4UIcmdWithADoubleAndUnit::SetDefaultUnit(), SetDefaultUnit(), G4UIcmdWithAString::SetDefaultValue(), G4GenericMessenger::Command::SetDefaultValue(), G4UIcmdWithABool::SetDefaultValue(), G4UIcmdWithADouble::SetDefaultValue(), G4UIcmdWithADoubleAndUnit::SetDefaultValue(), G4UIcmdWithAnInteger::SetDefaultValue(), G4UIcmdWithALongInt::SetDefaultValue(), G4UIcmdWithNucleusLimits::SetDefaultValue(), G4UIcmdWith3Vector::SetDefaultValue(), and G4UIcmdWith3VectorAndUnit::SetDefaultValue().

◆ SetDefaultValue() [2/4]

void G4UIparameter::SetDefaultValue ( G4double  theDefaultValue)

Definition at line 125 of file G4UIparameter.cc.

126{
127 std::ostringstream os;
128 os << theDefaultValue;
129 defaultValue = os.str();
130}

◆ SetDefaultValue() [3/4]

void G4UIparameter::SetDefaultValue ( G4int  theDefaultValue)

Definition at line 109 of file G4UIparameter.cc.

110{
111 std::ostringstream os;
112 os << theDefaultValue;
113 defaultValue = os.str();
114}

◆ SetDefaultValue() [4/4]

void G4UIparameter::SetDefaultValue ( G4long  theDefaultValue)

Definition at line 117 of file G4UIparameter.cc.

118{
119 std::ostringstream os;
120 os << theDefaultValue;
121 defaultValue = os.str();
122}

◆ SetGuidance()

void G4UIparameter::SetGuidance ( const char *  theGuidance)
inline

Definition at line 127 of file G4UIparameter.hh.

128 {
129 parameterGuidance = theGuidance;
130 }

Referenced by G4OpticalParametersMessenger::G4OpticalParametersMessenger(), G4RadioactiveDecayBaseMessenger::G4RadioactiveDecayBaseMessenger(), G4RadioactiveDecaymessenger::G4RadioactiveDecaymessenger(), G4VisCommandGeometrySetColour::G4VisCommandGeometrySetColour(), G4VisCommandGeometrySetDaughtersInvisible::G4VisCommandGeometrySetDaughtersInvisible(), G4VisCommandGeometrySetForceAuxEdgeVisible::G4VisCommandGeometrySetForceAuxEdgeVisible(), G4VisCommandGeometrySetForceCloud::G4VisCommandGeometrySetForceCloud(), G4VisCommandGeometrySetForceLineSegmentsPerCircle::G4VisCommandGeometrySetForceLineSegmentsPerCircle(), G4VisCommandGeometrySetForceSolid::G4VisCommandGeometrySetForceSolid(), G4VisCommandGeometrySetForceWireframe::G4VisCommandGeometrySetForceWireframe(), G4VisCommandGeometrySetLineStyle::G4VisCommandGeometrySetLineStyle(), G4VisCommandGeometrySetLineWidth::G4VisCommandGeometrySetLineWidth(), G4VisCommandGeometrySetVisibility::G4VisCommandGeometrySetVisibility(), G4VisCommandOpen::G4VisCommandOpen(), G4VisCommandSceneAddLogo::G4VisCommandSceneAddLogo(), G4VisCommandSceneAddScale::G4VisCommandSceneAddScale(), G4VisCommandSceneAddText::G4VisCommandSceneAddText(), G4VisCommandSceneAddText2D::G4VisCommandSceneAddText2D(), G4VisCommandSetColour::G4VisCommandSetColour(), G4VisCommandSetTextColour::G4VisCommandSetTextColour(), G4VisCommandSetTouchable::G4VisCommandSetTouchable(), G4VisCommandsViewerSet::G4VisCommandsViewerSet(), G4VisCommandViewerCentreOn::G4VisCommandViewerCentreOn(), and G4VisCommandViewerCreate::G4VisCommandViewerCreate().

◆ SetOmittable()

◆ SetParameterCandidates()

◆ SetParameterName()

◆ SetParameterRange()

◆ SetWidget()

void G4UIparameter::SetWidget ( G4int  theWidget)
inline

Definition at line 122 of file G4UIparameter.hh.

122{ widget = theWidget; }

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