65 (
"If name is \"\", filename and extension will have the current value");
67 (
"If name is \"toto.png\", set the name to \"toto\" and the format to \"png\".");
69 (
"If name is \"toto\", set the name to \"toto\" and the format to current format.");
71 (
"Will also add an incremented suffix at the end of the name, except if name is"
72 "\nthe same as previous it will not reset the incremented suffix.");
74 (
"Setting size is available only on eps/pdf/svg/ps formats.");
76 parameterExport =
new G4UIparameter (
"name",
's', omitable =
true);
79 (
"By default, will take a default value or the last \"/vis/ogl/set/printFilename\""
82 parameterExport =
new G4UIparameter (
"width",
'd', omitable =
true);
84 (
"By default, will take the current width of the viewer or \"/vis/ogl/set/printSize\""
85 "\nif set. This parameter is only useful for eps/pdf/svg/ps formats !");
88 parameterExport =
new G4UIparameter (
"height",
'd', omitable =
true);
90 (
"By default, will take the current height of the viewer or \"/vis/ogl/set/printSize\""
91 "\nif set. This parameter is only useful for eps/pdf/svg/ps formats !");
97 (
"Controls the rate at which graphics primitives are flushed to screen.");
99 (
"Flushing to screen is an expensive operation so to speed drawing choose"
100 "\nan action suitable for your application. Note that detectors are flushed"
101 "\nto screen anyway at end of drawing, and events are flushed to screen"
102 "\nanyway depending on /vis/scene/endOfEventAction and endOfRunAction.");
104 (
"For NthPrimitive and NthEvent the second parameter N is operative.");
106 (
"For \"never\", detectors and events are still flushed as described above.");
108 parameterFlushAt =
new G4UIparameter (
"action",
's', omitable =
true);
110 (
"endOfEvent endOfRun eachPrimitive NthPrimitive NthEvent never");
113 parameterFlushAt =
new G4UIparameter (
"N",
'i', omitable =
true);
123 (
"Set/reset display list number of primitive limit (to avoid memory exhaustion).");
129 new G4UIcommand(
"/vis/ogl/set/exportFormat",
this);
135 parameterExportFormat =
new G4UIparameter (
"format",
's', omitable =
true);
140 new G4UIcommand(
"/vis/ogl/set/printFilename",
this);
144 parameterPrintFilename =
new G4UIparameter (
"name",
's', omitable =
true);
147 parameterPrintFilename =
new G4UIparameter (
"incremental",
'b', omitable =
true);
163 parameterPrintSize =
new G4UIparameter (
"width",
'd', omitable =
false);
166 parameterPrintSize =
new G4UIparameter (
"height",
'd', omitable =
false);
173 (
"True/false to enable/disable rendering of transparent objects.");
175 (
"transparency-enabled", omitable =
true);
203 "G4OpenGLViewerMessenger::SetNewValue: No current viewer."
204 "\n \"/vis/open\", or similar, to get one."
210 if (!pSceneHandler) {
212 "G4OpenGLViewerMessenger::SetNewValue: This viewer has no scene handler."
213 "\n Shouldn't happen - please report circumstances."
214 "\n (Viewer is \"" << pViewer->
GetName() <<
"\".)"
215 "\n Try \"/vis/open\", or similar, to get one."
223 "G4OpenGLViewerMessenger::SetNewValue: Current viewer is not of type"
226 "\".)\n Use \"/vis/viewer/select\" or \"/vis/open\"."
233 if (!pOGLSceneHandler) {
235 "G4OpenGLViewerMessenger::SetNewValue: Current scene handler is not of type"
236 "\n OGL. (Viewer is \"" << pViewer->
GetName() <<
"\".)"
237 "\n (Scene handler is \"" << pSceneHandler->
GetName() <<
"\".)"
238 "\n Use \"/vis/sceneHandler/list\" and \"/vis/sceneHandler/select\""
239 "\n or \"/vis/open\"."
248 std::istringstream iss(newValue);
249 iss >>
name >> width >> height;
260 std::istringstream iss(newValue);
269 static G4bool firstTime =
true;
270 static std::map<G4String,G4OpenGLSceneHandler::FlushAction> actionMap;
281 G4int entitiesFlushInterval;
282 std::istringstream iss(newValue);
283 iss >>
action >> entitiesFlushInterval;
293 std::istringstream iss(newValue);
302 if (newValue ==
"vectored") pOGLViewer->
fVectoredPs =
true;
304 if (newValue ==
"pixmap") pOGLViewer->
fVectoredPs =
false;
311 std::istringstream iss(newValue);
333 "G4OpenGLViewerMessenger::SetNewValue: Current viewer is not of type OGLS."
334 "\n (It is \"" << pViewer->
GetName() <<
"\".)"
335 "\n This feature is only implemented for OGL Stored viewers."
336 "\n Use \"/vis/viewer/select\" or \"/vis/open OGLS...\"."
345 if (!pOGLSSceneHandler) {
347 "G4OpenGLViewerMessenger::SetNewValue: Current scene handler is not of type"
348 "\n OGLS (Stored). (Viewer is \"" << pViewer->
GetName() <<
"\".)"
349 "\n (Scene handler is \"" << pSceneHandler->
GetName() <<
"\".)"
350 "\n This feature is only implemented for OGL Stored"
351 "\n scene handlers. Use \"/vis/viewer/select\" or \"/vis/open OGLS...\"."
358 G4int displayListLimit =
G4GLOB_DLL std::ostream G4cout
static void SetFlushAction(FlushAction action)
static void SetEntitiesFlushInterval(G4int interval)
static void SetDisplayListLimit(G4int lim)
static G4OpenGLViewerMessenger * GetInstance()
G4UIcommand * fpCommandExportFormat
~G4OpenGLViewerMessenger()
static G4OpenGLViewerMessenger * fpInstance
G4OpenGLViewerMessenger()
G4UIcommand * fpCommandExport
G4UIcommand * fpCommandFlushAt
void SetNewValue(G4UIcommand *, G4String)
G4UIcommand * fpCommandPrintFilename
G4UIcmdWithAString * fpCommandPrintMode
G4UIdirectory * fpDirectorySet
G4UIdirectory * fpDirectory
G4UIcmdWithABool * fpCommandTransparency
G4UIcmdWithAnInteger * fpCommandDisplayListLimit
G4UIcommand * fpCommandPrintSize
bool setExportImageFormat(std::string format, bool quiet=false)
bool setExportFilename(G4String name, G4bool inc=true)
void setExportSize(G4int, G4int)
G4bool transparency_enabled
virtual bool exportImage(std::string name="", int width=-1, int height=-1)
void SetParameterName(const char *theName, G4bool omittable, G4bool currentAsDefault=false)
void SetDefaultValue(G4bool defVal)
void SetCandidates(const char *candidateList)
void SetParameterName(const char *theName, G4bool omittable, G4bool currentAsDefault=false)
void SetDefaultValue(const char *defVal)
void SetParameterName(const char *theName, G4bool omittable, G4bool currentAsDefault=false)
static G4int GetNewIntValue(const char *paramString)
void SetDefaultValue(G4int defVal)
void SetParameter(G4UIparameter *const newParameter)
void SetGuidance(const char *aGuidance)
static G4bool ConvertToBool(const char *st)
void SetRange(const char *rs)
G4int ApplyCommand(const char *aCommand)
static G4UImanager * GetUIpointer()
void SetDefaultValue(const char *theDefaultValue)
void SetGuidance(const char *theGuidance)
void SetParameterCandidates(const char *theString)
const G4String & GetName() const
const G4String & GetName() const
G4VSceneHandler * GetSceneHandler() const
G4bool IsAutoRefresh() const
G4VViewer * GetCurrentViewer() const
static G4VisManager * GetInstance()
const char * name(G4int ptype)