Dynamic Neural Field Composer 0.0.0
A C++20 library and interactive application for building and simulating Dynamic Neural Field (DNF) architectures.
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | List of all members
dnf_composer::Application Class Reference

Top-level application that owns the GUI, simulation, and visualization. More...

#include <application.h>

Collaboration diagram for dnf_composer::Application:

Public Member Functions

template<typename WindowType , typename... Args>
requires (!has_simulation_constructor<WindowType>::value && !has_visualization_constructor<WindowType>::value)
void addWindow (Args &&... args) const
 Register a window that needs no Simulation or Visualization pointer.
 
template<typename WindowType , typename... Args>
requires has_simulation_constructor<WindowType>
void addWindow (Args &&... args) const
 Register a window that takes a Simulation shared_ptr as the first argument.
 
 Application (const std::shared_ptr< Simulation > &simulation=nullptr, const std::shared_ptr< Visualization > &visualization=nullptr)
 Construct an Application.
 
void close () const
 Tear down the GUI and close the simulation. Call once after the main loop.
 
bool hasGUIBeenClosed () const
 Return true if the user has closed the main window.
 
void init () const
 Initialize the GUI and all registered windows. Call once before step().
 
bool isGUIActive () const
 Return true if the GUI overlay is currently active.
 
void step () const
 Advance the simulation by one step and render all windows.
 
void toggleGUI ()
 Toggle the GUI on or off at runtime.
 
 ~Application ()=default
 

Static Public Member Functions

static float getUiScalePct ()
 
static void registerSettingsHandler ()
 Register the application's ImGui settings handler (for persistence).
 
static void setUiScalePct (float pct)
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ Application()

dnf_composer::Application::Application ( const std::shared_ptr< Simulation > &  simulation = nullptr,
const std::shared_ptr< Visualization > &  visualization = nullptr 
)
explicit

Construct an Application.

Parameters
simulationShared simulation to drive (may be nullptr).
visualizationShared visualization to render (may be nullptr).

◆ ~Application()

dnf_composer::Application::~Application ( )
default

Member Function Documentation

◆ addWindow() [1/2]

template<typename WindowType , typename... Args>
requires (!has_simulation_constructor<WindowType>::value && !has_visualization_constructor<WindowType>::value)
void dnf_composer::Application::addWindow ( Args &&...  args) const
inline

Register a window that needs no Simulation or Visualization pointer.

Here is the caller graph for this function:

◆ addWindow() [2/2]

template<typename WindowType , typename... Args>
requires has_simulation_constructor<WindowType>
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
Here is the caller graph for this function:

◆ 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().

Here is the call graph for this function:

◆ 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).

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setUiScalePct()

static void dnf_composer::Application::setUiScalePct ( float  pct)
inlinestatic
Here is the caller graph for this function:

◆ 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: