Geant4  10.02.p03
G4HepRepMessenger Class Reference

#include <G4HepRepMessenger.hh>

Inheritance diagram for G4HepRepMessenger:
Collaboration diagram for G4HepRepMessenger:

Public Member Functions

virtual ~G4HepRepMessenger ()
 
virtual G4String GetCurrentValue (G4UIcommand *command)
 
virtual void SetNewValue (G4UIcommand *command, G4String newValue)
 
virtual G4String getFileDir ()
 
virtual G4String getFileName ()
 
virtual G4bool getOverwrite ()
 
virtual G4bool getCullInvisibles ()
 
virtual G4bool renderCylAsPolygons ()
 
virtual G4double getScale ()
 
virtual G4ThreeVector getCenter ()
 
virtual G4String getEventNumberSuffix ()
 
virtual G4bool appendGeometry ()
 
virtual G4bool addPointAttributes ()
 
virtual G4bool useSolids ()
 
virtual G4bool writeInvisibles ()
 
- 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
 

Static Public Member Functions

static G4HepRepMessengerGetInstance ()
 

Private Member Functions

 G4HepRepMessenger ()
 

Private Attributes

G4UIdirectoryheprepDirectory
 
G4String fileDir
 
G4UIcmdWithAStringsetFileDirCommand
 
G4String fileName
 
G4UIcmdWithAStringsetFileNameCommand
 
G4bool overwrite
 
G4UIcmdWithABoolsetOverwriteCommand
 
G4bool cullInvisibles
 
G4UIcmdWithABoolsetCullInvisiblesCommand
 
G4bool cylAsPolygons
 
G4UIcmdWithABoolrenderCylAsPolygonsCommand
 
G4double scale
 
G4UIcmdWithADoublesetScaleCommand
 
G4ThreeVector center
 
G4UIcmdWith3VectorAndUnitsetCenterCommand
 
G4String suffix
 
G4UIcmdWithAStringsetEventNumberSuffixCommand
 
G4bool geometry
 
G4UIcmdWithABoolappendGeometryCommand
 
G4bool pointAttributes
 
G4UIcmdWithABooladdPointAttributesCommand
 
G4bool solids
 
G4UIcmdWithABooluseSolidsCommand
 
G4bool invisibles
 

Static Private Attributes

static G4HepRepMessengerfpInstance = 0
 

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 41 of file G4HepRepMessenger.hh.

Constructor & Destructor Documentation

◆ ~G4HepRepMessenger()

G4HepRepMessenger::~G4HepRepMessenger ( )
virtual

Definition at line 153 of file G4HepRepMessenger.cc.

153  {
154  delete setFileDirCommand;
155  delete setFileNameCommand;
156  delete setOverwriteCommand;
159  delete setScaleCommand;
160  delete setCenterCommand;
162  delete appendGeometryCommand;
164  delete useSolidsCommand;
165  delete heprepDirectory;
166 }
G4UIcmdWithADouble * setScaleCommand
G4UIcmdWith3VectorAndUnit * setCenterCommand
G4UIcmdWithABool * appendGeometryCommand
G4UIcmdWithABool * useSolidsCommand
G4UIcmdWithAString * setEventNumberSuffixCommand
G4UIcmdWithABool * setOverwriteCommand
G4UIcmdWithAString * setFileDirCommand
G4UIdirectory * heprepDirectory
G4UIcmdWithABool * setCullInvisiblesCommand
G4UIcmdWithABool * addPointAttributesCommand
G4UIcmdWithAString * setFileNameCommand
G4UIcmdWithABool * renderCylAsPolygonsCommand

◆ G4HepRepMessenger()

G4HepRepMessenger::G4HepRepMessenger ( )
private

Definition at line 40 of file G4HepRepMessenger.cc.

40  :
41  fileDir(""),
42  fileName("G4Data"),
43  overwrite(false),
44  cullInvisibles(false),
45  cylAsPolygons(false),
46  scale(1.),
47  suffix (""),
48  geometry(true),
49  solids(true),
50  invisibles(true) {
51 
52  heprepDirectory = new G4UIdirectory("/vis/heprep/");
53  heprepDirectory->SetGuidance("HepRep commands.");
54 
55  setFileDirCommand = new G4UIcmdWithAString("/vis/heprep/setFileDir", this);
56  setFileDirCommand->SetGuidance("Set directory for output.");
57  setFileDirCommand->SetGuidance("This command is used by HepRepFile, not by HepRepXML.");
58  setFileDirCommand->SetParameterName("directory",false);
59  if ( getenv( "G4HEPREPFILE_DIR" ) == NULL ) {
61  } else {
62  setFileDirCommand->SetDefaultValue(getenv("G4HEPREPFILE_DIR"));
63  fileDir = getenv("G4HEPREPFILE_DIR");
64  }
66 
67  setFileNameCommand = new G4UIcmdWithAString("/vis/heprep/setFileName", this);
68  setFileNameCommand->SetGuidance("Set file name for output.");
69  setFileNameCommand->SetGuidance("This command is used by HepRepFile, not by HepRepXML.");
70  setFileNameCommand->SetParameterName("directory",false);
71  if ( getenv( "G4HEPREPFILE_NAME" ) == NULL ) {
73  } else {
74  setFileNameCommand->SetDefaultValue(getenv("G4HEPREPFILE_NAME"));
75  fileName = getenv("G4HEPREPFILE_NAME");
76  }
78 
79  setOverwriteCommand = new G4UIcmdWithABool("/vis/heprep/setOverwrite", this);
80  setOverwriteCommand->SetGuidance("Set true to write all output to exact same file name.");
81  setOverwriteCommand->SetGuidance("Set false to increment the file name for each new output.");
82  setOverwriteCommand->SetGuidance("This command is used by HepRepFile, not by HepRepXML.");
84  if ( getenv( "G4HEPREPFILE_OVERWRITE" ) == NULL ) {
86  } else {
87  setOverwriteCommand->SetDefaultValue(getenv("G4HEPREPFILE_OVERWRITE"));
88  overwrite = setOverwriteCommand->ConvertToBool(getenv("G4HEPREPFILE_OVERWRITE"));
89  }
91 
92  setCullInvisiblesCommand = new G4UIcmdWithABool("/vis/heprep/setCullInvisibles", this);
93  setCullInvisiblesCommand->SetGuidance("Remove invisible objects from output file.");
94  setCullInvisiblesCommand->SetGuidance("This command is used by HepRepFile, not by HepRepXML.");
96  if ( getenv( "G4HEPREPFILE_CULL" ) == NULL ) {
98  } else {
99  setCullInvisiblesCommand->SetDefaultValue(getenv("G4HEPREPFILE_CULL"));
100  cullInvisibles = setCullInvisiblesCommand->ConvertToBool(getenv("G4HEPREPFILE_CULL"));
101  }
103 
104  renderCylAsPolygonsCommand = new G4UIcmdWithABool("/vis/heprep/renderCylAsPolygons", this);
105  renderCylAsPolygonsCommand->SetGuidance("Render cylinders and cones as polygons.");
106  renderCylAsPolygonsCommand->SetGuidance("This command is used by HepRepFile, not by HepRepXML.");
110 
111  setScaleCommand = new G4UIcmdWithADouble("/vis/heprep/scale",this);
112  setScaleCommand->SetGuidance("Re-Scale coordinates.");
113  setScaleCommand->SetParameterName("Scale",true);
115  setScaleCommand->SetRange("Scale > 0");
116 
117  setCenterCommand = new G4UIcmdWith3VectorAndUnit("/vis/heprep/center",this);
118  setCenterCommand->SetGuidance("Re-Center coordinates.");
119  setCenterCommand->SetParameterName("CenterX","CenterY","CenterZ",true);
122 
123  setEventNumberSuffixCommand = new G4UIcmdWithAString("/vis/heprep/setEventNumberSuffix", this);
124  setEventNumberSuffixCommand->SetGuidance("Write separate event files, appended with given suffix.");
125  setEventNumberSuffixCommand->SetGuidance("Define the suffix with a pattern such as '-0000'.");
126  setEventNumberSuffixCommand->SetGuidance("This command is used by HepRepXML, not by HepRepFile.");
130 
131  appendGeometryCommand = new G4UIcmdWithABool("/vis/heprep/appendGeometry", this);
132  appendGeometryCommand->SetGuidance("Appends copy of geometry to every event.");
133  appendGeometryCommand->SetGuidance("This command is used by HepRepXML, not by HepRepFile.");
137 
138  addPointAttributesCommand = new G4UIcmdWithABool("/vis/heprep/addPointAttributes", this);
139  addPointAttributesCommand->SetGuidance("Adds point attributes to the points of trajectories.");
140  addPointAttributesCommand->SetGuidance("This command is used by HepRepXML, not by HepRepFile.");
144 
145  useSolidsCommand = new G4UIcmdWithABool("/vis/heprep/useSolids", this);
146  useSolidsCommand->SetGuidance("Use HepRep Solids, rather than Geant4 Primitives.");
147  useSolidsCommand->SetGuidance("This command is used by HepRepXML, not by HepRepFile..");
148  useSolidsCommand->SetParameterName("flag",false);
151 }
void SetParameterName(const char *theName, G4bool omittable, G4bool currentAsDefault=false)
G4UIcmdWithADouble * setScaleCommand
G4UIcmdWith3VectorAndUnit * setCenterCommand
CLHEP::Hep3Vector G4ThreeVector
G4UIcmdWithABool * appendGeometryCommand
void SetDefaultUnit(const char *defUnit)
G4UIcmdWithABool * useSolidsCommand
void SetParameterName(const char *theNameX, const char *theNameY, const char *theNameZ, G4bool omittable, G4bool currentAsDefault=false)
void SetDefaultValue(G4bool defVal)
void SetParameterName(const char *theName, G4bool omittable, G4bool currentAsDefault=false)
G4UIcmdWithAString * setEventNumberSuffixCommand
G4UIcmdWithABool * setOverwriteCommand
G4UIcmdWithAString * setFileDirCommand
static G4bool ConvertToBool(const char *st)
Definition: G4UIcommand.cc:425
G4UIdirectory * heprepDirectory
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:239
void SetDefaultValue(G4ThreeVector defVal)
G4UIcmdWithABool * setCullInvisiblesCommand
void SetDefaultValue(const char *defVal)
void SetParameterName(const char *theName, G4bool omittable, G4bool currentAsDefault=false)
void SetDefaultValue(G4double defVal)
G4UIcmdWithABool * addPointAttributesCommand
G4UIcmdWithAString * setFileNameCommand
G4UIcmdWithABool * renderCylAsPolygonsCommand
Here is the call graph for this function:
Here is the caller graph for this function:

Member Function Documentation

◆ addPointAttributes()

G4bool G4HepRepMessenger::addPointAttributes ( )
virtual

Definition at line 258 of file G4HepRepMessenger.cc.

258  {
259  return pointAttributes;
260 }

◆ appendGeometry()

G4bool G4HepRepMessenger::appendGeometry ( )
virtual

Definition at line 254 of file G4HepRepMessenger.cc.

254  {
255  return geometry;
256 }
Here is the caller graph for this function:

◆ getCenter()

G4ThreeVector G4HepRepMessenger::getCenter ( )
virtual

Definition at line 246 of file G4HepRepMessenger.cc.

246  {
247  return center;
248 }
G4ThreeVector center
Here is the caller graph for this function:

◆ getCullInvisibles()

G4bool G4HepRepMessenger::getCullInvisibles ( )
virtual

Definition at line 234 of file G4HepRepMessenger.cc.

234  {
235  return cullInvisibles;
236 }
Here is the caller graph for this function:

◆ GetCurrentValue()

G4String G4HepRepMessenger::GetCurrentValue ( G4UIcommand command)
virtual

Reimplemented from G4UImessenger.

Definition at line 168 of file G4HepRepMessenger.cc.

168  {
169  if (command==setFileDirCommand) {
170  return fileDir;
171  } else if (command==setFileNameCommand) {
172  return fileName;
173  } else if (command==setOverwriteCommand) {
174  return overwrite;
175  } else if (command==setCullInvisiblesCommand) {
176  return cullInvisibles;
177  } else if (command==renderCylAsPolygonsCommand) {
179  } else if (command==setScaleCommand) {
181  } else if (command==setCenterCommand) {
183  } else if (command==setEventNumberSuffixCommand) {
184  return suffix;
185  } else if (command==appendGeometryCommand) {
187  } else if (command==addPointAttributesCommand) {
189  } else if (command==useSolidsCommand) {
191  } else {
192  return "";
193  }
194 }
G4UIcmdWithADouble * setScaleCommand
G4UIcmdWith3VectorAndUnit * setCenterCommand
G4UIcmdWithABool * appendGeometryCommand
static G4String ConvertToString(G4bool boolVal)
Definition: G4UIcommand.cc:371
G4UIcmdWithABool * useSolidsCommand
G4UIcmdWithAString * setEventNumberSuffixCommand
G4UIcmdWithABool * setOverwriteCommand
G4UIcmdWithAString * setFileDirCommand
G4ThreeVector center
G4UIcmdWithABool * setCullInvisiblesCommand
G4UIcmdWithABool * addPointAttributesCommand
G4UIcmdWithAString * setFileNameCommand
G4UIcmdWithABool * renderCylAsPolygonsCommand
Here is the call graph for this function:

◆ getEventNumberSuffix()

G4String G4HepRepMessenger::getEventNumberSuffix ( )
virtual

Definition at line 250 of file G4HepRepMessenger.cc.

250  {
251  return suffix;
252 }
Here is the caller graph for this function:

◆ getFileDir()

G4String G4HepRepMessenger::getFileDir ( )
virtual

Definition at line 222 of file G4HepRepMessenger.cc.

222  {
223  return fileDir;
224 }
Here is the caller graph for this function:

◆ getFileName()

G4String G4HepRepMessenger::getFileName ( )
virtual

Definition at line 226 of file G4HepRepMessenger.cc.

226  {
227  return fileName;
228 }
Here is the caller graph for this function:

◆ GetInstance()

G4HepRepMessenger * G4HepRepMessenger::GetInstance ( void  )
static

Definition at line 34 of file G4HepRepMessenger.cc.

35 {
37  return fpInstance;
38 }
static G4HepRepMessenger * fpInstance
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getOverwrite()

G4bool G4HepRepMessenger::getOverwrite ( )
virtual

Definition at line 230 of file G4HepRepMessenger.cc.

230  {
231  return overwrite;
232 }
Here is the caller graph for this function:

◆ getScale()

G4double G4HepRepMessenger::getScale ( )
virtual

Definition at line 242 of file G4HepRepMessenger.cc.

242  {
243  return scale;
244 }
Here is the caller graph for this function:

◆ renderCylAsPolygons()

G4bool G4HepRepMessenger::renderCylAsPolygons ( )
virtual

Definition at line 238 of file G4HepRepMessenger.cc.

238  {
239  return cylAsPolygons;
240 }
Here is the caller graph for this function:

◆ SetNewValue()

void G4HepRepMessenger::SetNewValue ( G4UIcommand command,
G4String  newValue 
)
virtual

Reimplemented from G4UImessenger.

Definition at line 196 of file G4HepRepMessenger.cc.

196  {
197  if (command==setFileDirCommand) {
198  fileDir = newValue;
199  } else if (command==setFileNameCommand) {
200  fileName = newValue;
201  } else if (command==setOverwriteCommand) {
203  } else if (command==setCullInvisiblesCommand) {
205  } else if (command==renderCylAsPolygonsCommand) {
207  } else if (command==setScaleCommand) {
209  } else if (command==setCenterCommand) {
211  } else if (command==setEventNumberSuffixCommand) {
212  suffix = newValue;
213  } else if (command==appendGeometryCommand) {
215  } else if (command==addPointAttributesCommand) {
217  } else if (command==useSolidsCommand) {
219  }
220 }
G4UIcmdWithADouble * setScaleCommand
G4UIcmdWith3VectorAndUnit * setCenterCommand
G4UIcmdWithABool * appendGeometryCommand
static G4ThreeVector GetNew3VectorValue(const char *paramString)
G4UIcmdWithABool * useSolidsCommand
static G4bool GetNewBoolValue(const char *paramString)
G4UIcmdWithAString * setEventNumberSuffixCommand
G4UIcmdWithABool * setOverwriteCommand
G4UIcmdWithAString * setFileDirCommand
static G4double GetNewDoubleValue(const char *paramString)
G4ThreeVector center
G4UIcmdWithABool * setCullInvisiblesCommand
G4UIcmdWithABool * addPointAttributesCommand
G4UIcmdWithAString * setFileNameCommand
G4UIcmdWithABool * renderCylAsPolygonsCommand
Here is the call graph for this function:

◆ useSolids()

G4bool G4HepRepMessenger::useSolids ( )
virtual

Definition at line 262 of file G4HepRepMessenger.cc.

262  {
263  return solids;
264 }
Here is the caller graph for this function:

◆ writeInvisibles()

G4bool G4HepRepMessenger::writeInvisibles ( )
virtual

Definition at line 266 of file G4HepRepMessenger.cc.

266  {
267  return invisibles;
268 }
Here is the caller graph for this function:

Member Data Documentation

◆ addPointAttributesCommand

G4UIcmdWithABool* G4HepRepMessenger::addPointAttributesCommand
private

Definition at line 100 of file G4HepRepMessenger.hh.

◆ appendGeometryCommand

G4UIcmdWithABool* G4HepRepMessenger::appendGeometryCommand
private

Definition at line 97 of file G4HepRepMessenger.hh.

◆ center

G4ThreeVector G4HepRepMessenger::center
private

Definition at line 90 of file G4HepRepMessenger.hh.

◆ cullInvisibles

G4bool G4HepRepMessenger::cullInvisibles
private

Definition at line 81 of file G4HepRepMessenger.hh.

◆ cylAsPolygons

G4bool G4HepRepMessenger::cylAsPolygons
private

Definition at line 84 of file G4HepRepMessenger.hh.

◆ fileDir

G4String G4HepRepMessenger::fileDir
private

Definition at line 72 of file G4HepRepMessenger.hh.

◆ fileName

G4String G4HepRepMessenger::fileName
private

Definition at line 75 of file G4HepRepMessenger.hh.

◆ fpInstance

G4HepRepMessenger * G4HepRepMessenger::fpInstance = 0
staticprivate

Definition at line 68 of file G4HepRepMessenger.hh.

◆ geometry

G4bool G4HepRepMessenger::geometry
private

Definition at line 96 of file G4HepRepMessenger.hh.

◆ heprepDirectory

G4UIdirectory* G4HepRepMessenger::heprepDirectory
private

Definition at line 70 of file G4HepRepMessenger.hh.

◆ invisibles

G4bool G4HepRepMessenger::invisibles
private

Definition at line 105 of file G4HepRepMessenger.hh.

◆ overwrite

G4bool G4HepRepMessenger::overwrite
private

Definition at line 78 of file G4HepRepMessenger.hh.

◆ pointAttributes

G4bool G4HepRepMessenger::pointAttributes
private

Definition at line 99 of file G4HepRepMessenger.hh.

◆ renderCylAsPolygonsCommand

G4UIcmdWithABool* G4HepRepMessenger::renderCylAsPolygonsCommand
private

Definition at line 85 of file G4HepRepMessenger.hh.

◆ scale

G4double G4HepRepMessenger::scale
private

Definition at line 87 of file G4HepRepMessenger.hh.

◆ setCenterCommand

G4UIcmdWith3VectorAndUnit* G4HepRepMessenger::setCenterCommand
private

Definition at line 91 of file G4HepRepMessenger.hh.

◆ setCullInvisiblesCommand

G4UIcmdWithABool* G4HepRepMessenger::setCullInvisiblesCommand
private

Definition at line 82 of file G4HepRepMessenger.hh.

◆ setEventNumberSuffixCommand

G4UIcmdWithAString* G4HepRepMessenger::setEventNumberSuffixCommand
private

Definition at line 94 of file G4HepRepMessenger.hh.

◆ setFileDirCommand

G4UIcmdWithAString* G4HepRepMessenger::setFileDirCommand
private

Definition at line 73 of file G4HepRepMessenger.hh.

◆ setFileNameCommand

G4UIcmdWithAString* G4HepRepMessenger::setFileNameCommand
private

Definition at line 76 of file G4HepRepMessenger.hh.

◆ setOverwriteCommand

G4UIcmdWithABool* G4HepRepMessenger::setOverwriteCommand
private

Definition at line 79 of file G4HepRepMessenger.hh.

◆ setScaleCommand

G4UIcmdWithADouble* G4HepRepMessenger::setScaleCommand
private

Definition at line 88 of file G4HepRepMessenger.hh.

◆ solids

G4bool G4HepRepMessenger::solids
private

Definition at line 102 of file G4HepRepMessenger.hh.

◆ suffix

G4String G4HepRepMessenger::suffix
private

Definition at line 93 of file G4HepRepMessenger.hh.

◆ useSolidsCommand

G4UIcmdWithABool* G4HepRepMessenger::useSolidsCommand
private

Definition at line 103 of file G4HepRepMessenger.hh.


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