From 6ec8cc216282396ece535941ea6ca4a63d924e8f Mon Sep 17 00:00:00 2001 From: rtk0c Date: Sun, 9 May 2021 18:00:18 -0700 Subject: Restore connection mechanism to simple one-to-one mode --- core/src/Model/Workflow/Workflow.hpp | 28 ++++------------------------ 1 file changed, 4 insertions(+), 24 deletions(-) (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 77341fa..7bcd349 100644 --- a/core/src/Model/Workflow/Workflow.hpp +++ b/core/src/Model/Workflow/Workflow.hpp @@ -19,34 +19,17 @@ class WorkflowConnection public: static constexpr auto kInvalidId = std::numeric_limits::max(); - enum Direction - { - ManyToOne, - OneToMany, - }; - - struct ConnectionPoint - { - size_t Node; - int Pin; - - bool operator==(const ConnectionPoint&) const = default; - }; - - 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; + size_t SourceNode; + size_t DestinationNode; + int SourcePin; + int DestinationPin; public: WorkflowConnection(); bool IsValid() const; - std::span GetSourcePoints(); - std::span GetSourcePoints() const; - std::span GetDestinationPoints(); - std::span GetDestinationPoints() const; void DrawDebugInfo() const; void ReadFrom(std::istream& stream); @@ -89,13 +72,11 @@ protected: size_t Connection = WorkflowConnection::kInvalidId; BaseValue::Kind MatchingType = BaseValue::InvalidKind; bool ConnectionToConst = false; - bool AllowsMultipleConnections = false; /// A constant connection connects from a user-specified constant value, feeding to a valid \c Destination and \c DestinationPin (i.e. input pins). bool IsConstantConnection() const; bool IsConnected() const; BaseValue::Kind GetMatchingType() const; - WorkflowConnection::Direction GetSupportedDirection() const; }; struct OutputPin @@ -108,7 +89,6 @@ protected: bool IsConnected() const; BaseValue::Kind GetMatchingType() const; - WorkflowConnection::Direction GetSupportedDirection() const; }; friend class Workflow; -- cgit v1.2.3-70-g09d2