MayaFlux 0.4.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches

◆ add_node()

void MayaFlux::Nodes::Network::PathOperator::add_node ( std::shared_ptr< GpuSync::PathGeneratorNode node)

Add an externally constructed PathGeneratorNode subtype to the operator.

Accepts any PathGeneratorNode subclass (e.g. LineSegmentNode) that was constructed and configured by the caller. The node is appended to m_paths and will participate in process(), get_vertex_data(), and extract_vertices() identically to nodes created by add_path().

compute_frame() is called once before insertion so the node's vertex buffer is populated on the first frame.

Parameters
nodeNon-null shared_ptr to a PathGeneratorNode or subclass.

Definition at line 95 of file PathOperator.cpp.

96{
97 if (!node) {
99 "PathOperator::add_node: null node ignored");
100 return;
101 }
102
103 node->compute_frame();
104
105 uint32_t expected = 0;
106 while (!m_access_token.compare_exchange_weak(expected, 1,
107 std::memory_order_acquire, std::memory_order_relaxed)) {
108 if (m_shutdown.load(std::memory_order_relaxed))
109 return;
110 expected = 0;
111 }
112
113 m_paths.push_back(std::move(node));
114
115 m_access_token.store(0, std::memory_order_release);
116
118 "PathOperator: added node #{} ({} vertices)",
119 m_paths.size(), m_paths.back()->get_vertex_count());
120}
#define MF_ERROR(comp, ctx,...)
#define MF_DEBUG(comp, ctx,...)
std::vector< std::shared_ptr< GpuSync::PathGeneratorNode > > m_paths
@ NodeProcessing
Node graph processing (Nodes::NodeGraphManager)
@ Nodes
DSP Generator and Filter Nodes, graph pipeline, node management.

References m_access_token, m_paths, m_shutdown, MF_DEBUG, MF_ERROR, MayaFlux::Journal::NodeProcessing, and MayaFlux::Journal::Nodes.