38G4HepRepMessenger::G4HepRepMessenger()
42 , cullInvisibles(false)
43 , cylAsPolygons(false)
47 , pointAttributes(false)
55 setFileDirCommand->
SetGuidance(
"Set directory for output.");
57 "This command is used by HepRepFile, not by HepRepXML.");
59 if(std::getenv(
"G4HEPREPFILE_DIR") == NULL)
66 fileDir = std::getenv(
"G4HEPREPFILE_DIR");
71 setFileNameCommand->
SetGuidance(
"Set file name for output.");
73 "This command is used by HepRepFile, not by HepRepXML.");
75 if(std::getenv(
"G4HEPREPFILE_NAME") == NULL)
82 fileName = std::getenv(
"G4HEPREPFILE_NAME");
86 setOverwriteCommand =
new G4UIcmdWithABool(
"/vis/heprep/setOverwrite",
this);
88 "Set true to write all output to exact same file name.");
90 "Set false to increment the file name for each new output.");
92 "This command is used by HepRepFile, not by HepRepXML.");
94 if(std::getenv(
"G4HEPREPFILE_OVERWRITE") == NULL)
100 setOverwriteCommand->
SetDefaultValue(std::getenv(
"G4HEPREPFILE_OVERWRITE"));
102 setOverwriteCommand->
ConvertToBool(std::getenv(
"G4HEPREPFILE_OVERWRITE"));
106 setCullInvisiblesCommand =
109 "Remove invisible objects from output file.");
111 "This command is used by HepRepFile, not by HepRepXML.");
113 if(std::getenv(
"G4HEPREPFILE_CULL") == NULL)
119 setCullInvisiblesCommand->
SetDefaultValue(std::getenv(
"G4HEPREPFILE_CULL"));
121 setCullInvisiblesCommand->
ConvertToBool(std::getenv(
"G4HEPREPFILE_CULL"));
125 renderCylAsPolygonsCommand =
128 "Render cylinders and cones as polygons.");
130 "This command is used by HepRepFile, not by HepRepXML.");
136 setScaleCommand->
SetGuidance(
"Re-Scale coordinates.");
139 setScaleCommand->
SetRange(
"Scale > 0");
142 setCenterCommand->
SetGuidance(
"Re-Center coordinates.");
147 setEventNumberSuffixCommand =
150 "Write separate event files, appended with given suffix.");
152 "Define the suffix with a pattern such as '-0000'.");
154 "This command is used by HepRepXML, not by HepRepFile.");
159 appendGeometryCommand =
162 "Appends copy of geometry to every event.");
164 "This command is used by HepRepXML, not by HepRepFile.");
169 addPointAttributesCommand =
172 "Adds point attributes to the points of trajectories.");
174 "This command is used by HepRepXML, not by HepRepFile.");
181 "Use HepRep Solids, rather than Geant4 Primitives.");
183 "This command is used by HepRepXML, not by HepRepFile..");
191 delete setFileDirCommand;
192 delete setFileNameCommand;
193 delete setOverwriteCommand;
194 delete setCullInvisiblesCommand;
195 delete renderCylAsPolygonsCommand;
196 delete setScaleCommand;
197 delete setCenterCommand;
198 delete setEventNumberSuffixCommand;
199 delete appendGeometryCommand;
200 delete addPointAttributesCommand;
201 delete useSolidsCommand;
202 delete heprepDirectory;
207 if(command == setFileDirCommand)
211 else if(command == setFileNameCommand)
215 else if(command == setOverwriteCommand)
219 else if(command == setCullInvisiblesCommand)
223 else if(command == renderCylAsPolygonsCommand)
227 else if(command == setScaleCommand)
231 else if(command == setCenterCommand)
235 else if(command == setEventNumberSuffixCommand)
239 else if(command == appendGeometryCommand)
243 else if(command == addPointAttributesCommand)
247 else if(command == useSolidsCommand)
259 if(command == setFileDirCommand)
263 else if(command == setFileNameCommand)
267 else if(command == setOverwriteCommand)
271 else if(command == setCullInvisiblesCommand)
275 else if(command == renderCylAsPolygonsCommand)
279 else if(command == setScaleCommand)
283 else if(command == setCenterCommand)
287 else if(command == setEventNumberSuffixCommand)
291 else if(command == appendGeometryCommand)
295 else if(command == addPointAttributesCommand)
297 pointAttributes = addPointAttributesCommand->
GetNewBoolValue(newValue);
299 else if(command == useSolidsCommand)
CLHEP::Hep3Vector G4ThreeVector
virtual G4String GetCurrentValue(G4UIcommand *command)
virtual G4bool renderCylAsPolygons()
virtual void SetNewValue(G4UIcommand *command, G4String newValue)
virtual G4String getFileName()
virtual G4bool addPointAttributes()
virtual G4bool writeInvisibles()
virtual G4double getScale()
virtual ~G4HepRepMessenger()
virtual G4bool useSolids()
virtual G4String getEventNumberSuffix()
virtual G4String getFileDir()
virtual G4bool getCullInvisibles()
virtual G4bool appendGeometry()
virtual G4bool getOverwrite()
static G4HepRepMessenger * GetInstance()
virtual G4ThreeVector getCenter()
void SetDefaultUnit(const char *defUnit)
static G4ThreeVector GetNew3VectorValue(const char *paramString)
void SetParameterName(const char *theNameX, const char *theNameY, const char *theNameZ, G4bool omittable, G4bool currentAsDefault=false)
void SetDefaultValue(const G4ThreeVector &defVal)
static G4bool GetNewBoolValue(const char *paramString)
void SetParameterName(const char *theName, G4bool omittable, G4bool currentAsDefault=false)
void SetDefaultValue(G4bool defVal)
void SetParameterName(const char *theName, G4bool omittable, G4bool currentAsDefault=false)
static G4double GetNewDoubleValue(const char *paramString)
void SetDefaultValue(G4double defVal)
void SetParameterName(const char *theName, G4bool omittable, G4bool currentAsDefault=false)
void SetDefaultValue(const char *defVal)
static G4String ConvertToString(G4bool boolVal)
void SetGuidance(const char *aGuidance)
static G4bool ConvertToBool(const char *st)
void SetRange(const char *rs)
void AvailableForStates(G4ApplicationState s1)