|
VisuTwin Canvas
C++ 3D Engine — Metal Backend
|
#include <viz/overlay/imguiOverlay.h>
Public Member Functions | |
| void | beginFrame () |
| Begin a new ImGui frame. Call once per frame before building any UI. | |
| void | endFrame () |
| ImGuiOverlay ()=default | |
| ImGuiOverlay (const ImGuiOverlay &)=delete | |
| ImGuiOverlay (ImGuiOverlay &&) noexcept | |
| void | init (MetalGraphicsDevice *device, SDL_Window *window) |
| bool | isInitialized () const |
| Whether the overlay has been initialized. | |
| void | label3D (const Vector3 &worldPos, const char *text, const Color &color=Color(0.94f, 0.96f, 0.98f, 0.95f)) |
| ImGuiOverlay & | operator= (const ImGuiOverlay &)=delete |
| ImGuiOverlay & | operator= (ImGuiOverlay &&) noexcept |
| void | panelLabel3D (const Vector3 &worldPos, const char *title, const char *body, const Color &panelColor=Color(0.06f, 0.09f, 0.16f, 0.88f)) |
| Render a text label with a background panel anchored to a 3D world position. | |
| bool | processEvent (const SDL_Event &event) |
| void | renderToGPU () |
| void | setViewProjection (const Matrix4 &vp) |
| Set the current frame's view-projection matrix (needed for worldToScreen). | |
| void | setWindowSize (int width, int height) |
| Set the current window dimensions (needed for NDC→screen conversion). | |
| void | shutdown () |
| Shut down ImGui and release all resources. | |
| bool | wantCaptureKeyboard () const |
| True if ImGui wants exclusive keyboard input (an ImGui text field is active). | |
| bool | wantCaptureMouse () const |
| True if ImGui wants exclusive mouse input (cursor is over an ImGui window). | |
| ~ImGuiOverlay () | |
Static Public Member Functions | |
| static void | applyDigitalTwinTheme () |
| Apply the digital twin dark glassmorphism theme. | |
Definition at line 42 of file imguiOverlay.h.
|
default |
Referenced by ImGuiOverlay(), ImGuiOverlay(), operator=(), and operator=().
| visutwin::canvas::ImGuiOverlay::~ImGuiOverlay | ( | ) |
Definition at line 35 of file imguiOverlay.cpp.
References shutdown().
|
delete |
References ImGuiOverlay().
|
noexcept |
Definition at line 42 of file imguiOverlay.cpp.
References ImGuiOverlay().
|
static |
Apply the digital twin dark glassmorphism theme.
Definition at line 271 of file imguiOverlay.cpp.
Referenced by init().
| void visutwin::canvas::ImGuiOverlay::beginFrame | ( | ) |
Begin a new ImGui frame. Call once per frame before building any UI.
Definition at line 120 of file imguiOverlay.cpp.
Referenced by operator=().
| void visutwin::canvas::ImGuiOverlay::endFrame | ( | ) |
Finalize the ImGui frame and generate draw lists. Call after all ImGui::Begin/End calls are done.
Definition at line 142 of file imguiOverlay.cpp.
Referenced by operator=().
| void visutwin::canvas::ImGuiOverlay::init | ( | MetalGraphicsDevice * | device, |
| SDL_Window * | window ) |
Initialize ImGui context, Metal backend, SDL3 backend, and theme. Call once after creating the graphics device and SDL window.
Definition at line 72 of file imguiOverlay.cpp.
References applyDigitalTwinTheme().
Referenced by operator=().
|
inline |
Whether the overlay has been initialized.
Definition at line 84 of file imguiOverlay.h.
References isInitialized().
Referenced by isInitialized().
| void visutwin::canvas::ImGuiOverlay::label3D | ( | const Vector3 & | worldPos, |
| const char * | text, | ||
| const Color & | color = Color(0.94f, 0.96f, 0.98f, 0.95f) ) |
Render a text label anchored to a 3D world position. The label is projected to screen space using the current view-projection. Call between beginFrame() and endFrame().
Definition at line 223 of file imguiOverlay.cpp.
References visutwin::canvas::Color::a, visutwin::canvas::Color::b, visutwin::canvas::Color::g, and visutwin::canvas::Color::r.
|
delete |
References beginFrame(), endFrame(), ImGuiOverlay(), init(), processEvent(), renderToGPU(), shutdown(), wantCaptureKeyboard(), and wantCaptureMouse().
|
noexcept |
Definition at line 55 of file imguiOverlay.cpp.
References ImGuiOverlay(), and shutdown().
| void visutwin::canvas::ImGuiOverlay::panelLabel3D | ( | const Vector3 & | worldPos, |
| const char * | title, | ||
| const char * | body, | ||
| const Color & | panelColor = Color(0.06f, 0.09f, 0.16f, 0.88f) ) |
Render a text label with a background panel anchored to a 3D world position.
Definition at line 239 of file imguiOverlay.cpp.
References visutwin::canvas::Color::a.
| bool visutwin::canvas::ImGuiOverlay::processEvent | ( | const SDL_Event & | event | ) |
Forward an SDL event to ImGui for input handling. Call this inside the SDL_PollEvent loop, BEFORE your own event handlers. Returns true if ImGui consumed the event (you can skip your own handling).
Definition at line 102 of file imguiOverlay.cpp.
Referenced by operator=().
| void visutwin::canvas::ImGuiOverlay::renderToGPU | ( | ) |
Encode ImGui draw data into a Metal command buffer targeting the frame's drawable. Call between endFrame() and the present.
Definition at line 148 of file imguiOverlay.cpp.
Referenced by operator=().
|
inline |
Set the current frame's view-projection matrix (needed for worldToScreen).
Definition at line 89 of file imguiOverlay.h.
|
inline |
Set the current window dimensions (needed for NDC→screen conversion).
Definition at line 92 of file imguiOverlay.h.
| void visutwin::canvas::ImGuiOverlay::shutdown | ( | ) |
Shut down ImGui and release all resources.
Definition at line 186 of file imguiOverlay.cpp.
Referenced by operator=(), operator=(), and ~ImGuiOverlay().
| bool visutwin::canvas::ImGuiOverlay::wantCaptureKeyboard | ( | ) | const |
True if ImGui wants exclusive keyboard input (an ImGui text field is active).
Definition at line 114 of file imguiOverlay.cpp.
Referenced by operator=().
| bool visutwin::canvas::ImGuiOverlay::wantCaptureMouse | ( | ) | const |
True if ImGui wants exclusive mouse input (cursor is over an ImGui window).
Definition at line 108 of file imguiOverlay.cpp.
Referenced by operator=().