aboutsummaryrefslogtreecommitdiff
path: root/core/src/Model/Workflow/Workflow.hpp
diff options
context:
space:
mode:
authorrtk0c <[email protected]>2021-05-09 18:00:18 -0700
committerrtk0c <[email protected]>2021-05-09 18:00:18 -0700
commit6ec8cc216282396ece535941ea6ca4a63d924e8f (patch)
tree10b1de27d66dc81a9fc8b6e8128228651961debd /core/src/Model/Workflow/Workflow.hpp
parent8fbe7f89c808d8eb28d8615ddda219208f936956 (diff)
Restore connection mechanism to simple one-to-one mode
Diffstat (limited to 'core/src/Model/Workflow/Workflow.hpp')
-rw-r--r--core/src/Model/Workflow/Workflow.hpp28
1 files changed, 4 insertions, 24 deletions
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<size_t>::max();
- enum Direction
- {
- ManyToOne,
- OneToMany,
- };
-
- struct ConnectionPoint
- {
- size_t Node;
- int Pin;
-
- bool operator==(const ConnectionPoint&) const = default;
- };
-
- std::vector<ConnectionPoint> 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<ConnectionPoint> GetSourcePoints();
- std::span<const ConnectionPoint> GetSourcePoints() const;
- std::span<ConnectionPoint> GetDestinationPoints();
- std::span<const ConnectionPoint> 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;