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

◆ add_geometry()

void MayaFlux::Buffers::CompositeGeometryProcessor::add_geometry ( const std::string &  name,
const std::shared_ptr< Nodes::GpuSync::GeometryWriterNode > &  node,
Portal::Graphics::PrimitiveTopology  topology 
)

Add a geometry collection.

Parameters
nameUnique identifier for this collection
nodeGeometryWriterNode to aggregate
topologyPrimitive topology for rendering this collection

Definition at line 17 of file CompositeGeometryProcessor.cpp.

21{
22 if (!node) {
23 error<std::invalid_argument>(
26 std::source_location::current(),
27 "Cannot add null geometry node '{}'", name);
28 }
29
30 auto it = std::ranges::find_if(m_collections,
31 [&name](const auto& c) { return c.name == name; });
32
33 if (it != m_collections.end()) {
35 "Collection '{}' already exists, replacing", name);
36 it->node = node;
37 it->topology = topology;
38 it->vertex_layout.reset();
39 return;
40 }
41
42 m_collections.push_back(GeometryCollection {
43 .name = name,
44 .node = node,
45 .topology = topology,
46 .vertex_offset = 0,
47 .vertex_count = 0 });
48
50 "Added geometry collection '{}' with topology {}",
51 name, static_cast<int>(topology));
52}
#define MF_WARN(comp, ctx,...)
#define MF_DEBUG(comp, ctx,...)
@ BufferProcessing
Buffer processing (Buffers::BufferManager, processing chains)
@ Buffers
Buffers, Managers, processors and processing chains.

References MayaFlux::Journal::BufferProcessing, MayaFlux::Journal::Buffers, m_collections, MF_DEBUG, MF_WARN, and MayaFlux::Buffers::CompositeGeometryProcessor::GeometryCollection::name.