diff options
author | rtk0c <[email protected]> | 2021-04-28 15:18:51 -0700 |
---|---|---|
committer | rtk0c <[email protected]> | 2021-04-28 15:18:51 -0700 |
commit | 00fd95526677d670d002ca81069636f0f74b91f7 (patch) | |
tree | a783f05be218a58c2b78175425f7576664c3f1a9 /core/src/UI/UI_Workflows.cpp | |
parent | b7d5b514e7bffd3149a99bc7f1424f8251876d85 (diff) |
Code cleanup, fix database view paging and selection
Diffstat (limited to 'core/src/UI/UI_Workflows.cpp')
-rw-r--r-- | core/src/UI/UI_Workflows.cpp | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/core/src/UI/UI_Workflows.cpp b/core/src/UI/UI_Workflows.cpp index 0adfdc2..fe504e2 100644 --- a/core/src/UI/UI_Workflows.cpp +++ b/core/src/UI/UI_Workflows.cpp @@ -9,10 +9,13 @@ #include "Utils/Macros.hpp" #include <imgui.h> +#include <imgui_node_editor.h> #include <memory> #include <span> #include <vector> +namespace ImNodes = ax::NodeEditor; + namespace { class WorkflowCreationMenu { private: @@ -127,13 +130,41 @@ private: class WorkflowUI { private: Workflow* mWorkflow; + ImNodes::EditorContext* mContext; public: + WorkflowUI() { + mContext = ImNodes::CreateEditor(); + } + + ~WorkflowUI() { + ImNodes::DestroyEditor(mContext); + } + void Draw() { + ImNodes::SetCurrentEditor(mContext); + ImNodes::Begin(""); + + for (auto& node : mWorkflow->GetNodes()) { + if (!node) continue; + + ImNodes::BeginNode(node->GetId()); + node->Draw(); + ImNodes::EndNode(); + } + + for (auto& conn : mWorkflow->GetConnections()) { + if (!conn.IsValid()) continue; + + // TODO create link + } + + ImNodes::End(); } }; } // namespace void UI::WorkflowsTab() { + static std::unique_ptr<WorkflowUI> openWorkflow; // TODO } |