G4GMocrenMessenger Class Reference

#include <G4GMocrenMessenger.hh>

Inheritance diagram for G4GMocrenMessenger:

G4UImessenger

Public Member Functions

 G4GMocrenMessenger ()
virtual ~G4GMocrenMessenger ()
virtual G4String GetCurrentValue (G4UIcommand *command)
virtual void SetNewValue (G4UIcommand *command, G4String newValue)
virtual G4String getEventNumberSuffix ()
virtual G4bool appendGeometry ()
virtual G4bool addPointAttributes ()
virtual G4bool useSolids ()
virtual G4bool writeInvisibles ()
virtual G4String getVolumeName ()
virtual std::vector< G4StringgetHitNames ()
virtual G4String getScoringMeshName ()
virtual std::vector< G4StringgetHitScorerNames ()
virtual void list ()
virtual void getNoVoxels (G4int &nx, G4int &ny, G4int &nz) const
virtual G4bool getDrawVolumeGrid ()

Detailed Description

Definition at line 46 of file G4GMocrenMessenger.hh.


Constructor & Destructor Documentation

G4GMocrenMessenger::G4GMocrenMessenger (  ) 

Definition at line 41 of file G4GMocrenMessenger.cc.

References G4UIcommand::AvailableForStates(), G4State_Idle, G4UIparameter::SetDefaultValue(), G4UIcmdWithABool::SetDefaultValue(), G4UIcmdWithAString::SetDefaultValue(), G4UIcommand::SetGuidance(), G4UIcommand::SetParameter(), G4UIcmdWithABool::SetParameterName(), G4UIcmdWithAString::SetParameterName(), and G4UIparameter::SetParameterRange().

00042   : suffix (""), geometry(true), solids(true), invisibles(true),
00043     kgMocrenVolumeName("gMocrenVolume"),
00044     kgMocrenScoringMeshName("gMocrenScoringMesh"),
00045     kDrawVolumeGrid(false) {
00046 
00047   kgMocrenDirectory = new G4UIdirectory("/vis/gMocren/");
00048   kgMocrenDirectory->SetGuidance("gMocren commands.");
00049 
00050   setEventNumberSuffixCommand = new G4UIcmdWithAString("/vis/gMocren/setEventNumberSuffix", this);
00051   setEventNumberSuffixCommand->SetGuidance("Write separate event files, appended with given suffix.");
00052   setEventNumberSuffixCommand->SetGuidance("Define the suffix with a pattern such as '-0000'.");
00053   setEventNumberSuffixCommand->SetParameterName("suffix",false);
00054   setEventNumberSuffixCommand->SetDefaultValue("");
00055   setEventNumberSuffixCommand->AvailableForStates(G4State_Idle);
00056     
00057   appendGeometryCommand = new G4UIcmdWithABool("/vis/gMocren/appendGeometry", this);
00058   appendGeometryCommand->SetGuidance("Appends copy of geometry to every event.");
00059   appendGeometryCommand->SetParameterName("flag",false);
00060   appendGeometryCommand->SetDefaultValue(true);
00061   appendGeometryCommand->AvailableForStates(G4State_Idle);
00062 
00063   addPointAttributesCommand = new G4UIcmdWithABool("/vis/gMocren/addPointAttributes", this);
00064   addPointAttributesCommand->SetGuidance("Adds point attributes to the points of trajectories.");
00065   addPointAttributesCommand->SetParameterName("flag",false);
00066   addPointAttributesCommand->SetDefaultValue(false);
00067   addPointAttributesCommand->AvailableForStates(G4State_Idle);
00068 
00069   useSolidsCommand = new G4UIcmdWithABool("/vis/gMocren/useSolids", this);
00070   useSolidsCommand->SetGuidance("Use GMocren Solids, rather than Geant4 Primitives.");
00071   useSolidsCommand->SetParameterName("flag",false);
00072   useSolidsCommand->SetDefaultValue(true);
00073   useSolidsCommand->AvailableForStates(G4State_Idle);
00074 
00075   /* Not Enabled Yet
00076      writeInvisiblesCommand = new G4UIcmdWithABool("/vis/gMocren/writeInvisibles", this);
00077      writeInvisiblesCommand->SetGuidance("Write invisible objects.");
00078      writeInvisiblesCommand->SetParameterName("flag",false);
00079      writeInvisiblesCommand->SetDefaultValue(true);
00080      writeInvisiblesCommand->AvailableForStates(G4State_Idle);
00081   */
00082 
00083   kSetgMocrenVolumeNameCommand = new G4UIcmdWithAString("/vis/gMocren/setVolumeName", this);
00084   kSetgMocrenVolumeNameCommand->SetGuidance("detector name for a volume data in gMocren data.");
00085   kSetgMocrenVolumeNameCommand->SetParameterName("kgMocrenVolumeName",false);
00086   kSetgMocrenVolumeNameCommand->SetDefaultValue("gMocrenVolume");
00087   kSetgMocrenVolumeNameCommand->AvailableForStates(G4State_Idle);
00088 
00089   kAddgMocrenHitNameCommand = new G4UIcmdWithAString("/vis/gMocren/addHitName", this);
00090   kAddgMocrenHitNameCommand->SetGuidance("hit name for a dose distribution in gMocren data.");
00091   kAddgMocrenHitNameCommand->SetParameterName("kgMocrenHitName",false);
00092   kAddgMocrenHitNameCommand->AvailableForStates(G4State_Idle);
00093 
00094   kResetgMocrenHitNameCommand = new G4UIcmdWithoutParameter("/vis/gMocren/resetHitNames", this);
00095   kResetgMocrenHitNameCommand->SetGuidance("reset all hit names.");
00096   kResetgMocrenHitNameCommand->AvailableForStates(G4State_Idle);
00097 
00098   kSetgMocrenScoringMeshNameCommand = new G4UIcmdWithAString("/vis/gMocren/setScoringMeshName", this);
00099   kSetgMocrenScoringMeshNameCommand->SetGuidance("scoring mesh name for a dose distribution in gMocren data.");
00100   kSetgMocrenScoringMeshNameCommand->SetParameterName("kgMocrenScoringMeshName",false);
00101   kSetgMocrenScoringMeshNameCommand->SetDefaultValue("gMocrenScoringMesh");
00102   kSetgMocrenScoringMeshNameCommand->AvailableForStates(G4State_Idle);
00103 
00104   kAddgMocrenHitScorerNameCommand = new G4UIcmdWithAString("/vis/gMocren/addHitScorerName", this);
00105   kAddgMocrenHitScorerNameCommand->SetGuidance("hit scorer name for a dose distribution in gMocren data.");
00106   kAddgMocrenHitScorerNameCommand->SetParameterName("kgMocrenHitScorerNames",false);
00107   kAddgMocrenHitScorerNameCommand->AvailableForStates(G4State_Idle);
00108 
00109   kResetgMocrenHitScorerNameCommand = new G4UIcmdWithoutParameter("/vis/gMocren/resetHitScorerName", this);
00110   kResetgMocrenHitScorerNameCommand->SetGuidance("reset all hit scorer names.");
00111   kResetgMocrenHitScorerNameCommand->AvailableForStates(G4State_Idle);
00112 
00113   kSetgMocrenNoVoxelsCommand = new G4UIcommand("/vis/gMocren/setNumberOfVoxels", this);
00114   kSetgMocrenNoVoxelsCommand->SetGuidance("set number of voxels.");
00115   kSetgMocrenNoVoxelsCommand->AvailableForStates(G4State_Idle);
00116   G4UIparameter * param = new G4UIparameter("nX", 'i', false);
00117   param->SetDefaultValue("1");
00118   param->SetParameterRange("nX>0");
00119   kSetgMocrenNoVoxelsCommand->SetParameter(param);
00120   param = new G4UIparameter("nY", 'i', false);
00121   param->SetDefaultValue("1");
00122   param->SetParameterRange("nY>0");
00123   kSetgMocrenNoVoxelsCommand->SetParameter(param);
00124   param = new G4UIparameter("nZ", 'i', false);
00125   param->SetDefaultValue("1");
00126   param->SetParameterRange("nZ>0");
00127   kSetgMocrenNoVoxelsCommand->SetParameter(param);
00128 
00129   kListgMocrenCommand = new G4UIcmdWithoutParameter("/vis/gMocren/list", this);
00130   kListgMocrenCommand->SetGuidance("list gMocren command parameters.");
00131   kListgMocrenCommand->AvailableForStates(G4State_Idle);
00132 
00133   kDrawVolumeGridCommand = new G4UIcmdWithABool("/vis/gMocren/drawVolumeGrid", this);
00134   kDrawVolumeGridCommand->SetGuidance("Add grid of the volume.");
00135   kDrawVolumeGridCommand->SetParameterName("kDrawVolumeGrid",false);
00136   kDrawVolumeGridCommand->SetDefaultValue(false);
00137   kDrawVolumeGridCommand->AvailableForStates(G4State_Idle);
00138 
00139 }

G4GMocrenMessenger::~G4GMocrenMessenger (  )  [virtual]

Definition at line 141 of file G4GMocrenMessenger.cc.

00141                                         {
00142   delete setEventNumberSuffixCommand;
00143   delete appendGeometryCommand;
00144   delete addPointAttributesCommand;
00145   delete useSolidsCommand;
00146   //    delete writeInvisiblesCommand;
00147   delete kSetgMocrenVolumeNameCommand;
00148   delete kAddgMocrenHitNameCommand;
00149   delete kResetgMocrenHitNameCommand;
00150   //
00151   delete kSetgMocrenScoringMeshNameCommand;
00152   delete kAddgMocrenHitScorerNameCommand;
00153   delete kResetgMocrenHitScorerNameCommand;
00154   //
00155   delete kSetgMocrenNoVoxelsCommand;
00156   //
00157   delete kgMocrenDirectory;
00158   //
00159   delete kDrawVolumeGridCommand;
00160 }


Member Function Documentation

G4bool G4GMocrenMessenger::addPointAttributes (  )  [virtual]

Definition at line 243 of file G4GMocrenMessenger.cc.

00243                                               {
00244   return pointAttributes;
00245 }

G4bool G4GMocrenMessenger::appendGeometry (  )  [virtual]

Definition at line 239 of file G4GMocrenMessenger.cc.

00239                                           {
00240   return geometry;
00241 }

G4String G4GMocrenMessenger::GetCurrentValue ( G4UIcommand command  )  [virtual]

Reimplemented from G4UImessenger.

Definition at line 162 of file G4GMocrenMessenger.cc.

References G4UIcommand::ConvertToString().

00162                                                                   {
00163   if (command==setEventNumberSuffixCommand) {
00164     return suffix;
00165   } else if (command==appendGeometryCommand) {
00166     return appendGeometryCommand->ConvertToString(geometry); 
00167   } else if (command==addPointAttributesCommand) {
00168     return addPointAttributesCommand->ConvertToString(pointAttributes); 
00169   } else if (command==useSolidsCommand) {
00170     return useSolidsCommand->ConvertToString(solids);
00171     //    } else if (command==writeInvisiblesCommand) {
00172     //        return writeInvisiblesCommand->ConvertToString(invisibles);
00173   } else if (command == kSetgMocrenVolumeNameCommand) {
00174     return kgMocrenVolumeName;
00175   } else if (command == kAddgMocrenHitNameCommand) {
00176     G4String strval;
00177     std::vector<G4String>::iterator itr = kgMocrenHitNames.begin();
00178     for(; itr != kgMocrenHitNames.end(); itr++) {
00179       strval += *itr;
00180       strval += " ";
00181     }
00182     return strval;
00183   } else if (command == kSetgMocrenScoringMeshNameCommand) {
00184     return kgMocrenScoringMeshName;
00185   } else if (command == kAddgMocrenHitScorerNameCommand) {
00186     G4String strval;
00187     std::vector<G4String>::iterator itr = kgMocrenHitScorerNames.begin();
00188     for(; itr != kgMocrenHitScorerNames.end(); itr++) {
00189       strval += *itr;
00190       strval += " ";
00191     }
00192     return strval;
00193   } else if (command==kDrawVolumeGridCommand) {
00194     return kDrawVolumeGridCommand->ConvertToString(kDrawVolumeGrid);
00195   } else {
00196     return "";
00197   }
00198 }

virtual G4bool G4GMocrenMessenger::getDrawVolumeGrid (  )  [inline, virtual]

Definition at line 66 of file G4GMocrenMessenger.hh.

Referenced by G4GMocrenFileSceneHandler::AddSolid().

00066 {return kDrawVolumeGrid;}

G4String G4GMocrenMessenger::getEventNumberSuffix (  )  [virtual]

Definition at line 235 of file G4GMocrenMessenger.cc.

00235                                                   {
00236   return suffix;
00237 }

std::vector< G4String > G4GMocrenMessenger::getHitNames (  )  [virtual]

Definition at line 259 of file G4GMocrenMessenger.cc.

Referenced by G4GMocrenFileSceneHandler::AddCompound().

00259                                                     {
00260   return kgMocrenHitNames;
00261 }

std::vector< G4String > G4GMocrenMessenger::getHitScorerNames (  )  [virtual]

Definition at line 267 of file G4GMocrenMessenger.cc.

Referenced by G4GMocrenFileSceneHandler::AddCompound().

00267                                                           {
00268   return kgMocrenHitScorerNames;
00269 }

void G4GMocrenMessenger::getNoVoxels ( G4int nx,
G4int ny,
G4int nz 
) const [virtual]

Definition at line 298 of file G4GMocrenMessenger.cc.

00298                                                                              {
00299   nx = kgMocrenNoVoxels[0];
00300   ny = kgMocrenNoVoxels[1];
00301   nz = kgMocrenNoVoxels[2];
00302 }

G4String G4GMocrenMessenger::getScoringMeshName (  )  [virtual]

Definition at line 263 of file G4GMocrenMessenger.cc.

00263                                                 {
00264   return kgMocrenScoringMeshName;
00265 }

G4String G4GMocrenMessenger::getVolumeName (  )  [virtual]

Definition at line 255 of file G4GMocrenMessenger.cc.

Referenced by G4GMocrenFileSceneHandler::AddSolid().

00255                                            {
00256   return kgMocrenVolumeName;
00257 }

void G4GMocrenMessenger::list (  )  [virtual]

Definition at line 271 of file G4GMocrenMessenger.cc.

References G4cout, and G4endl.

Referenced by SetNewValue().

00271                               {
00272   G4cout << "  Current valuess of gMocren command parameters:" << G4endl;
00273   //
00274   G4cout << "    volume name:        " << kgMocrenVolumeName << G4endl;
00275   //
00276   G4cout << "    hit names:          ";
00277   if(kgMocrenHitNames.size() > 0) {
00278     std::vector<G4String>::iterator itr = kgMocrenHitNames.begin();
00279     for(; itr != kgMocrenHitNames.end(); itr++)
00280       G4cout << *itr << "  " << G4endl;
00281   } else {
00282     G4cout << G4endl;
00283   }
00284   //
00285   G4cout << "    scoring mesh name:  " << kgMocrenScoringMeshName << G4endl;
00286   //
00287   G4cout << "    scorer names:       ";
00288   if(kgMocrenHitScorerNames.size() > 0) {
00289     std::vector<G4String>::iterator itr = kgMocrenHitScorerNames.begin();
00290     for(; itr != kgMocrenHitScorerNames.end(); itr++)
00291       G4cout << *itr << "  " << G4endl;
00292   } else {
00293     G4cout << G4endl;
00294   }
00295   G4cout << G4endl;
00296 }

void G4GMocrenMessenger::SetNewValue ( G4UIcommand command,
G4String  newValue 
) [virtual]

Reimplemented from G4UImessenger.

Definition at line 200 of file G4GMocrenMessenger.cc.

References G4UIcmdWithABool::GetNewBoolValue(), list(), and G4UImessenger::StoI().

00200                                                                              {
00201   if (command==setEventNumberSuffixCommand) {
00202     suffix = newValue;
00203   } else if (command==appendGeometryCommand) {
00204     geometry = appendGeometryCommand->GetNewBoolValue(newValue);
00205   } else if (command==addPointAttributesCommand) {
00206     pointAttributes = addPointAttributesCommand->GetNewBoolValue(newValue);
00207   } else if (command==useSolidsCommand) {
00208     solids = useSolidsCommand->GetNewBoolValue(newValue);
00209     //    } else if (command==writeInvisiblesCommand) {
00210     //        invisibles = writeInvisiblesCommand->GetNewBoolValue(newValue);
00211   } else if (command == kSetgMocrenVolumeNameCommand) {
00212     kgMocrenVolumeName = newValue;
00213   } else if (command == kAddgMocrenHitNameCommand) {
00214     kgMocrenHitNames.push_back(newValue);
00215   } else if (command == kResetgMocrenHitNameCommand) {
00216     kgMocrenHitNames.clear();
00217   } else if (command == kSetgMocrenScoringMeshNameCommand) {
00218     kgMocrenScoringMeshName = newValue;
00219   } else if (command == kAddgMocrenHitScorerNameCommand) {
00220     kgMocrenHitScorerNames.push_back(newValue);
00221   } else if (command == kResetgMocrenHitScorerNameCommand) {
00222     kgMocrenHitScorerNames.clear();
00223   } else if (command == kListgMocrenCommand) {
00224     list();
00225   } else if (command == kSetgMocrenNoVoxelsCommand) {
00226     G4Tokenizer next(newValue);
00227     for(int i = 0; i < 3; i++) {
00228       kgMocrenNoVoxels[i] = StoI(next());
00229     }
00230   } else if (command==kDrawVolumeGridCommand) {
00231     kDrawVolumeGrid = kDrawVolumeGridCommand->GetNewBoolValue(newValue);
00232   } 
00233 }

G4bool G4GMocrenMessenger::useSolids (  )  [virtual]

Definition at line 247 of file G4GMocrenMessenger.cc.

00247                                      {
00248   return solids;
00249 }

G4bool G4GMocrenMessenger::writeInvisibles (  )  [virtual]

Definition at line 251 of file G4GMocrenMessenger.cc.

00251                                            {
00252   return invisibles;
00253 }


The documentation for this class was generated from the following files:
Generated on Mon May 27 17:52:06 2013 for Geant4 by  doxygen 1.4.7