|
g4display
|
The G4Display module provides a Qt-based graphical user interface layer for controlling and interacting with Geant4 visualization from within GEMC. It is designed to expose common viewer controls (camera direction, lighting, scene style toggles, cutaway planes, etc.) through a set of QWidget-based panels.
The module assumes a running Geant4 UI session and communicates with it by sending visualization commands to G4UImanager. These commands are the same as would be used interactively in a Geant4 macro, but are generated in response to GUI events.
The module is primarily composed of:
Several classes in this module are built on top of GEMC base utilities that provide structured logging via GLogger. The logger name for this module is typically "g4display" (see G4DISPLAY_LOGGER).
The conventional meaning of the verbosity levels is:
In a GEMC application, the GUI widget G4Display is instantiated with a shared GOptions instance and embedded into a parent window. Users interact with the GUI controls; the module translates those interactions into Geant4 visualization commands sent via G4UImanager.
The helper G4SceneProperties can be used during initialization to build a consistent default scene and viewer configuration from options.
g4display::defineOptions() provides the following option groups:
g4view: driver, window dimensions and position, curve precision, background, and cloud density.g4camera: initial camera theta and phi.g4light: initial light-source theta and phi.g4decoration: scale, axes, event ID, date, logos, and frame settings.g4text: optional scene annotations.dawn and useDawn: DAWN output view and enable switch.The typed accessors getG4View(), getG4Camera(), getG4Light(), and getG4Decorations() project those option nodes into the structures used by the GUI and scene initializer.
This module depends on:
Qt6 (Widgets module)Geant4 (UI and visualization)The following example demonstrates how to create a minimal Geant4 visualization environment and optionally attach the G4Display GUI.