8#ifndef ECHOMAP_ECHOMAP_HPP
9#define ECHOMAP_ECHOMAP_HPP
11#include <GLFW/glfw3.h>
13#include <sigc++/scoped_connection.h>
14#include <webgpu/webgpu_cpp.h>
61 void change_active_project(
std::unique_ptr<
Project> new_project) noexcept;
125 static constexpr auto operation_timeout =
std::numeric_limits<
std::uint64_t>::max();
155 const wgpu::Surface& surface,
156 const wgpu::Device& device,
157 const wgpu::SurfaceCapabilities& capabilities,
158 std::uint32_t viewport_width,
159 std::uint32_t viewport_height
191 void setup_dockspace();
211 void raise_error(
std::string_view message);
213 std::string_view message,
214 const
std::runtime_error& exception
228 std::uint32_t viewport_width = 1024;
229 std::uint32_t viewport_height = 1024;
231 wgpu::Instance instance;
232 wgpu::Adapter adapter;
234 wgpu::Surface surface;
235 wgpu::SurfaceCapabilities surface_capabilities;
236 GLFWwindow* window =
nullptr;
248 ImGuiID dockspace_id;
249 bool dockspace_configured = false;
250 unsigned int forced_frames = 0;
AllNotificationsFwd specification.
EchoMap modal error panel specification.
WorkerResultDespatcher specification.
virtual void run_event_loop()=0
Runs the platform-dependent event loop to manage and propagate interaction with the EchoMap applicati...
std::unique_ptr< Project > project
Owning container for the active Project.
void increment_forced_frames(unsigned int count=4) noexcept
Indicate to the renderer that the following frames should always be rendered, regardless of whether t...
void notify(const Notification ¬ification)
Submit a new Notification to the application queue.
std::vector< sigc::scoped_connection > connections
RAII lifetime manager for signal connections.
EchoMap()
Initialise a EchoMap application instance.
void setup_subscriptions()
Configure the core signals for the application instance.
void render() noexcept
Perform a render cycle on the configured Surface and Device.
wgpu::Future request_device() noexcept
Produce a WebGPU Future for requesting an accelerator device.
std::unique_ptr< IPanel > active_modal
The current active non-ErrorModal modal panel.
auto make_common_notification_visitors()
Produce an overload set for std::visit for all platform-independent Notification objects.
virtual void visit_notification(Notification ¬ification)=0
Uses std::visit on the given notification to invoke the corresponding handler.
static void configure_surface(const wgpu::Surface &surface, const wgpu::Device &device, const wgpu::SurfaceCapabilities &capabilities, std::uint32_t viewport_width, std::uint32_t viewport_height) noexcept
Configure a WebGPU Surface from a static context given metadata and Adapter capabilities.
void process_notifications()
Handle any unconsumed Notification objects from the queue.
bool handle_window_resize() noexcept
Check if the window has been resized compared with the stored dimensions, updating member variables a...
static GLFWwindow * create_window(int width, int height)
Create a new GLFW window of the specified dimensions from a static context.
std::vector< std::unique_ptr< IProjectPanel > > panels
Individual display components.
void setup_imgui()
Create a context for Dear ImGui and ImPlot, and configure the plain GLFW and WebGPU backends.
void process_worker_results()
Handle any unconsumed events from the Worker.
wgpu::Future request_adapter() noexcept
Produce a WebGPU Future for requesting an Adapter.
Worker worker
Multi-threaded worker for scheduling heavy computation tasks.
std::optional< ErrorModal > error_modal
Persistent panel to indicate errors over all other panels.
virtual ~EchoMap() noexcept
Clean up all persistent state registered by the application instance.
WorkerResultDespatcher despatcher
Despatcher to manage Worker result channels.
Provides a persistent ImGui state to raise errors as a modal.
Represents a panel or window on the GUI.
An IPanel which can receive updates to the application-wide active Project.
Denotes a loaded Project completed by a LoadProjectTask job.
Manages channels for WorkerResult message routing.
A Worker provides an encapsulated thread-safe despatch model for submitting work and reviewing result...
std::variant< AddChannelMappingNotification, ModifySensorColourNotification, ModifySensorPositionNotification, ProjectSelectionCompleteNotification, ClearErrorNotification, RaiseFileChooserNotification, RegisterVFSMappingNotification, CompleteProjectLoadNotification, CancelProjectLoadNotification > Notification
A Notification is a trivial message sent exclusively to the EchoMap controller.
The main EchoMap outermost namespace for all non-exported symbols.
A notification indicating that a new channel mapping should be established.
A notification indicating that any error state visible to the user should be reset.
A notification indicating that the colour of a Sensor should be changed.
A notification indicating that the position of a Sensor should be changed.
A notification indicating that a new Project file has been selected by the user, or the load operatio...
A helper type for succinctly specifying callable visitors over a variant alternative.