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

◆ get_or_create()

std::shared_ptr< FieldOperator > MayaFlux::Nodes::Network::MeshFieldOperator::get_or_create ( MeshSlot slot,
uint32_t  slot_index 
)
private

Return an existing FieldOperator for the slot, or create and initialise one from the slot's current vertex data.

Parameters
slotSlot whose FieldOperator to retrieve or create.
slot_indexSlot index (key into m_field_ops).
Returns
Pointer to the (possibly new) FieldOperator.

Definition at line 13 of file MeshFieldOperator.cpp.

14{
15 auto it = m_field_ops.find(slot_index);
16 if (it != m_field_ops.end())
17 return it->second;
18
19 auto op = std::make_shared<FieldOperator>(FieldMode::ABSOLUTE);
20
21 if (slot.node) {
22 op->initialize(slot.node->get_mesh_vertices());
24 "MeshFieldOperator: initialised FieldOperator for slot {} ({} vertices)",
25 slot_index, slot.node->get_mesh_vertex_count());
26 } else {
28 "MeshFieldOperator: slot {} has no node at bind time -- "
29 "FieldOperator initialised with empty vertex data",
30 slot_index);
31 }
32
33 m_field_ops.emplace(slot_index, op);
34 return op;
35}
#define MF_WARN(comp, ctx,...)
#define MF_DEBUG(comp, ctx,...)
std::unordered_map< uint32_t, std::shared_ptr< FieldOperator > > m_field_ops
@ NodeProcessing
Node graph processing (Nodes::NodeGraphManager)
@ Nodes
DSP Generator and Filter Nodes, graph pipeline, node management.

References MayaFlux::Nodes::Network::ABSOLUTE, m_field_ops, MF_DEBUG, MF_WARN, MayaFlux::Nodes::Network::MeshSlot::node, MayaFlux::Journal::NodeProcessing, and MayaFlux::Journal::Nodes.

Referenced by bind().

+ Here is the caller graph for this function: