#pragma once #include "workspace.h" // AppActions, UIContext #include "rendering/view.h" namespace Donut { // the application's docking shell. draws a main menu bar and a full-viewport // dock space with a pass-through centre (the live 3D render shows through the // middle), then a set of dockable tool panels. ships a few default layouts // built with the DockBuilder API and lets the user rearrange, hide, or restore // panels like a normal desktop app. draw() returns the View the RenderPath // should draw this frame. class UILayer { public: UILayer() = default; auto draw(const UIContext& ctx) -> View; private: // which 3D view fills the pass-through centre. enum class Mode { Scene, Simulation }; // a named default arrangement of the panels. enum class Layout { Simulation, SceneEditing, Export }; auto draw_menu_bar(const UIContext& ctx) -> void; auto build_layout(unsigned int dockspace_id) -> void; // DockBuilder tree auto apply_layout(Layout layout) -> void; // preset: view + panels auto panel_outliner(const UIContext& ctx) -> void; auto panel_properties(const UIContext& ctx) -> void; auto panel_black_hole(const UIContext& ctx) -> void; auto panel_settings(const UIContext& ctx) -> void; auto panel_export(const UIContext& ctx) -> void; auto panel_stats(const UIContext& ctx) -> void; Mode m_mode = Mode::Simulation; Layout m_layout = Layout::Simulation; bool m_rebuild_layout = false; // rebuild the dock tree next frame bool m_first_frame = true; // seed the default layout once, if no saved one // panel visibility (defaults match the Simulation layout the app opens in). bool m_show_outliner = false; bool m_show_properties = false; bool m_show_black_hole = true; bool m_show_settings = false; bool m_show_export = false; bool m_show_stats = true; // properties-panel gizmo op (0 = translate, 1 = scale); cast in the .cpp. int m_gizmo_op = 0; // settings panel. float m_ui_scale = 1.0f; // export panel. bool m_exp_color = true, m_exp_redshift = false, m_exp_temperature = false, m_exp_impact = false; int m_exp_resolution = 1, m_exp_format = 0; int m_exp_written = 0; bool m_exp_reported = false; }; }