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
element_window.h
Go to the documentation of this file.
1#pragma once
2
3#include <imgui-platform-kit/user_interface_window.h>
4
9
11{
13 {
14 ImRect rect; // fixed rectangle of the panel (screen coords)
15 float ui{};
16 ImU32 fill{}, border{};
17 float rounding{};
18 ImVec2 pad{};
19 };
20
21 class ElementWindow final : public imgui_kit::UserInterfaceWindow
22 {
23 private:
24 std::shared_ptr<Simulation> simulation;
25 static std::shared_ptr<element::Element> focusedElement;
26 public:
27 explicit ElementWindow(const std::shared_ptr<Simulation>& simulation);
28
29 ElementWindow(const ElementWindow&) = delete;
33
34 void render() override;
37 static void switchElementToModify(const std::shared_ptr<element::Element>& element, const std::string& simId = {});
38 static void setFocusedElement(const std::shared_ptr<element::Element>& element);
39 ~ElementWindow() override = default;
40 private:
41 void renderIdentifiersSection(const std::shared_ptr<element::Element>& element) const;
42 void renderDimensionControls(const std::shared_ptr<element::Element>& element) const;
43 void renderDimensionControls2D(const std::shared_ptr<element::Element>& element) const;
44 // Editable "Input dimensions" blocks. Read current input dims via the getter and
45 // apply edits via the setter (which should sever connections + resize buffers).
46 void renderInputDimensionControls1D(const std::shared_ptr<element::Element>& element,
47 const element::ElementDimensions& current,
48 const std::function<void(const element::ElementDimensions&)>& apply) const;
49 void renderInputDimensionControls2D(const std::shared_ptr<element::Element>& element,
50 const element::ElementDimensions& current,
51 const std::function<void(const element::ElementDimensions&)>& apply) const;
52 static void modifyElementNeuralField(const std::shared_ptr<element::Element>& element);
53 static void modifyElementGaussStimulus(const std::shared_ptr<element::Element>& element);
54 static void modifyElementFieldCoupling(const std::shared_ptr<element::Element>& element, const std::string& simId = {});
55 static void modifyElementGaussKernel(const std::shared_ptr<element::Element>& element);
56 static void modifyElementMexicanHatKernel(const std::shared_ptr<element::Element>& element);
57 static void modifyElementNormalNoise(const std::shared_ptr<element::Element>& element);
58 static void modifyElementCorrelatedNormalNoise(const std::shared_ptr<element::Element>& element);
59 static void modifyElementGaussFieldCoupling(const std::shared_ptr<element::Element>& element);
60 static void modifyElementOscillatoryKernel(const std::shared_ptr<element::Element>& element);
61 static void modifyElementAsymmetricGaussKernel(const std::shared_ptr<element::Element>& element);
62 static void modifyElementBoostStimulus(const std::shared_ptr<element::Element>& element);
63 static void modifyElementMemoryTrace(const std::shared_ptr<element::Element>& element);
64 static void modifyElementNeuralField2D(const std::shared_ptr<element::Element>& element);
65 static void modifyElementGaussStimulus2D(const std::shared_ptr<element::Element>& element);
66 static void modifyElementGaussKernel2D(const std::shared_ptr<element::Element>& element);
67 static void modifyElementMexicanHatKernel2D(const std::shared_ptr<element::Element>& element);
68 static void modifyElementNormalNoise2D(const std::shared_ptr<element::Element>& element);
69 static void modifyElementOscillatoryKernel2D(const std::shared_ptr<element::Element>& element);
70 static void modifyElementTimedGaussStimulus(const std::shared_ptr<element::Element>& element);
71 static void modifyElementTimedGaussStimulus2D(const std::shared_ptr<element::Element>& element);
72 static void modifyElementBoostStimulus2D(const std::shared_ptr<element::Element>& element);
73 static void modifyElementCorrelatedNormalNoise2D(const std::shared_ptr<element::Element>& element);
74 static void modifyElementAsymmetricGaussKernel2D(const std::shared_ptr<element::Element>& element);
75 static void modifyElementMemoryTrace2D(const std::shared_ptr<element::Element>& element);
76 static void modifyElementResize(const std::shared_ptr<element::Element>& element);
77 static void modifyElementResize2D(const std::shared_ptr<element::Element>& element);
78 static void modifyElementCollapse(const std::shared_ptr<element::Element>& element);
79 static void modifyElementExpand(const std::shared_ptr<element::Element>& element);
80 static ImVec4 getColorForElementType(element::ElementLabel label);
81 static std::string getElementTypeDisplayName(element::ElementLabel label);
82 static PanelScope beginElementPanel(const ImVec4& baseColor, const ImVec2& size);
83 static void endElementPanel(const PanelScope& p);
84 };
85}
Definition element_window.h:22
void renderElementControlCard()
Definition element_window.cpp:178
static void setFocusedElement(const std::shared_ptr< element::Element > &element)
Definition element_window.cpp:136
void renderModifyElementParameters()
Definition element_window.cpp:394
ElementWindow & operator=(const ElementWindow &)=delete
void render() override
Definition element_window.cpp:145
static void switchElementToModify(const std::shared_ptr< element::Element > &element, const std::string &simId={})
Definition element_window.cpp:783
ElementWindow & operator=(ElementWindow &&)=delete
ElementWindow(const ElementWindow &)=delete
ElementLabel
Definition element_parameters.h:12
Definition control_bar_window.h:10
Definition element_parameters.h:159
Definition element_window.h:13
ImU32 border
Definition element_window.h:16
float rounding
Definition element_window.h:17
ImVec2 pad
Definition element_window.h:18
ImRect rect
Definition element_window.h:14
float ui
Definition element_window.h:15
ImU32 fill
Definition element_window.h:16