Top-level application that owns the GUI, simulation, and visualization.
More...
#include <application.h>
Top-level application that owns the GUI, simulation, and visualization.
Application drives the main loop:
app.init();
while (!app.hasGUIBeenClosed())
app.step();
app.close();
Windows are registered via addWindow<T>() before init(). The template specializations automatically forward a Simulation or Visualization pointer to constructors that require one.
◆ Application()
| dnf_composer::Application::Application |
( |
const std::shared_ptr< Simulation > & |
simulation = nullptr, |
|
|
const std::shared_ptr< Visualization > & |
visualization = nullptr |
|
) |
| |
|
explicit |
Construct an Application.
- Parameters
-
| simulation | Shared simulation to drive (may be nullptr). |
| visualization | Shared visualization to render (may be nullptr). |
◆ ~Application()
| dnf_composer::Application::~Application |
( |
| ) |
|
|
default |
◆ addWindow() [1/2]
| void dnf_composer::Application::addWindow |
( |
Args &&... |
args | ) |
const |
|
inline |
◆ addWindow() [2/2]
| void dnf_composer::Application::addWindow |
( |
Args &&... |
args | ) |
const |
|
inline |
Register a window that takes a Simulation shared_ptr as the first argument.
◆ close()
| void dnf_composer::Application::close |
( |
| ) |
const |
Tear down the GUI and close the simulation. Call once after the main loop.
◆ getUiScalePct()
| static float dnf_composer::Application::getUiScalePct |
( |
| ) |
|
|
inlinestatic |
◆ hasGUIBeenClosed()
| bool dnf_composer::Application::hasGUIBeenClosed |
( |
| ) |
const |
Return true if the user has closed the main window.
◆ init()
| void dnf_composer::Application::init |
( |
| ) |
const |
Initialize the GUI and all registered windows. Call once before step().
◆ isGUIActive()
| bool dnf_composer::Application::isGUIActive |
( |
| ) |
const |
Return true if the GUI overlay is currently active.
◆ registerSettingsHandler()
| void dnf_composer::Application::registerSettingsHandler |
( |
| ) |
|
|
static |
Register the application's ImGui settings handler (for persistence).
◆ setUiScalePct()
| static void dnf_composer::Application::setUiScalePct |
( |
float |
pct | ) |
|
|
inlinestatic |
◆ step()
| void dnf_composer::Application::step |
( |
| ) |
const |
Advance the simulation by one step and render all windows.
◆ toggleGUI()
| void dnf_composer::Application::toggleGUI |
( |
| ) |
|
Toggle the GUI on or off at runtime.
The documentation for this class was generated from the following files: