Geant4  10.03.p01
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
G4UImessenger Class Reference

#include <G4UImessenger.hh>

Inherited by G4AdjointSimMessenger, G4AnalysisMessenger, G4ASCIITreeMessenger, G4CascadeParamMessenger, G4DecayTableMessenger, G4DMmessenger, G4DNAChemistryManager, G4EmMessenger, G4EmParametersMessenger, G4ErrorMessenger, G4EvManMessenger, G4FastSimulationMessenger, G4FileMessenger, G4GDMLMessenger, G4GeneralParticleSourceMessenger, G4GenericMessenger, G4GeometryMessenger, G4GlobalMagFieldMessenger, G4GMocrenMessenger, G4H1Messenger, G4H2Messenger, G4H3Messenger, G4HadronicEPTestMessenger, G4HepRepMessenger, G4HnMessenger, G4INCLXXInterfaceMessenger, G4InteractorMessenger, G4LocalThreadCoutMessenger, G4MatScanMessenger, G4ModelCmdCreateContextDir< M >, G4MoleculeGunMessenger, G4MoleculeShootMessenger, G4NeutronKillerMessenger, G4NistMessenger, G4NtupleMessenger, G4NuclideTableMessenger, G4OpenGLViewerMessenger, G4OpticalPhysicsMessenger, G4P1Messenger, G4P2Messenger, G4ParticleGunMessenger, G4ParticleHPMessenger, G4ParticleMessenger, G4ParticlePropertyMessenger, G4PersistencyCenterMessenger, G4PlotMessenger, G4PolarizationMessenger, G4ProcessManagerMessenger, G4ProcessTableMessenger, G4ProductionCutsTableMessenger, G4RadioactiveDecaymessenger, G4ReactionTableMessenger, G4RTMessenger, G4RunMessenger, G4SchedulerMessenger, G4ScoreQuantityMessenger, G4ScoringMessenger, G4SDmessenger, G4StackingMessenger, G4tgrMessenger, G4TrackingMessenger, G4UCNBoundaryProcessMessenger, G4UIcontrolMessenger, G4UnitsMessenger, G4UserPhysicsListMessenger, G4VisCommandListManagerList< Manager >, G4VisCommandListManagerSelect< Manager >, G4VisCommandManagerMode< Manager >, G4VITSteppingVerbose [private], G4VModelCommand< T >, G4VModelCommand< M >, G4VVisCommand, and GFlashShowerModelMessenger.

Collaboration diagram for G4UImessenger:

Public Member Functions

 G4UImessenger ()
 
 G4UImessenger (const G4String &path, const G4String &dsc, G4bool commandsToBeBroadcasted=true)
 
virtual ~G4UImessenger ()
 
virtual G4String GetCurrentValue (G4UIcommand *command)
 
virtual void SetNewValue (G4UIcommand *command, G4String newValue)
 
G4bool operator== (const G4UImessenger &messenger) const
 
G4bool CommandsShouldBeInMaster () const
 

Protected Member Functions

G4String ItoS (G4int i)
 
G4String DtoS (G4double a)
 
G4String BtoS (G4bool b)
 
G4int StoI (G4String s)
 
G4double StoD (G4String s)
 
G4bool StoB (G4String s)
 
void AddUIcommand (G4UIcommand *newCommand)
 
void CreateDirectory (const G4String &path, const G4String &dsc, G4bool commandsToBeBroadcasted=true)
 
template<typename T >
T * CreateCommand (const G4String &cname, const G4String &dsc)
 

Protected Attributes

G4UIdirectorybaseDir
 
G4String baseDirName
 
G4bool commandsShouldBeInMaster
 

Detailed Description

Definition at line 47 of file G4UImessenger.hh.

Constructor & Destructor Documentation

G4UImessenger::G4UImessenger ( )

Definition at line 38 of file G4UImessenger.cc.

39  : baseDir(NULL), baseDirName(""), commandsShouldBeInMaster(false)
40 {
41 }
G4String baseDirName
G4UIdirectory * baseDir
G4bool commandsShouldBeInMaster
G4UImessenger::G4UImessenger ( const G4String path,
const G4String dsc,
G4bool  commandsToBeBroadcasted = true 
)

Definition at line 43 of file G4UImessenger.cc.

45  : baseDir(NULL), baseDirName(""), commandsShouldBeInMaster(false)
46 {
47  CreateDirectory(path, dsc, commandsToBeBroadcasted);
48 }
G4String baseDirName
void CreateDirectory(const G4String &path, const G4String &dsc, G4bool commandsToBeBroadcasted=true)
G4UIdirectory * baseDir
G4bool commandsShouldBeInMaster

Here is the call graph for this function:

G4UImessenger::~G4UImessenger ( )
virtual

Definition at line 50 of file G4UImessenger.cc.

51 {
52  if(baseDir) delete baseDir;
53 }
G4UIdirectory * baseDir

Member Function Documentation

void G4UImessenger::AddUIcommand ( G4UIcommand newCommand)
protected

Definition at line 118 of file G4UImessenger.cc.

119 {
120  G4cerr << "Warning : Old style definition of G4UIcommand <"
121  << newCommand->GetCommandPath() << ">." << G4endl;
122 }
const G4String & GetCommandPath() const
Definition: G4UIcommand.hh:139
#define G4endl
Definition: G4ios.hh:61
G4GLOB_DLL std::ostream G4cerr

Here is the call graph for this function:

G4String G4UImessenger::BtoS ( G4bool  b)
protected

Definition at line 82 of file G4UImessenger.cc.

83 {
84  G4String vl = "0";
85  if(b) vl = "true";
86  return vl;
87 }
G4bool G4UImessenger::CommandsShouldBeInMaster ( ) const
inline

Definition at line 95 of file G4UImessenger.hh.

96  { return commandsShouldBeInMaster; }
G4bool commandsShouldBeInMaster
template<typename T >
T * G4UImessenger::CreateCommand ( const G4String cname,
const G4String dsc 
)
protected

Definition at line 100 of file G4UImessenger.hh.

101 {
102  G4String path;
103  if( cname(0) != '/' ) {
104  path = baseDirName + cname;
105  if (path(0) != '/') path = "/" + path;
106  }
107 
108  T* command = new T(path.c_str(), this);
109  command-> SetGuidance(dsc.c_str());
110 
111  return command;
112 }
G4String baseDirName
void G4UImessenger::CreateDirectory ( const G4String path,
const G4String dsc,
G4bool  commandsToBeBroadcasted = true 
)
protected

Definition at line 124 of file G4UImessenger.cc.

126 {
128 
129  G4String fullpath = path;
130  if(fullpath(fullpath.length()-1) != '/') fullpath.append("/");
131 
132  G4UIcommandTree* tree= ui-> GetTree()-> FindCommandTree(fullpath.c_str());
133  if (tree) {
134  baseDirName = tree-> GetPathName();
135  } else {
136  baseDir = new G4UIdirectory(fullpath.c_str(),commandsToBeBroadcasted);
137  baseDirName = fullpath;
138  baseDir-> SetGuidance(dsc.c_str());
139  }
140 }
G4String baseDirName
static G4UImanager * GetUIpointer()
Definition: G4UImanager.cc:59
G4String & append(const G4String &)
G4UIdirectory * baseDir

Here is the call graph for this function:

Here is the caller graph for this function:

G4String G4UImessenger::DtoS ( G4double  a)
protected

Definition at line 75 of file G4UImessenger.cc.

76 {
77  std::ostringstream os;
78  os << a;
79  return G4String(os.str());
80 }

Here is the caller graph for this function:

G4String G4UImessenger::GetCurrentValue ( G4UIcommand command)
virtual

Reimplemented in G4VisCommandSceneAddVolume, G4VisCommandSceneAddUserAction, G4VisCommandSceneAddTrajectories, G4VisCommandSceneAddText2D, G4VisCommandSceneAddText, G4VisCommandSceneAddScale, G4VisCommandSceneAddPSHits, G4VisCommandViewerZoom, G4VisCommandSceneAddMagneticField, G4VisCommandViewerUpdate, G4VisCommandViewerSelect, G4VisCommandGeometrySetVisibility, G4VisCommandSceneAddLogo2D, G4VisCommandViewerScale, G4VisCommandGeometrySetLineWidth, G4VisCommandSceneAddLogo, G4VisCommandViewerSave, G4VisCommandGeometrySetLineStyle, G4VisCommandSceneAddLogicalVolume, G4VisCommandViewerRebuild, G4VisCommandGeometrySetForceWireframe, G4VisCommandViewerRefresh, G4VisCommandSceneAddLine2D, G4VisCommandGeometrySetForceLineSegmentsPerCircle, G4VisCommandViewerReset, G4VisCommandGeometrySetForceSolid, G4VisCommandViewerPan, G4VisCommandSceneAddLine, G4VisCommandViewerList, G4VisCommandGeometrySetForceAuxEdgeVisible, G4VisCommandSceneAddHits, G4VisCommandViewerInterpolate, G4VisCommandSceneAddGhosts, G4VisCommandGeometrySetDaughtersInvisible, G4VisCommandViewerFlush, G4VisCommandGeometrySetColour, G4VisCommandSceneAddFrame, G4VisCommandManagerMode< Manager >, G4VisCommandViewerDolly, G4VisCommandViewerCreate, G4VisCommandSceneAddExtent, G4VisCommandViewerCopyViewFrom, G4GeneralParticleSourceMessenger, G4VisCommandSceneAddEventID, G4VisCommandViewerClone, G4VisCommandSceneSelect, G4VisCommandSceneAddDigis, G4VITSteppingVerbose, G4VisCommandViewerClearVisAttributesModifiers, G4VisCommandListManagerSelect< Manager >, G4VisCommandSceneNotifyHandlers, G4DNAChemistryManager, G4VisCommandViewerClearTransients, G4VisCommandSceneList, G4VisCommandSetTouchable, G4VisCommandVerbose, G4ParticleMessenger, G4MoleculeGunMessenger, G4VisCommandViewerClearCutawayPlanes, G4VisCommandSceneAddDate, G4VisCommandSceneEndOfRunAction, G4VisCommandSetTextSize, G4VisCommandReviewKeptEvents, G4UserPhysicsListMessenger, G4UIcontrolMessenger, G4VisCommandViewerClear, G4VisCommandSceneAddAxes, G4ProcessManagerMessenger, G4VisCommandSceneEndOfEventAction, G4VisCommandSetTextLayout, G4VisCommandList, G4VisCommandSceneHandlerSelect, G4ParticlePropertyMessenger, G4ProductionCutsTableMessenger, G4RunMessenger, G4DecayTableMessenger, G4SchedulerMessenger, G4ScoringMessenger, G4ProcessTableMessenger, G4VisCommandViewerChangeCutawayPlane, G4MoleculeShootMessenger, G4ScoreQuantityMessenger, G4PolarizationMessenger, G4VisCommandSetTextColour, G4VisCommandGeometryRestore, G4VisCommandSceneCreate, G4VisCommandSceneHandlerList, G4TrackingMessenger, G4GeometryMessenger, GFlashShowerModelMessenger, G4ParticleGunMessenger, G4VisCommandSceneAddArrow2D, G4PersistencyCenterMessenger, G4VisCommandViewerAddCutawayPlane, G4tgrMessenger, G4VisCommandSetLineWidth, G4RTMessenger, G4VisCommandEnable, G4VisCommandGeometryList, G4VModelCommand< T >, G4VModelCommand< M >, G4VisCommandModelCreate< Factory >, G4VisCommandSceneActivateModel, G4VisCommandSceneHandlerCreate, G4VisCommandViewerDefaultStyle, G4EvManMessenger, G4GenericMessenger, G4MatScanMessenger, G4VisCommandListManagerList< Manager >, G4GMocrenMessenger, G4ASCIITreeMessenger, G4VisCommandSceneAddArrow, G4VisCommandsViewerSet, G4HepRepMessenger, G4VisCommandsTouchableSet, G4VisCommandSetColour, G4VisCommandAbortReviewKeptEvents, G4VisCommandSceneHandlerAttach, G4VisCommandViewerDefaultHiddenEdge, and G4VisCommandsTouchable.

Definition at line 55 of file G4UImessenger.cc.

56 {
57  G4String nullString;
58  return nullString;
59 }

Here is the caller graph for this function:

G4String G4UImessenger::ItoS ( G4int  i)
protected

Definition at line 68 of file G4UImessenger.cc.

69 {
70  std::ostringstream os;
71  os << i;
72  return G4String(os.str());
73 }

Here is the caller graph for this function:

G4bool G4UImessenger::operator== ( const G4UImessenger messenger) const

Definition at line 64 of file G4UImessenger.cc.

64  {
65  return this == &messenger;
66 }
void G4UImessenger::SetNewValue ( G4UIcommand command,
G4String  newValue 
)
virtual

Reimplemented in G4ModelCmdApplyString< M >, G4ModelCmdApplyInteger< M >, G4ModelCmdApplyDoubleAndUnit< M >, G4VisCommandSceneAddVolume, G4VisCommandSceneAddUserAction, G4VisCommandSceneAddTrajectories, G4VisCommandSceneAddText2D, G4ModelCmdApplyDouble< M >, G4VisCommandSceneAddText, G4VisCommandSceneAddScale, G4VisCommandSceneAddPSHits, G4VisCommandViewerZoom, G4VisCommandSceneAddMagneticField, G4ModelCmdApplyNull< M >, G4VisCommandViewerUpdate, G4VisCommandViewerSelect, G4VisCommandGeometrySetVisibility, G4VisCommandSceneAddLogo2D, G4VisCommandViewerScale, G4VisCommandGeometrySetLineWidth, G4VisCommandSceneAddLogo, G4VisCommandViewerSave, G4VisCommandGeometrySetLineStyle, G4ModelCmdApplyBool< M >, G4VisCommandSceneAddLogicalVolume, G4VisCommandViewerRebuild, G4VisCommandGeometrySetForceWireframe, G4VisCommandViewerRefresh, G4VisCommandSceneAddLine2D, G4VisCommandGeometrySetForceLineSegmentsPerCircle, G4VisCommandViewerReset, G4VisCommandGeometrySetForceSolid, G4VisCommandViewerPan, G4VisCommandSceneAddLine, G4VisCommandViewerList, G4VisCommandGeometrySetForceAuxEdgeVisible, G4VisCommandSceneAddHits, G4VisCommandViewerInterpolate, G4VisCommandSceneAddGhosts, G4VisCommandGeometrySetDaughtersInvisible, G4VisCommandViewerFlush, G4VisCommandGeometrySetColour, G4VisCommandSceneAddFrame, G4VisCommandManagerMode< Manager >, G4VisCommandViewerDolly, G4ModelCmdApplyColour< M >, G4VisCommandViewerCreate, G4VisCommandSceneAddExtent, G4VisCommandViewerCopyViewFrom, G4AdjointSimMessenger, G4GeneralParticleSourceMessenger, G4VisCommandSceneAddEventID, G4VisCommandViewerClone, G4VisCommandSceneSelect, G4VisCommandSceneAddDigis, G4VisCommandViewerClearVisAttributesModifiers, G4VisCommandListManagerSelect< Manager >, G4VisCommandSceneNotifyHandlers, G4VITSteppingVerbose, G4DNAChemistryManager, G4VisCommandViewerClearTransients, G4VisCommandSceneList, G4VisCommandSetTouchable, G4VisCommandVerbose, G4ParticleMessenger, G4VisCommandViewerClearCutawayPlanes, G4MoleculeGunMessenger, G4VisCommandSceneAddDate, G4VisCommandSceneEndOfRunAction, G4VisCommandSetTextSize, G4VisCommandReviewKeptEvents, G4RadioactiveDecaymessenger, G4UserPhysicsListMessenger, G4NistMessenger, G4VisCommandViewerClear, G4VisCommandSceneAddAxes, G4UIcontrolMessenger, G4OpticalPhysicsMessenger, G4VisCommandSpecify, G4VisCommandSceneEndOfEventAction, G4VisCommandSetTextLayout, G4VisCommandList, G4VisCommandSceneHandlerSelect, G4ProcessManagerMessenger, G4ParticlePropertyMessenger, G4ProductionCutsTableMessenger, G4RunMessenger, G4EmParametersMessenger, G4VisCommandViewerChangeCutawayPlane, G4DecayTableMessenger, G4SchedulerMessenger, G4VisCommandOpen, G4AnalysisMessenger, G4ProcessTableMessenger, G4ScoringMessenger, G4MoleculeShootMessenger, G4UCNBoundaryProcessMessenger, G4VisCommandSetTextColour, G4VisCommandInitialize, G4VisCommandGeometryRestore, G4VisCommandSceneCreate, G4VisCommandSceneHandlerList, G4PolarizationMessenger, G4ScoreQuantityMessenger, G4TrackingMessenger, G4GeometryMessenger, G4INCLXXInterfaceMessenger, G4NuclideTableMessenger, G4GlobalMagFieldMessenger, GFlashShowerModelMessenger, G4VisCommandSceneAddArrow2D, G4ErrorMessenger, G4VisCommandDrawVolume, G4VisCommandViewerAddCutawayPlane, G4ParticleGunMessenger, G4GDMLMessenger, G4FastSimulationMessenger, G4NeutronKillerMessenger, G4ModelCmdApplyStringColour< M >, G4PersistencyCenterMessenger, G4CascadeParamMessenger, G4DMmessenger, G4VisCommandSetLineWidth, G4RTMessenger, G4H1Messenger, G4SDmessenger, G4HadronicEPTestMessenger, G4VisCommandEnable, G4VisCommandGeometryList, G4GenericMessenger, G4tgrMessenger, G4EmMessenger, G4VisCommandModelCreate< Factory >, G4VisCommandSceneActivateModel, G4VisCommandSceneHandlerCreate, G4VisCommandViewerDefaultStyle, G4FileMessenger, G4UnitsMessenger, G4MatScanMessenger, G4HnMessenger, G4PlotMessenger, G4LocalThreadCoutMessenger, G4VisCommandListManagerList< Manager >, G4H2Messenger, G4H3Messenger, G4P1Messenger, G4P2Messenger, G4EvManMessenger, G4StackingMessenger, G4GMocrenMessenger, G4NtupleMessenger, G4ASCIITreeMessenger, G4VisCommandDrawView, G4VisCommandSceneAddArrow, G4VisCommandsViewerSet, G4HepRepMessenger, G4OpenGLViewerMessenger, G4ReactionTableMessenger, G4VisCommandsTouchableSet, G4VisCommandSetColour, G4VisCommandAbortReviewKeptEvents, G4VisCommandSceneHandlerAttach, G4VisCommandViewerDefaultHiddenEdge, G4ParticleHPMessenger, G4VisCommandsTouchable, G4InteractorMessenger, and G4VisCommandDrawTree.

Definition at line 61 of file G4UImessenger.cc.

62 { ; }

Here is the caller graph for this function:

G4bool G4UImessenger::StoB ( G4String  s)
protected

Definition at line 107 of file G4UImessenger.cc.

108 {
109  G4String v = str;
110  v.toUpper();
111  G4bool vl = false;
112  if( v=="Y" || v=="YES" || v=="1" || v=="T" || v=="TRUE" )
113  { vl = true; }
114  return vl;
115 }
void toUpper()
bool G4bool
Definition: G4Types.hh:79

Here is the call graph for this function:

Here is the caller graph for this function:

G4double G4UImessenger::StoD ( G4String  s)
protected

Definition at line 98 of file G4UImessenger.cc.

99 {
100  G4double vl;
101  const char* t = str;
102  std::istringstream is(t);
103  is >> vl;
104  return vl;
105 }
double G4double
Definition: G4Types.hh:76

Here is the caller graph for this function:

G4int G4UImessenger::StoI ( G4String  s)
protected

Definition at line 89 of file G4UImessenger.cc.

90 {
91  G4int vl;
92  const char* t = str;
93  std::istringstream is(t);
94  is >> vl;
95  return vl;
96 }
int G4int
Definition: G4Types.hh:78

Here is the caller graph for this function:

Member Data Documentation

G4UIdirectory* G4UImessenger::baseDir
protected

Definition at line 85 of file G4UImessenger.hh.

G4String G4UImessenger::baseDirName
protected

Definition at line 86 of file G4UImessenger.hh.

G4bool G4UImessenger::commandsShouldBeInMaster
protected

Definition at line 93 of file G4UImessenger.hh.


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