A GDML viewer for Geant4, with additional visualization tools. It, like EGSnrc’s geometry viewer, is explicitly based on the simulation tracking primitives. The default interactive Geant4 viewer uses OpenGL to show triangulated primitives, which is slightly unrealistic and obscures geometry errors.
The Git repository is at https://github.com/mstoeckl/gview.
The build is performed with CMake. (i.e, use mkdir build; pushd build && cmake .. && make -j 4 install && popd).
The library geant_common provides classes that record particle traces and total energy flow between volume; the resulting data can be viewed with gview
gview file.gdml [trace.dat.gz]
Can color code volumes based on queries over an energy flow map. Supports clipping planes.
Volumes may be partially transparent.
Interactivity is produced by progressive color pixel size reduction; i.e., during navigation, a fast render might use one ray per pixel square; and this can be progressively refined to , then , then pixel squares.
In high detail mode, uses cone tracing to generate feature lines, with details similar to [CP09].
Includes particle track rendering, and (preliminary) particle track density rendering. Is multi-threaded, and supports a rendering graph for partial scene modifications.
Begins with a grid render, but uses marching squares to identify boundaries between volumes, and further refines boundary, crease, and color gradient parameters. See1.
The initial grid resolution is typically , and may require of peak memory for dense and complicated scenes.
This mode is useful when creating figures, as e.g. highlighting or zooming in on a particular region is straightforward.
A. N. M. Imroz Choudhury and Steven G. Parker. Ray tracing npr-style feature lines. In Proceedings of the 7th International Symposium on Non-Photorealistic Animation and Rendering, NPAR ’09, pages 5–14, New Orleans, Louisiana. ACM, 2009. isbn: 978-1-60558-604-5. doi: 10.1145/1572614.1572616. url: https://doi.acm.org/10.1145/1572614.1572616.
1When multiprocessing is enabled, Geant4 uses thread-local storage; this make using it as a library trickier, but not in this specific case.