196{
198
200 if (!pViewer) {
202 "G4OpenGLViewerMessenger::SetNewValue: No current viewer."
203 "\n \"/vis/open\", or similar, to get one."
205 return;
206 }
207
209 if (!pSceneHandler) {
211 "G4OpenGLViewerMessenger::SetNewValue: This viewer has no scene handler."
212 "\n Shouldn't happen - please report circumstances."
213 "\n (Viewer is \"" << pViewer->
GetName() <<
"\".)"
214 "\n Try \"/vis/open\", or similar, to get one."
216 return;
217 }
218
220 if (!pOGLViewer) {
222 "G4OpenGLViewerMessenger::SetNewValue: Current viewer is not of type"
223 "\n OGL. (It is \""
225 "\".)\n Use \"/vis/viewer/select\" or \"/vis/open\"."
227 return;
228 }
229
232 if (!pOGLSceneHandler) {
234 "G4OpenGLViewerMessenger::SetNewValue: Current scene handler is not of type"
235 "\n OGL. (Viewer is \"" << pViewer->
GetName() <<
"\".)"
236 "\n (Scene handler is \"" << pSceneHandler->
GetName() <<
"\".)"
237 "\n Use \"/vis/sceneHandler/list\" and \"/vis/sceneHandler/select\""
238 "\n or \"/vis/open\"."
240 return;
241 }
242
243 if (command == fpCommandExport)
244 {
247 std::istringstream iss(newValue);
248 iss >>
name >> width >> height;
250
253 return;
254 }
255
256 if (command == fpCommandExportFormat)
257 {
259 std::istringstream iss(newValue);
262
263 return;
264 }
265
266 if (command == fpCommandFlushAt)
267 {
268 static G4bool firstTime =
true;
269 static std::map<G4String,G4OpenGLSceneHandler::FlushAction> actionMap;
270 if (firstTime) {
277 firstTime = false;
278 }
280 G4int entitiesFlushInterval;
281 std::istringstream iss(newValue);
282 iss >> action >> entitiesFlushInterval;
285 return;
286 }
287
288 if (command == fpCommandPrintFilename)
289 {
292 std::istringstream iss(newValue);
294 >> inc;
296 return;
297 }
298
299 if (command == fpCommandPrintMode)
300 {
301 if (newValue ==
"vectored") pOGLViewer->
fVectoredPs =
true;
302
303 if (newValue ==
"pixmap") pOGLViewer->
fVectoredPs =
false;
304 return;
305 }
306
307 if (command == fpCommandPrintSize)
308 {
310 std::istringstream iss(newValue);
311 iss >> width
312 >> height;
314 return;
315 }
316
317 if (command == fpCommandTransparency)
318 {
322 return;
323 }
324
325
328
329 if (!pOGLSViewer)
330 {
332 "G4OpenGLViewerMessenger::SetNewValue: Current viewer is not of type OGLS."
333 "\n (It is \"" << pViewer->
GetName() <<
"\".)"
334 "\n This feature is only implemented for OGL Stored viewers."
335 "\n Use \"/vis/viewer/select\" or \"/vis/open OGLS...\"."
337 return;
338 }
339
340
343
344 if (!pOGLSSceneHandler) {
346 "G4OpenGLViewerMessenger::SetNewValue: Current scene handler is not of type"
347 "\n OGLS (Stored). (Viewer is \"" << pViewer->
GetName() <<
"\".)"
348 "\n (Scene handler is \"" << pSceneHandler->
GetName() <<
"\".)"
349 "\n This feature is only implemented for OGL Stored"
350 "\n scene handlers. Use \"/vis/viewer/select\" or \"/vis/open OGLS...\"."
352 return;
353 }
354
355 if (command == fpCommandDisplayListLimit)
356 {
358 return;
359 }
360}
G4GLOB_DLL std::ostream G4cerr
G4GLOB_DLL std::ostream G4cout
static void SetFlushAction(FlushAction action)
static void SetEntitiesFlushInterval(G4int interval)
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)
const G4String & GetGuidanceLine(G4int i) const
static G4bool ConvertToBool(const char *st)
G4int ApplyCommand(const char *aCommand)
static G4UImanager * GetUIpointer()
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)