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
visualization.h
Go to the documentation of this file.
1#pragma once
2
3#include <iostream>
4#include <vector>
5
8#include "plot.h"
9#include "tools/logger.h"
12
15
16namespace dnf_composer
17{
27 {
28 private:
29 std::shared_ptr<Simulation> simulation;
30 std::unordered_map<std::shared_ptr<Plot>, std::vector<std::pair<std::string, std::string>>> plots;
31 std::string windowSuffix;
32 public:
35 explicit Visualization(const std::shared_ptr<Simulation>& simulation);
36
40
43 void plot(const std::vector<std::pair<std::string, std::string>>& data);
44
48 void plot(const std::string& name, const std::string& component);
49
54 void plot(const PlotCommonParameters& parameters, const PlotSpecificParameters& specificParameters, const std::vector<std::pair<std::string, std::string>>& data);
55
57 void plot(const PlotCommonParameters& parameters, const PlotSpecificParameters& specificParameters, const std::string& name, const std::string& component);
58
62 void plot(int plotId, const std::vector<std::pair<std::string, std::string>>& data);
63
65 void plot(int plotId, const std::string& name, const std::string& component);
66
68 void removePlot(int plotId);
69
71 void removeAllPlots();
72
76 void removePlottingDataFromPlot(int plotId, const std::pair<std::string, std::string>& data);
77
79 [[nodiscard]] std::shared_ptr<Simulation> getSimulation() const { return simulation; }
80
82 std::unordered_map<std::shared_ptr<Plot>, std::vector<std::pair<std::string, std::string>>> getPlots() { return plots; }
83
85 void render();
86
89 void renderTile(int plotId);
90
92 void setWindowIdSuffix(const std::string& s) { windowSuffix = s; }
93 void clearWindowIdSuffix() { windowSuffix.clear(); }
94 };
95}
Manages a collection of plots driven by a running Simulation.
Definition visualization.h:27
void removeAllPlots()
Remove all registered plots.
Definition visualization.cpp:119
void render()
Render all plots (creates ImGui windows or child regions as appropriate).
Definition visualization.cpp:207
void setWindowIdSuffix(const std::string &s)
Set a suffix appended to all ImGui window IDs to avoid collisions.
Definition visualization.h:92
std::shared_ptr< Simulation > getSimulation() const
Return the underlying simulation.
Definition visualization.h:79
void removePlottingDataFromPlot(int plotId, const std::pair< std::string, std::string > &data)
Remove a specific data source from a plot.
Definition visualization.cpp:125
void removePlot(int plotId)
Remove the plot with the given plotId.
Definition visualization.cpp:99
void plot(PlotType type=PlotType::LINE_PLOT)
Add a blank plot of the given type.
Definition visualization.cpp:18
void renderTile(int plotId)
Render a single plot's content without creating an ImGui window (caller owns the region).
Definition visualization.cpp:178
std::unordered_map< std::shared_ptr< Plot >, std::vector< std::pair< std::string, std::string > > > getPlots()
Return the full plots map (plot → data sources).
Definition visualization.h:82
void clearWindowIdSuffix()
Definition visualization.h:93
Definition application.h:20
PlotType
Definition plot_parameters.h:37
Definition plot_parameters.h:48
Definition plot_parameters.h:62