54 LOG_DEBUG(
"{}: Setting DataIdentifier on pinIndex {}",
nameId(), otherPinIndex);
56 inputPins.at(connectedPinIndex).dataIdentifier = dataIdentifiers;
58 if (!
inputPins.at(otherPinIndex).isPinLinked())
60 inputPins.at(otherPinIndex).dataIdentifier = dataIdentifiers;
61 for (
const auto& dataIdentifier : dataIdentifiers)
65 inputPins.at(otherPinIndex).dataIdentifier.insert(
inputPins.at(otherPinIndex).dataIdentifier.end(), parentIdentifiers.rbegin(), parentIdentifiers.rend());
73 std::vector<std::string> combinedIdentifiers;
74 for (
const auto& dataIdentifier :
inputPins.at(connectedPinIndex).dataIdentifier)
76 if (
auto iter = std::find(
inputPins.at(otherPinIndex).dataIdentifier.begin(),
inputPins.at(otherPinIndex).dataIdentifier.end(), dataIdentifier);
77 iter !=
inputPins.at(otherPinIndex).dataIdentifier.end())
79 combinedIdentifiers.push_back(*iter);
82 if (!combinedIdentifiers.empty())
88 std::vector<std::string> connectedPinParents;
89 for (
const auto& dataIdentifier :
inputPins.at(connectedPinIndex).dataIdentifier)
93 connectedPinParents.insert(connectedPinParents.begin(), parentIdentifiers.begin(), parentIdentifiers.end());
96 for (
const auto& dataIdentifier :
inputPins.at(otherPinIndex).dataIdentifier)
98 if (std::ranges::find(connectedPinParents, dataIdentifier) != connectedPinParents.end())
115 if (
auto* endPin = link.getConnectedPin())
132 if (
auto* connectedPin = link.getConnectedPin())
168 LOG_TRACE(
"{}: called for {} ==> {}",
nameId(),
size_t(startPin.id),
size_t(endPin.
id));
176 for (
size_t pinIdx = 0; pinIdx <
inputPins.size(); pinIdx++)
179 if (endPin.
id != pin.id)
181 if (pin.isPinLinked())
185 auto* otherNodePin = pin.link.getConnectedPin();
#define LOG_DEBUG
Debug information. Should not be called on functions which receive observations (spamming)
#define LOG_TRACE
Detailled info to trace the execution of the program. Should not be called on functions which receive...
Utility class which specifies available nodes.
bool onCreateLink(OutputPin &startPin, InputPin &endPin) override
Called when a new link is to be established.
static std::string typeStatic()
String representation of the Class Type.
static std::string category()
String representation of the Class Category.
void updateOutputPin(const std::vector< std::string > &oldDataIdentifiers)
Checks if link on the pin is still valid and refreshes if so.
std::string type() const override
String representation of the Class Type.
void receiveData(InputPin::NodeDataQueue &queue, size_t pinIdx)
Receive data.
void setPinIdentifiers(size_t connectedPinIndex, size_t otherPinIndex, const std::vector< std::string > &dataIdentifiers)
Set the Pin Identifiers for the other pin depending on the connected pin.
void afterDeleteLink(OutputPin &startPin, InputPin &endPin) override
Called when a link was deleted.
Merger()
Default constructor.
static constexpr size_t INPUT_PORT_INDEX_FLOW_SECOND
Flow.
static constexpr size_t INPUT_PORT_INDEX_FLOW_FIRST
Flow.
static constexpr size_t OUTPUT_PORT_INDEX_FLOW
Flow.
~Merger() override
Destructor.
static std::string type()
Returns the type of the data class.
std::vector< OutputPin > outputPins
List of output pins.
Node(std::string name)
Constructor.
Kind kind
Kind of the Node.
std::vector< InputPin > inputPins
List of input pins.
bool callbacksEnabled
Enables the callbacks.
std::string nameId() const
Node name and id.
size_t inputPinIndexFromId(ax::NodeEditor::PinId pinId) const
Returns the index of the pin.
std::string name
Name of the Node.
void invokeCallbacks(size_t portIndex, const std::shared_ptr< const NodeData > &data)
Calls all registered callbacks on the specified output port.
ax::NodeEditor::NodeId id
Unique Id of the Node.
bool _hasConfig
Flag if the config window should be shown.
Node * parentNode
Reference to the parent node.
ax::NodeEditor::PinId id
Unique Id of the Pin.
std::vector< std::string > dataIdentifier
One or multiple Data Identifiers (Unique name which is used for data flows)
auto extract_front()
Returns a copy of the first element in the container and removes it from the container.
OutputPin * CreateOutputPin(Node *node, const char *name, Pin::Type pinType, const std::vector< std::string > &dataIdentifier, OutputPin::PinData data=static_cast< void * >(nullptr), int idx=-1)
Create an Output Pin object.
InputPin * CreateInputPin(Node *node, const char *name, Pin::Type pinType, const std::vector< std::string > &dataIdentifier={}, InputPin::Callback callback=static_cast< InputPin::FlowFirableCallbackFunc >(nullptr), InputPin::FlowFirableCheckFunc firable=nullptr, int priority=0, int idx=-1)
Create an Input Pin object.
std::vector< std::string > GetParentNodeDataTypes(const std::string &type)
Get the Parent Node Data Types of the specified Node Data Type.