From 8fbe7f89c808d8eb28d8615ddda219208f936956 Mon Sep 17 00:00:00 2001 From: rtk0c Date: Sun, 9 May 2021 17:20:12 -0700 Subject: Add unique id to workflow components --- core/src/Model/Workflow/Workflow.hpp | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'core/src/Model/Workflow/Workflow.hpp') diff --git a/core/src/Model/Workflow/Workflow.hpp b/core/src/Model/Workflow/Workflow.hpp index cf3e2f9..77341fa 100644 --- a/core/src/Model/Workflow/Workflow.hpp +++ b/core/src/Model/Workflow/Workflow.hpp @@ -34,6 +34,8 @@ public: }; std::vector MultiConnections; + /// Used for `LinkId` when interfacing with imgui node editor. Runtime only (not saved to disk and generated when loading). + size_t UniqueId; ConnectionPoint SingleConnection; Direction ConnectionDirection; @@ -82,6 +84,8 @@ public: protected: struct InputPin { + /// Equivalent of `PinId` when interfacing with imgui node editor. Runtime only (not saved to disk and generated when loading). + size_t UniqueId; size_t Connection = WorkflowConnection::kInvalidId; BaseValue::Kind MatchingType = BaseValue::InvalidKind; bool ConnectionToConst = false; @@ -96,6 +100,8 @@ protected: struct OutputPin { + /// Equivalent of `PinId` when interfacing with imgui node editor. Runtime only (not saved to disk and generated when loading). + size_t UniqueId; size_t Connection = WorkflowConnection::kInvalidId; BaseValue::Kind MatchingType = BaseValue::InvalidKind; bool AllowsMultipleConnections = false; @@ -109,6 +115,8 @@ protected: friend class WorkflowEvaluationContext; Workflow* mWorkflow; + /// Equivalent of `NodeId` when interfacing with imgui node editor. Runtime only (not saved to disk and generated when loading). + size_t mUniqueId; size_t mId; std::vector mInputs; std::vector mOutputs; @@ -178,6 +186,7 @@ class Workflow private: friend class WorkflowEvaluationContext; + size_t mUniqueId = 0; std::vector mConnections; std::vector> mNodes; std::vector> mConstants; @@ -257,6 +266,7 @@ public: void WriteTo(std::ostream& stream); private: + size_t AllocUniqueId(); std::pair AllocWorkflowConnection(); std::pair&, size_t> AllocWorkflowStep(); }; -- cgit v1.2.3-70-g09d2