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

#include <G4GeometryMessenger.hh>

Inheritance diagram for G4GeometryMessenger:
Collaboration diagram for G4GeometryMessenger:

Public Member Functions

 G4GeometryMessenger (G4TransportationManager *tman)
 
 ~G4GeometryMessenger ()
 
void SetNewValue (G4UIcommand *command, G4String newValues)
 
G4String GetCurrentValue (G4UIcommand *command)
 
- Public Member Functions inherited from G4UImessenger
 G4UImessenger ()
 
 G4UImessenger (const G4String &path, const G4String &dsc, G4bool commandsToBeBroadcasted=true)
 
virtual ~G4UImessenger ()
 
G4bool operator== (const G4UImessenger &messenger) const
 
G4bool CommandsShouldBeInMaster () const
 

Additional Inherited Members

- Protected Member Functions inherited from G4UImessenger
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 inherited from G4UImessenger
G4UIdirectorybaseDir
 
G4String baseDirName
 
G4bool commandsShouldBeInMaster
 

Detailed Description

Definition at line 57 of file G4GeometryMessenger.hh.

Constructor & Destructor Documentation

G4GeometryMessenger::G4GeometryMessenger ( G4TransportationManager tman)

Definition at line 59 of file G4GeometryMessenger.cc.

60  : tol(0.0), recLevel(0), recDepth(-1), tmanager(tman), tvolume(0)
61 {
62  geodir = new G4UIdirectory( "/geometry/" );
63  geodir->SetGuidance( "Geometry control commands." );
64 
65  //
66  // Geometry navigator commands
67  //
68  navdir = new G4UIdirectory( "/geometry/navigator/" );
69  navdir->SetGuidance( "Geometry navigator control setup." );
70 
71  resCmd = new G4UIcmdWithoutParameter( "/geometry/navigator/reset", this );
72  resCmd->SetGuidance( "Reset navigator and navigation history." );
73  resCmd->SetGuidance( "NOTE: must be called only after kernel has been" );
74  resCmd->SetGuidance( " initialized once through the run manager!" );
76 
77  verbCmd = new G4UIcmdWithAnInteger( "/geometry/navigator/verbose", this );
78  verbCmd->SetGuidance( "Set run-time verbosity for the navigator." );
79  verbCmd->SetGuidance(" 0 : Silent (default)");
80  verbCmd->SetGuidance(" 1 : Display volume positioning and step lengths");
81  verbCmd->SetGuidance(" 2 : Display step/safety info on point location");
82  verbCmd->SetGuidance(" 3 : Display minimal state at -every- step");
83  verbCmd->SetGuidance(" 4 : Maximum verbosity (very detailed!)");
84  verbCmd->SetGuidance( "NOTE: this command has effect -only- if Geant4 has" );
85  verbCmd->SetGuidance( " been installed with the G4VERBOSE flag set!" );
86  verbCmd->SetParameterName("level",true);
87  verbCmd->SetDefaultValue(0);
88  verbCmd->SetRange("level >=0 && level <=4");
89 
90  chkCmd = new G4UIcmdWithABool( "/geometry/navigator/check_mode", this );
91  chkCmd->SetGuidance( "Set navigator in -check_mode- state." );
92  chkCmd->SetGuidance( "This will cause extra checks to be applied during" );
93  chkCmd->SetGuidance( "navigation. More strict and less tolerant conditions" );
94  chkCmd->SetGuidance( "are applied. A run-time performance penalty may be" );
95  chkCmd->SetGuidance( "observed when the -check_mode- state is activated." );
96  chkCmd->SetGuidance( "NOTE: this command has effect -only- if Geant4 has" );
97  chkCmd->SetGuidance( " been installed with the G4VERBOSE flag set!" );
98  chkCmd->SetParameterName("checkFlag",true);
99  chkCmd->SetDefaultValue(false);
101 
102  pchkCmd = new G4UIcmdWithABool( "/geometry/navigator/push_notify", this );
103  pchkCmd->SetGuidance( "Set navigator verbosity push notifications." );
104  pchkCmd->SetGuidance( "This allows to disable/re-enable verbosity in" );
105  pchkCmd->SetGuidance( "navigation, when tracks may get stuck and require" );
106  pchkCmd->SetGuidance( "one artificial push along the direction by the" );
107  pchkCmd->SetGuidance( "navigator. Notification is active by default." );
108  pchkCmd->SetGuidance( "NOTE: this command has effect -only- if Geant4 has" );
109  pchkCmd->SetGuidance( " been installed with the G4VERBOSE flag set!" );
110  pchkCmd->SetParameterName("pushFlag",true);
111  pchkCmd->SetDefaultValue(true);
113 
114  //
115  // Geometry verification test commands
116  //
117  testdir = new G4UIdirectory( "/geometry/test/" );
118  testdir->SetGuidance( "Geometry verification control setup." );
119  testdir->SetGuidance( "Helps in detecting possible overlapping regions." );
120 
121  tolCmd = new G4UIcmdWithADoubleAndUnit( "/geometry/test/tolerance",this );
122  tolCmd->SetGuidance( "Define tolerance (in mm) by which overlaps reports" );
123  tolCmd->SetGuidance( "should be reported. By default, all overlaps are" );
124  tolCmd->SetGuidance( "reported, i.e. tolerance is set to: 0*mm." );
125  tolCmd->SetParameterName( "Tolerance", true, true );
126  tolCmd->SetDefaultValue( 0 );
127  tolCmd->SetDefaultUnit( "mm" );
128  tolCmd->SetUnitCategory( "Length" );
129 
130  verCmd = new G4UIcmdWithABool( "/geometry/test/verbosity", this );
131  verCmd->SetGuidance( "Specify if running in verbosity mode or not." );
132  verCmd->SetGuidance( "By default verbosity is set to ON (TRUE)." );
133  verCmd->SetParameterName("verbosity",true);
134  verCmd->SetDefaultValue(true);
136 
137  rslCmd = new G4UIcmdWithAnInteger( "/geometry/test/resolution", this );
138  rslCmd->SetGuidance( "Set the number of points on surface to be generated for" );
139  rslCmd->SetGuidance( "checking overlaps." );
140  rslCmd->SetParameterName("resolution",true);
141  rslCmd->SetDefaultValue(10000);
142 
143  rcsCmd = new G4UIcmdWithAnInteger( "/geometry/test/recursion_start", this );
144  rcsCmd->SetGuidance( "Set the initial level in the geometry tree for recursion." );
145  rcsCmd->SetGuidance( "recursive_test will then start from the specified level." );
146  rcsCmd->SetParameterName("initial_level",true);
147  rcsCmd->SetDefaultValue(0);
148 
149  rcdCmd = new G4UIcmdWithAnInteger( "/geometry/test/recursion_depth", this );
150  rcdCmd->SetGuidance( "Set the depth in the geometry tree for recursion." );
151  rcdCmd->SetGuidance( "recursive_test will then stop after reached the specified depth." );
152  rcdCmd->SetGuidance( "By default, recursion will proceed for the whole depth." );
153  rcdCmd->SetParameterName("recursion_depth",true);
154  rcdCmd->SetDefaultValue(-1);
155 
156  errCmd = new G4UIcmdWithAnInteger( "/geometry/test/maximum_errors", this );
157  errCmd->SetGuidance( "Set the maximum number of overlap errors to report" );
158  errCmd->SetGuidance( "for each single volume being checked." );
159  errCmd->SetGuidance( "Once reached the maximum number specified, overlaps" );
160  errCmd->SetGuidance( "affecting that volume further than that are simply ignored." );
161  errCmd->SetParameterName("maximum_errors",true);
162  errCmd->SetDefaultValue(1);
163 
164  recCmd = new G4UIcmdWithoutParameter( "/geometry/test/run", this );
165  recCmd->SetGuidance( "Start running the recursive overlap check." );
166  recCmd->SetGuidance( "Volumes are recursively asked to verify for overlaps" );
167  recCmd->SetGuidance( "for points generated on the surface against their" );
168  recCmd->SetGuidance( "respective mother volume and sisters at the same" );
169  recCmd->SetGuidance( "level, performing for all daughters and daughters of" );
170  recCmd->SetGuidance( "daughters, etc." );
171  recCmd->SetGuidance( "NOTE: it may take a very long time," );
172  recCmd->SetGuidance( " depending on the geometry complexity !");
174 }
void SetParameterName(const char *theName, G4bool omittable, G4bool currentAsDefault=false)
void SetUnitCategory(const char *unitCategory)
void SetDefaultValue(G4bool defVal)
void SetParameterName(const char *theName, G4bool omittable, G4bool currentAsDefault=false)
void SetRange(const char *rs)
Definition: G4UIcommand.hh:125
void SetGuidance(const char *aGuidance)
Definition: G4UIcommand.hh:161
void AvailableForStates(G4ApplicationState s1)
Definition: G4UIcommand.cc:240
void SetDefaultUnit(const char *defUnit)
void SetDefaultValue(G4int defVal)
void SetParameterName(const char *theName, G4bool omittable, G4bool currentAsDefault=false)

Here is the call graph for this function:

G4GeometryMessenger::~G4GeometryMessenger ( )

Definition at line 179 of file G4GeometryMessenger.cc.

180 {
181  delete verCmd; delete recCmd; delete rslCmd;
182  delete resCmd; delete rcsCmd; delete rcdCmd; delete errCmd;
183  delete tolCmd;
184  delete verbCmd; delete pchkCmd; delete chkCmd;
185  delete geodir; delete navdir; delete testdir;
186  delete tvolume;
187 }

Member Function Documentation

G4String G4GeometryMessenger::GetCurrentValue ( G4UIcommand command)
virtual

Reimplemented from G4UImessenger.

Definition at line 261 of file G4GeometryMessenger.cc.

262 {
263  G4String cv = "";
264  if (command == tolCmd) {
265  cv = tolCmd->ConvertToString( tol, "mm" );
266  }
267  return cv;
268 }
static G4String ConvertToString(G4bool boolVal)
Definition: G4UIcommand.cc:372

Here is the call graph for this function:

void G4GeometryMessenger::SetNewValue ( G4UIcommand command,
G4String  newValues 
)
virtual

Reimplemented from G4UImessenger.

Definition at line 214 of file G4GeometryMessenger.cc.

215 {
216  if (command == resCmd) {
217  ResetNavigator();
218  }
219  else if (command == verbCmd) {
220  SetVerbosity( newValues );
221  }
222  else if (command == chkCmd) {
223  SetCheckMode( newValues );
224  }
225  else if (command == tolCmd) {
226  Init();
227  tol = tolCmd->GetNewDoubleValue( newValues )
228  * tolCmd->GetNewUnitValue( newValues );
229  tvolume->SetTolerance(tol);
230  }
231  else if (command == verCmd) {
232  Init();
233  tvolume->SetVerbosity(verCmd->GetNewBoolValue( newValues ));
234  }
235  else if (command == rslCmd) {
236  Init();
237  tvolume->SetResolution(rslCmd->GetNewIntValue( newValues ));
238  }
239  else if (command == rcsCmd) {
240  recLevel = rcsCmd->GetNewIntValue( newValues );
241  }
242  else if (command == rcdCmd) {
243  recDepth = rcdCmd->GetNewIntValue( newValues );
244  }
245  else if (command == errCmd) {
246  Init();
247  tvolume->SetErrorsThreshold(errCmd->GetNewIntValue( newValues ));
248  }
249  else if (command == recCmd) {
250  Init();
251  G4cout << "Running geometry overlaps check..." << G4endl;
252  RecursiveOverlapTest();
253  G4cout << "Geometry overlaps check completed !" << G4endl;
254  }
255 }
void Init()
Definition: G4IonTable.cc:90
void SetResolution(G4int points)
void SetVerbosity(G4bool verbosity)
static G4int GetNewIntValue(const char *paramString)
void SetTolerance(G4double tolerance)
static G4double GetNewDoubleValue(const char *paramString)
static G4bool GetNewBoolValue(const char *paramString)
G4GLOB_DLL std::ostream G4cout
#define G4endl
Definition: G4ios.hh:61
void SetErrorsThreshold(G4int max)
static G4double GetNewUnitValue(const char *paramString)

Here is the call graph for this function:


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