16#include <imgui_node_editor.h>
27namespace NAV::NodeManager
56void AddLink(ax::NodeEditor::LinkId linkId);
71 int priority = 0,
int idx = -1);
85 typename = std::enable_if_t<std::is_base_of_v<Node, T>>>
87 void (T::*callback)(
InputPin::NodeDataQueue&, size_t) = nullptr,
88 InputPin::FlowFirableCheckFunc firable = nullptr,
89 int priority = 0, int idx = -1)
106 typename = std::enable_if_t<std::is_base_of_v<Node, T>>>
108 void (T::*notifyFunc)(const
InsTime&, size_t), int idx = -1)
135 typename = std::enable_if_t<std::is_base_of_v<Node, T>>>
137 std::shared_ptr<const NAV::NodeData> (T::*peekPollDataFunc)(size_t, bool) = nullptr, int idx = -1)
141 [](
const OutputPin& outputPin) { return std::holds_alternative<OutputPin::PollDataFunc>(outputPin.data); }),
142 "You cannot mix PollDataFunc and PeekPollDataFunc output pins. Use only PeekPollDataFunc pins if multiple pins are needed.");
157 typename = std::enable_if_t<std::is_base_of_v<Node, T>>>
159 std::shared_ptr<const NAV::NodeData> (T::*pollDataFunc)() = nullptr, int idx = -1)
163 [](
const OutputPin& outputPin) { return std::holds_alternative<OutputPin::PeekPollDataFunc>(outputPin.data)
164 || std::holds_alternative<OutputPin::PollDataFunc>(outputPin.data); }),
165 "There can only be one poll pin if the poll only data function is chosen. If multiple are needed, create PeekPollDataFunc pins.");
226void RegisterWatcherCallbackToInputPin(ax::NodeEditor::PinId
id,
const InputPin::WatcherCallback& callback);
232void RegisterWatcherCallbackToLink(ax::NodeEditor::LinkId
id,
const InputPin::WatcherCallback& callback);
235void ApplyWatcherCallbacks();
239void RegisterPreInitCallback(std::function<
void()> callback);
242void CallPreInitCallback();
246void RegisterCleanupCallback(std::function<
void()> callback);
249void CallCleanupCallback();
252void ClearRegisteredCallbacks();
#define INS_ASSERT_USER_ERROR(_EXP, _MSG)
Assert function with message.
Definition Assert.h:21
void ClearAllNodeQueues()
Clears all nodes queues.
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.
ax::NodeEditor::LinkId GetNextLinkId()
Generates a new link id.
bool showFlowWhenNotifyingValueChange
Flag if notifyOutputValueChanged & notifyInputValueChanged triggers a GUI Flow event.
bool DeleteOutputPin(OutputPin &pin)
Deletes the output pin. Invalidates the pin reference given.
bool DeleteNode(ax::NodeEditor::NodeId nodeId)
Delete the node provided by id.
InputPin * FindInputPin(ax::NodeEditor::PinId id)
Finds the Pin for the PinId.
const std::vector< Node * > & m_Nodes()
List of all registered Nodes.
void InitializeAllNodesAsync()
Initializes all nodes in a separate thread.
void UpdateNode(Node *node)
Update the provided node object.
void AddLink(ax::NodeEditor::LinkId linkId)
Adds the link.
OutputPin * FindOutputPin(ax::NodeEditor::PinId id)
Finds the Pin for the PinId.
Node * FindNode(ax::NodeEditor::NodeId id)
Finds the Node for the NodeId.
void EnableAllCallbacks()
Enables all Node callbacks.
void DisableAllCallbacks()
Disables all Node callbacks.
ax::NodeEditor::NodeId GetNextNodeId()
Generates a new node id.
bool InitializeAllNodes()
Initializes all nodes.
bool DeleteInputPin(InputPin &pin)
Deletes the input pin. Invalidates the pin reference given.
void DeleteAllNodes()
Delete all nodes.
void AddNode(Node *node)
Add the provided node object to the list of nodes.
ax::NodeEditor::PinId GetNextPinId()
Generates a new pin id.
bool showFlowWhenInvokingCallbacks
Flag if invokeCallbacks triggers a GUI Flow event.
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.
The class is responsible for all time-related tasks.
Definition InsTime.hpp:667
Abstract parent class for all nodes.
Definition Node.hpp:86
std::vector< OutputPin > outputPins
List of output pins.
Definition Node.hpp:382
Output pins of nodes.
Definition Pin.hpp:338
std::shared_ptr< const NAV::NodeData >(Node::*)(size_t, bool) PeekPollDataFunc
FileReader/Simulator peekPollData function type for nodes with more than one polling pin.
Definition Pin.hpp:442
std::variant< const void *, const bool *, const int *, const float *, const double *, const std::string *, PeekPollDataFunc, PollDataFunc > PinData
Possible Types represented by an output pin.
Definition Pin.hpp:448
std::shared_ptr< const NAV::NodeData >(Node::*)() PollDataFunc
FileReader/Simulator pollData function type for nodes with a single poll pin.
Definition Pin.hpp:445
Type of the data on the Pin.
Definition Pin.hpp:47
@ Delegate
Reference to the Node object.
Definition Pin.hpp:59
@ Flow
NodeData Trigger.
Definition Pin.hpp:52