This tutorial can be used on its own, but gives the most comprehensive introduction to Geant4 visualization when used as part of the following full set of documents:
While some Geant4 visualization drivers are always included by default in your Geant4 build (because they require no external libraries), Qt is not part of the default set. You have to specifically ask to include Qt.
If you followed the Geant4 Installation Guides referenced above, you used the Geant4 Configuration script and said "yes" to including Qt. Qt version should be Qt3 are above (Qt 4.4 is current version)
If you are following some other set of build instructions, refer to them for how to include Qt driver. This may involve explicitly setting environment variables.
Since OpenGL runs directly from Geant4, you just start Geant4 and then issue a few visualization commands. The Installation Guides listed above already showed you how to start Geant4 with OpenGL Qt driver included. They then showed you how to use a few simple commands to do the most minimal visualization of some detector geometry and some event data. This guide will show you some additional commands.
Building User interface driver
Set the following variables acording to your shell, then recompile sources/interfacesBuilding visualization driver
Set the following variables acording to your shell, then recompile sources/visualizationNote : Remember to do the appropriate setup commands before you start Geant4 from a new windows (see the installation guides for details).
As others Graphic User Interfaces (Xm,Win32), Qt User Interface have the same look & feel. A output area, history area, command area, menu are available. Building the menu is available by executing set of commands defined in a macro file or entering thoses commands in the User Interface (as other Graphics User Interfaces). For example : /gui/addMenu run Run /gui/addButton run "beamOn 1" "/run/beamOn 1"Theses command will build a new menu "Run" with a sub-menu "beamOn 1" calling /run/beamOn command |
A New command "help" has been set specialy for Qt. Invoke it, it will display the help tree widget. This help widget will display all commands already loaded from Geant4 and all your personnels commands if Geant4 already knows them. This widget is very useful to find quicly a command in the geant4 set of commands. Moreover, you could ouble-click on the command you have find to set it in User Interface command area. This help widget is composed of :
|
|
As OpenInventor driver, Qt driver is a real-time display.
There is three control modes availables thanks to context-menu (right mouse button) :
As default, control is set to rotate mode.
If you release mouse press when moving mouse press (in rotate/move mode), you will
set the scene in an auto rotate/move mode. Press mouse will stop this auto move/rotate
mode. The speed of this auto rotation/move is control by the speed of your mouse move when
releasing mouse press.
In addition controling visualization is alo available by keybord :
A context menu is available on right mouse button, it is a quick mean to set somes geant4 main options and some Qt specific ones :
|
|
|
|
A underline item is set by default by Geant4.
A word about Qt specific options.
These new options introduced by Qt driver are Actions-<Save as..., Movies parameters...,
and full screen mode.
Thanks to Qt, a lot of export formats are available :
|
|
|
|
A important feature of Qt driver is avaibility to make movies. To do this Qt driver rely on an free external software call mpeg_encode. It is available here: http://bmrc.berkeley.edu/frame/research/mpeg/.
How does it works ?
Caution : This is not a time based saving, but a frame based !
What do I have to do ?
|
Documents in this Visualization Tutorial Set:
Other Resources: