31G4HepRepMessenger::fpInstance = 0;
40G4HepRepMessenger::G4HepRepMessenger() :
44 cullInvisibles(false),
56 setFileDirCommand->
SetGuidance(
"Set directory for output.");
57 setFileDirCommand->
SetGuidance(
"This command is used by HepRepFile, not by HepRepXML.");
59 if ( getenv(
"G4HEPREPFILE_DIR" ) == NULL ) {
63 fileDir = getenv(
"G4HEPREPFILE_DIR");
68 setFileNameCommand->
SetGuidance(
"Set file name for output.");
69 setFileNameCommand->
SetGuidance(
"This command is used by HepRepFile, not by HepRepXML.");
71 if ( getenv(
"G4HEPREPFILE_NAME" ) == NULL ) {
75 fileName = getenv(
"G4HEPREPFILE_NAME");
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 ) {
88 overwrite = setOverwriteCommand->
ConvertToBool(getenv(
"G4HEPREPFILE_OVERWRITE"));
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 ) {
100 cullInvisibles = setCullInvisiblesCommand->
ConvertToBool(getenv(
"G4HEPREPFILE_CULL"));
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.");
112 setScaleCommand->
SetGuidance(
"Re-Scale coordinates.");
115 setScaleCommand->
SetRange(
"Scale > 0");
118 setCenterCommand->
SetGuidance(
"Re-Center coordinates.");
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.");
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.");
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.");
146 useSolidsCommand->
SetGuidance(
"Use HepRep Solids, rather than Geant4 Primitives.");
147 useSolidsCommand->
SetGuidance(
"This command is used by HepRepXML, not by HepRepFile..");
154 delete setFileDirCommand;
155 delete setFileNameCommand;
156 delete setOverwriteCommand;
157 delete setCullInvisiblesCommand;
158 delete renderCylAsPolygonsCommand;
159 delete setScaleCommand;
160 delete setCenterCommand;
161 delete setEventNumberSuffixCommand;
162 delete appendGeometryCommand;
163 delete addPointAttributesCommand;
164 delete useSolidsCommand;
165 delete heprepDirectory;
169 if (command==setFileDirCommand) {
171 }
else if (command==setFileNameCommand) {
173 }
else if (command==setOverwriteCommand) {
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) {
185 }
else if (command==appendGeometryCommand) {
187 }
else if (command==addPointAttributesCommand) {
189 }
else if (command==useSolidsCommand) {
197 if (command==setFileDirCommand) {
199 }
else if (command==setFileNameCommand) {
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) {
213 }
else if (command==appendGeometryCommand) {
215 }
else if (command==addPointAttributesCommand) {
216 pointAttributes = addPointAttributesCommand->
GetNewBoolValue(newValue);
217 }
else if (command==useSolidsCommand) {
235 return cullInvisibles;
239 return cylAsPolygons;
259 return pointAttributes;
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(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)