|
gboard
|
A custom Geant4 UI session that forwards Geant4 text output to a GBoard widget. More...
#include <gui_session.h>
Public Member Functions | |
| GUI_Session (const std::shared_ptr< GOptions > &gopt, GBoard *board) | |
| Constructs a GUI_Session. | |
| G4int | ReceiveG4cout (const G4String &coutString) override |
| Receives standard output from Geant4 and forwards it to the board. | |
| G4int | ReceiveG4cerr (const G4String &cerrString) override |
| Receives error output from Geant4 and forwards it to the board. | |
| ~GUI_Session () override | |
| Destructor. | |
Public Member Functions inherited from GBase< GUI_Session > | |
| GBase (const std::shared_ptr< GOptions > &gopt, std::string logger_name="") | |
| GBase (const std::shared_ptr< GLogger > &logger) | |
| GBase (const GBase &)=default | |
| GBase (GBase &&) noexcept=default | |
| virtual | ~GBase () |
| GBase & | operator= (const GBase &)=default |
| GBase & | operator= (GBase &&) noexcept=default |
Additional Inherited Members | |
Protected Attributes inherited from GBase< GUI_Session > | |
| std::shared_ptr< GLogger > | log |
This class implements the Geant4 UI session interface (G4UIsession) so that:
Typical usage:
G4UImanager as the cout destination.GUI_Session does not own the GBoard; the caller controls the board lifetime.
The implementation converts common ANSI formatting sequences into HTML suitable for QTextEdit rich text:
Definition at line 32 of file gui_session.h.
The constructor registers this instance as the Geant4 cout destination via G4UImanager.
| gopt | Shared pointer to the module options/logging configuration. |
| board | Pointer to the GBoard widget that will display forwarded messages (not owned). |
Definition at line 6 of file gui_session.cc.
|
override |
Detaches this session from G4UImanager to avoid callbacks into a destroyed object.
Definition at line 207 of file gui_session.cc.
|
override |
The incoming string may contain multiple lines. The implementation splits the text into lines, converts each line into rich text, and appends it to the board.
| cerrString | The error output string emitted by Geant4. |
G4UIsession interface). Definition at line 36 of file gui_session.cc.
|
override |
The incoming string may contain multiple lines. The implementation splits the text into lines, converts each line into rich text, and appends it to the board.
| coutString | The standard output string emitted by Geant4. |
G4UIsession interface). Definition at line 15 of file gui_session.cc.