Geant4 Visualization : Qt Driver

Developments for Geant4.9.4

Geant4 Workshop

Laurent Garnier

# Plan

- Qt
  - Developpement on all platforms
  - Viewer and UI integration
  - Rotations
  - Keyboard Shortcuts
  - Remaining work to move from Qt driver Beta to Full Release
- OpenGL
  - Speed improvements in OpenGL drivers
  - Make posters

# Plan

- Qt
  - Developpement on all platforms
  - Viewer and UI integration
  - Rotations
  - Keyboard Shortcuts
  - Remaining work to move from Qt driver Beta to Full Release
- OpenGL
  - Speed improvements in OpenGL drivers
  - Make posters

# Developpement on all platforms

Qt visualization driver is available on all Platform.
Tested on all Geant4 supported computers and operating systems :

- WinXp
- SLC4
- SLC5
- MacOsX 10.5
- MacOsX 10.6

# Developpement on all platforms

Windows Xp

# Developpement on all platforms

SLC4

# Developpement on all platforms

SLC5

# Developpement on all platforms

What version of Qt ?

- Qt4 is available on all platform since 2005
- Only old platforms not already have qt4 configuration by default : SLC4 (but CERN support will end this year)
- All Qt4 version till Qt4.7 (15th september 2010) should work.

# Plan

- Qt
  - Developpement on all platforms
  - Viewer and UI integration
  - Rotations
  - Keyboard Shortcuts
  - Remaining work to move from Qt driver Beta to Full Release
- OpenGL
  - Speed improvements in OpenGL drivers
  - Make posters

# Viewer and UI integration (Geant4.9.3)

# Viewer and UI integration

This was before Big change in Geant4 Qt Driver

- Integration of viewers into UI

# Viewer and UI integration (History)

What's new ?

- History/Cout/Help are now integrate into UI
- Viewers can be view as Tab
- We can filter Cout messages
- Easy Help Tree to find a command and its help
- Still old things... : Make videos...

# Viewer and UI integration (Cout)

# Viewer and UI integration (Cout with filter)

# Viewer and UI integration (Help view)

# Plan

- Qt
  - Developpement on all platforms
  - Viewer and UI integration
  - Rotations
  - Keyboard Shortcuts
  - Remaining work to move from Qt driver Beta to Full Release
- OpenGL
  - Speed improvements in OpenGL drivers
  - Make posters

# Rotations

Two rotation mode are available : Theta/Phi rotation and 'google earth' like rotation

- Theta/Phi rotation : The default mode
  - Ensure the 'up' vector to be vertical direction
  - Impossible to reach some points of view
  - 'Not intuitive' behaviour on some angles
- 'google earth like' rotation
  - 'Up' vector is NOT vertical
  - Could reach all volume point of view
  - More 'intuitive' rotation mode

# Plan

- Qt
  - Developpement on all platforms
  - Viewer and UI integration
  - Rotations
  - Keyboard Shortcuts
  - Remaining work to move from Qt driver Beta to Full Release
- OpenGL
  - Speed improvements in OpenGL drivers
  - Make posters

# Keyboard Shortcuts

All vis commands are available with Keyboard shortcuts. Ex :

- ALT + Click and move mouse : rotate volume (google like)
- Click and move mouse : rotate volume
- CTRL + Click and mouse move : zoom in/out
- SHIFT + Click and mouse move : move camera point of view
- Arrow : move volume
- '+'/'-' : move volume toward/forward
- SHIFT + Arrows : rotate volume in phi/theta
- SHIFT + Arrows : rotate volume in vertical/horizontal
- CTRL + '+'/'-' : zoom into volume
- H : reset view to initial position
- SPACE : Start/Pause video recording
- RETURN : Stop video recording

# Plan

- Qt
  - Developpement on all platforms
  - Viewer and UI integration
  - Rotations
  - Keyboard Shortcuts
  - Remaining work to move from Qt driver Beta to Full Release
- OpenGL
  - Speed improvements in OpenGL drivers
  - Make posters

# Remaining work to move from Qt driver Beta to Full Release

Still some configuration problems with Mac : (see bugzilla)

- Some problems with OpenGL configuration (but solved)
- Some OpenGL initialization problems (but solved)
- Any other problems ?
- ...move Qt driver out of the Beta for Geant4.9.4 !

# Plan

- Qt
  - Developpement on all platforms
  - Viewer and UI integration
  - Rotations
  - Keyboard Shortcuts
  - Remaining work to move from Qt driver Beta to Full Release
- OpenGL
  - Speed improvements in OpenGL drivers
  - Make posters

# Speed improvements in OpenGL drivers

We loose time when moving a component is in visualization part.
Two major bootle neck are : glBegin (47% of OGL time) and glFlush (44%).After removing redundant transmissions of points and unnecessary redraws :

- Mac OSX 10.5 : Immediate Mode

  | First draw time (sec) | Rotation (fps)
  Geant 4.9.3 | 5 | 0,46
  Geant 4.9.4 | 6 | 0,53

  Mac OSX 10.6 : Immediate Mode

  Geant 4.9.3 | 5 | 0,6
  Geant 4.9.4 | 6 | 0,6

  Mac OSX 10.5 : Stored Mode

  Geant 4.9.3 | 94 | 1,2
  Geant 4.9.4 | 72 (x1,3) | 2,66 (x2,2)

  Mac OSX 10.6 : Stored Mode

  Geant 4.9.3 | 13 | 3,73
  Geant 4.9.4 | 11 (x1,2) | 5,3 (x1,43)

- In resume :
  - About 20-30% faster at launch in Store Mode.
  - Around 1,5 - 2 times faster in moving/rotate a volume in Store Mode.

# Plan

- Qt
  - Developpement on all platforms
  - Viewer and UI integration
  - Rotations
  - Keyboard Shortcuts
  - Remaining work to move from Qt driver Beta to Full Release
- OpenGL
  - Speed improvements in OpenGL drivers
  - Make posters

# Make posters

- Older Geant4 version can only export up to 'screen size' pictures
- How could we export bigger file in order to print, exchange screenshots, publish, or make poster ?
- Thanks to gl2ps library we could now export up to maximum graphic card capacity size (Ex: Up to 8192 x 8192 on MacBook Pro)
- How does it work ?

# Make posters

Some G4 commands :

- /vis/ogl/set/printMode (vectored or pixmap)
- /vis/ogl/set/printFilename (default G4OpenGL_XX)
- /vis/ogl/set/printSize (up to maximum graphic card capacity)
- /vis/ogl/printEPS

# Make posters : 8192x8192 example

Questions ?