Enzo
Loading...
Searching...
No Matches
GeometryConnection.h
1#pragma once
2
3#include "Engine/Types.h"
4#include <boost/signals2.hpp>
5
6namespace enzo::nt
7{
8class GeometryOperator;
9
27{
28public:
39 GeometryConnection(enzo::nt::OpId inputOpId, unsigned int inputOpIndex, enzo::nt::OpId outputOpId, unsigned int outputOpIndex);
40
41 bool operator==(const enzo::nt::GeometryConnection& other) const
42 {
43 return (
44 getInputOpId()==other.getInputOpId() &&
45 getOutputOpId()==other.getOutputOpId() &&
46 getInputIndex()==other.getInputIndex() &&
48 );
49 }
50
51
57 unsigned int getInputIndex() const;
59 unsigned int getOutputIndex() const;
60
62 friend std::ostream& operator<<(std::ostream& os, const GeometryConnection& p)
63 {
64 return os << p.inputOperatorId_ << ":" << p.inputIndex_ << " -> " << p.outputOperatorId_ << ":" << p.outputIndex_ << "\n";
65 }
66
68 boost::signals2::signal<void ()> removed;
70 void remove();
71 // bool isValid();
72private:
73 enzo::nt::OpId inputOperatorId_;
74 enzo::nt::OpId outputOperatorId_;
75 unsigned int inputIndex_;
76 unsigned int outputIndex_;
77};
78}
Basic attribute, parameter, and node types for Enzo.
uint64_t OpId
The unique ID assigned to each node in the network.
Definition Types.h:87
Directional edges to connect nodes.
Definition GeometryConnection.h:27
enzo::nt::OpId getOutputOpId() const
Returns the Operator ID of the connection output (where data flows to).
Definition GeometryConnection.cpp:12
unsigned int getInputIndex() const
Returns the socket number of getInputOpId in which data flows from.
Definition GeometryConnection.cpp:13
GeometryConnection(enzo::nt::OpId inputOpId, unsigned int inputOpIndex, enzo::nt::OpId outputOpId, unsigned int outputOpIndex)
Constructs a connection between two nodes.
Definition GeometryConnection.cpp:6
unsigned int getOutputIndex() const
Returns the socket number of getOutputOpId in which data flows to.
Definition GeometryConnection.cpp:14
void remove()
Removes the connection from it's associated nodes. Does not delete the object.
Definition GeometryConnection.cpp:16
enzo::nt::OpId getInputOpId() const
Returns the Operator ID of the connection input (where data flows from).
Definition GeometryConnection.cpp:11
boost::signals2::signal< void()> removed
A signal emitted when the connection is removed.
Definition GeometryConnection.h:68
friend std::ostream & operator<<(std::ostream &os, const GeometryConnection &p)
Provides an ostream representation of the connection, useful for debugging.
Definition GeometryConnection.h:62