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
builders.h
Go to the documentation of this file.
1//------------------------------------------------------------------------------
2// LICENSE
3// This software is dual-licensed to the public domain and under the following
4// license: you are granted a perpetual, irrevocable license to copy, modify,
5// publish, and distribute this file as you see fit.
6//
7// CREDITS
8// Written by Michal Cichon
9//------------------------------------------------------------------------------
10# pragma once
11
12
13//------------------------------------------------------------------------------
14#include <imgui-platform-kit/user_interface_window.h>
16
17
18//------------------------------------------------------------------------------
19namespace ax {
20namespace NodeEditor {
21namespace Utilities {
22
23
24//------------------------------------------------------------------------------
26{
27 BlueprintNodeBuilder(ImTextureID texture = reinterpret_cast<ImTextureID>(nullptr), int textureWidth = 0, int textureHeight = 0);
28
29 void Begin(NodeId id);
30 void End();
31
32 void Header(const ImVec4& color = ImVec4(1, 1, 1, 1));
33 void EndHeader();
34
35 void Input(PinId id);
36 void EndInput();
37
38 void Middle();
39
40 void Output(PinId id);
41 void EndOutput();
42
43
44private:
45 enum class Stage
46 {
47 Invalid,
48 Begin,
49 Header,
50 Content,
51 Input,
52 Output,
53 Middle,
54 End
55 };
56
57 bool SetStage(Stage stage);
58
59 void Pin(PinId id, ax::NodeEditor::PinKind kind);
60 void EndPin();
61
62 ImTextureID HeaderTextureId;
63 int HeaderTextureWidth;
64 int HeaderTextureHeight;
65 NodeId CurrentNodeId;
66 Stage CurrentStage;
67 ImU32 HeaderColor;
68 ImVec2 NodeMin;
69 ImVec2 NodeMax;
70 ImVec2 HeaderMin;
71 ImVec2 HeaderMax;
72 ImVec2 ContentMin;
73 ImVec2 ContentMax;
74 bool HasHeader;
75};
76
77
78
79//------------------------------------------------------------------------------
80} // namespace Utilities
81} // namespace Editor
82} // namespace ax
Definition builders.h:19
void EndOutput()
Definition builders.cpp:154
void End()
Definition builders.cpp:44
void Middle()
Definition builders.cpp:129
void EndHeader()
Definition builders.cpp:100
void Header(const ImVec4 &color=ImVec4(1, 1, 1, 1))
Definition builders.cpp:94
void EndInput()
Definition builders.cpp:122