EchoMap 2026-07-25 6d3977c
An experimental cross-platform digital signal processing application for sound-source localisation.
Loading...
Searching...
No Matches
ProjectPanel.cpp
1//
2// Created by owd on 25/06/2026.
3//
4
5#include "ProjectPanel.hpp"
6
7#include <imgui.h>
8
9#include "../objects/Project.hpp"
10#include "../objects/Sensor.hpp"
11#include "../objects/Signal.hpp"
12
13namespace echomap
14{
15
17 const Project* const initial_project
18) :
19 panel_name(std::string("Project Explorer") + get_imgui_stable_name()),
20 active_project(initial_project)
21{
22}
23
24void ProjectPanel::draw() noexcept
25{
26 constexpr ImGuiTreeNodeFlags default_flags = ImGuiTreeNodeFlags_DefaultOpen;
27
28 if (ImGui::Begin(panel_name.c_str())) {
29 if (active_project == nullptr)
30 ImGui::SeparatorText("No active project.");
31 else {
32 ImGui::SeparatorText(active_project->get_imgui_name());
33 if (ImGui::CollapsingHeader("Signals", default_flags))
34 for (const auto& signal : active_project->observe_signals())
35 ImGui::TextUnformatted(signal.get_imgui_name());
36
37 if (ImGui::CollapsingHeader("Sensors", default_flags))
38 for (const auto& sensor : active_project->observe_sensors())
39 ImGui::TextUnformatted(sensor.get_imgui_name());
40
41 if (ImGui::CollapsingHeader("Results", default_flags)) {
42 // TODO...
43 }
44 }
45 }
46
47 ImGui::End();
48}
49
50const char* ProjectPanel::get_imgui_name() const noexcept
51{
52 return panel_name.c_str();
53}
54
56 const Project* const new_project
57)
58{
59 active_project = new_project;
60}
61
62const char* ProjectPanel::get_imgui_stable_name() noexcept
63{
64 return "###ProjectPanel";
65}
66
67} // namespace echomap
Audio signal class specification.
void draw() noexcept override
Draw the panel to the active rendering context.
void change_active_project(const Project *new_project) override
Updates the active Project being described by the IPanel.
const char * get_imgui_name() const noexcept override
Retrieves the name of the IPanel for Dear ImGui API functions.
ProjectPanel(const Project *initial_project=nullptr)
Create a new ProjectPanel to display Project metadata.
The main EchoMap outermost namespace for all non-exported symbols.
STL namespace.