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
log_window.h
Go to the documentation of this file.
1
2#pragma once
3
4#include <vector>
5#include <string>
6#include <cstdarg>
7#include <imgui-platform-kit/user_interface_window.h>
8
11
12extern ImFont* g_BlackLargeFont;
13extern ImFont* g_MonoMediumFont;
14extern ImFont* g_MediumIconsFont;
15
17{
18 struct LogEntry
19 {
20 std::string message;
21 ImVec4 color;
22 };
23
24 class LogWindow final : public imgui_kit::UserInterfaceWindow
25 {
26 private:
27 inline static std::vector<LogEntry> logs;
28 inline static ImGuiTextFilter filter;
29 inline static bool autoScroll = true;
30 inline static bool isWindowActive = false;
31 inline static bool s_expanded = false;
32
33 public:
34 LogWindow();
35 static void addLog(const ImVec4& color, const char* fmt, ...) IM_FMTARGS(2);
36 void render() override { draw(); }
37 static bool isActive() { return isWindowActive; }
38 static void setActive(bool v) { isWindowActive = v; }
39 static void setExpanded(bool v) { s_expanded = v; }
40 ~LogWindow() override = default;
41 private:
42 static void clean() { logs.clear(); }
43 static void draw();
44 static void renderContent();
45 };
46}
Definition log_window.h:25
static void setExpanded(bool v)
Definition log_window.h:39
static void setActive(bool v)
Definition log_window.h:38
LogWindow()
Definition log_window.cpp:6
static bool isActive()
Definition log_window.h:37
void render() override
Definition log_window.h:36
static void addLog(const ImVec4 &color, const char *fmt,...) IM_FMTARGS(2)
Definition log_window.cpp:60
ImFont * g_MonoMediumFont
ImFont * g_MediumIconsFont
ImFont * g_BlackLargeFont
Definition control_bar_window.h:10
Definition log_window.h:19
std::string message
Definition log_window.h:20
ImVec4 color
Definition log_window.h:21