MayaFlux 0.1.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches
MayaFlux::Buffers::NetworkGeometryProcessor Class Reference

BufferProcessor that aggregates geometry from NodeNetwork nodes. More...

#include <NetworkGeometryProcessor.hpp>

+ Inheritance diagram for MayaFlux::Buffers::NetworkGeometryProcessor:
+ Collaboration diagram for MayaFlux::Buffers::NetworkGeometryProcessor:

Classes

struct  NetworkBinding
 Structure representing a network geometry binding. More...
 

Public Member Functions

 NetworkGeometryProcessor ()
 
void bind_network (const std::string &name, const std::shared_ptr< Nodes::NodeNetwork > &network, const std::shared_ptr< VKBuffer > &vertex_buffer)
 Bind a network to a GPU vertex buffer.
 
void unbind_network (const std::string &name)
 Remove a network binding.
 
bool has_binding (const std::string &name) const
 Check if a binding exists.
 
std::vector< std::string > get_binding_names () const
 Get all binding names.
 
size_t get_binding_count () const
 Get number of active bindings.
 
std::optional< NetworkBindingget_binding (const std::string &name) const
 Get a specific binding.
 
void processing_function (std::shared_ptr< Buffer > buffer) override
 BufferProcessor interface - aggregates and uploads network geometry.
 
- Public Member Functions inherited from MayaFlux::Buffers::BufferProcessor
virtual ~BufferProcessor ()=default
 Virtual destructor for proper cleanup of derived classes.
 
void process (std::shared_ptr< Buffer > buffer)
 Applies a computational transformation to the data in the provided buffer.
 
virtual void on_attach (std::shared_ptr< Buffer >)
 Called when this processor is attached to a buffer.
 
virtual void on_detach (std::shared_ptr< Buffer >)
 Called when this processor is detached from a buffer.
 
virtual void set_processing_token (ProcessingToken token)
 Gets the preferred processing backend for this processor.
 
virtual ProcessingToken get_processing_token () const
 Gets the current processing token for this buffer.
 
virtual bool is_compatible_with (std::shared_ptr< Buffer >) const
 Checks if this processor can handle the specified buffer type.
 

Private Member Functions

std::vector< Nodes::GpuSync::PointVertexextract_particle_vertices (const std::shared_ptr< Nodes::ParticleNetwork > &network)
 Extract vertices from ParticleNetwork.
 
std::vector< Nodes::GpuSync::PointVertexextract_network_vertices (const std::shared_ptr< Nodes::NodeNetwork > &network)
 Extract vertices from generic NodeNetwork (fallback)
 

Private Attributes

std::unordered_map< std::string, NetworkBindingm_bindings
 

Additional Inherited Members

- Protected Member Functions inherited from MayaFlux::Buffers::VKBufferProcessor
void initialize_buffer_service ()
 
void initialize_compute_service ()
 
- Protected Attributes inherited from MayaFlux::Buffers::VKBufferProcessor
Registry::Service::BufferServicem_buffer_service = nullptr
 
Registry::Service::ComputeServicem_compute_service = nullptr
 
- Protected Attributes inherited from MayaFlux::Buffers::BufferProcessor
ProcessingToken m_processing_token { ProcessingToken::AUDIO_BACKEND }
 

Detailed Description

BufferProcessor that aggregates geometry from NodeNetwork nodes.

Extracts geometry from all nodes within a network and uploads to GPU as a single vertex buffer. Handles network-specific patterns like ParticleNetwork (many PointNodes) and PointCloudNetwork.

Key Differences from GeometryBindingsProcessor:

  • Operates on NodeNetwork (not single GeometryWriterNode)
  • Aggregates vertices from ALL internal nodes
  • Type-aware: special handling for ParticleNetwork, PointCloudNetwork, etc.

Behavior:

  • Extracts ALL node geometry from bound networks
  • Aggregates into single vertex buffer
  • Uses staging buffer for device-local targets
  • Supports multiple network bindings (different networks → different buffers)

Usage:

auto particles = std::make_shared<ParticleNetwork>(1000);
auto vertex_buffer = std::make_shared<VKBuffer>(...);
auto processor = std::make_shared<NetworkGeometryProcessor>();
processor->bind_network("particles", particles, vertex_buffer);
vertex_buffer->set_default_processor(processor);
vertex_buffer->process_default(); // Aggregates all 1000 PointNodes → GPU

Definition at line 44 of file NetworkGeometryProcessor.hpp.


The documentation for this class was generated from the following files: