EchoMap
2026-07-25 6d3977c
An experimental cross-platform digital signal processing application for sound-source localisation.
Toggle main menu visibility
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
13
namespace
echomap
14
{
15
16
ProjectPanel::ProjectPanel
(
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
24
void
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
50
const
char
*
ProjectPanel::get_imgui_name
() const noexcept
51
{
52
return
panel_name.c_str();
53
}
54
55
void
ProjectPanel::change_active_project
(
56
const
Project
*
const
new_project
57
)
58
{
59
active_project = new_project;
60
}
61
62
const
char
* ProjectPanel::get_imgui_stable_name() noexcept
63
{
64
return
"###ProjectPanel"
;
65
}
66
67
}
// namespace echomap
Signal.hpp
Audio signal class specification.
echomap::ProjectPanel::draw
void draw() noexcept override
Draw the panel to the active rendering context.
Definition
ProjectPanel.cpp:24
echomap::ProjectPanel::change_active_project
void change_active_project(const Project *new_project) override
Updates the active Project being described by the IPanel.
Definition
ProjectPanel.cpp:55
echomap::ProjectPanel::get_imgui_name
const char * get_imgui_name() const noexcept override
Retrieves the name of the IPanel for Dear ImGui API functions.
Definition
ProjectPanel.cpp:50
echomap::ProjectPanel::ProjectPanel
ProjectPanel(const Project *initial_project=nullptr)
Create a new ProjectPanel to display Project metadata.
Definition
ProjectPanel.cpp:16
echomap::Project
Definition
Project.hpp:26
echomap
The main EchoMap outermost namespace for all non-exported symbols.
Definition
ActionController.hpp:20
std
STL namespace.
src
panels
ProjectPanel.cpp
Generated by
1.17.0