MayaFlux 1.0.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches
MayaFlux::Nodes::Network::AssemblyOperator Class Reference

Holds an unordered set of independent geometry items, rendered as one milled draw. More...

#include <AssemblyOperator.hpp>

Inheritance diagram for MayaFlux::Nodes::Network::AssemblyOperator:
Collaboration diagram for MayaFlux::Nodes::Network::AssemblyOperator:

Public Member Functions

std::shared_ptr< GpuSync::MeshWriterNode > add_geometry (const Kakshya::MeshData &mesh)
 Add an indexed triangle mesh. Topology is fixed TRIANGLE_LIST.
void add_geometry (std::shared_ptr< GpuSync::GeometryWriterNode > node)
 Add a caller-built node directly; its own topology is used as-is.
std::shared_ptr< GpuSync::GeometryLeafNode > add_geometry (std::vector< glm::vec3 > positions, Portal::Graphics::PrimitiveTopology topology=Portal::Graphics::PrimitiveTopology::POINT_LIST)
 Add an item from plain positions (color/scalar/normal/uv default).
std::shared_ptr< GpuSync::GeometryLeafNode > add_geometry (std::vector< Kakshya::Vertex > vertices, Portal::Graphics::PrimitiveTopology topology=Portal::Graphics::PrimitiveTopology::POINT_LIST)
 Add an item from fully specified vertices.
 AssemblyOperator ()=default
std::vector< uint32_t > build_cluster_ids () const override
 One cluster id per item; coincides with get_vertex_count() since items carry no interpolation step of their own.
std::optional< Portal::Graphics::PrimitiveTopology > declared_topology () const override
 Forwards to the first item's own get_primitive_topology().
std::vector< DirtyVertexRange > dirty_vertex_ranges () const override
 One DirtyVertexRange per item that needs a GPU update, in add_geometry() order, matching get_vertex_data().
size_t get_point_count () const override
 Get source point count (before topology expansion).
std::string_view get_type_name () const override
 Type name for introspection.
size_t get_vertex_count () const override
 Get number of vertices (may differ from point count for topology/path).
std::span< const uint8_t > get_vertex_data () const override
 Get vertex data for GPU upload.
std::span< const uint8_t > get_vertex_data_for_collection (uint32_t idx) const override
 Get vertex data for specific collection (if multiple).
Kakshya::VertexLayout get_vertex_layout () const override
 The universal Kakshya::Vertex attribute layout, vertex_count 0 when there are no items yet.
const char * get_vertex_type_name () const override
 Get human-readable vertex type name (for validation/debugging).
bool is_vertex_data_dirty () const override
 Check if geometry changed this frame.
size_t item_count () const
void mark_vertex_data_clean () override
 Clear dirty flag after GPU upload.
void process (float dt) override
 Process for one batch cycle.
std::optional< double > query_state (std::string_view query) const override
 Query operator internal state.
bool remove_geometry (const std::shared_ptr< GpuSync::GeometryWriterNode > &node)
 Remove an item by identity.
void set_parameter (std::string_view param, double value) override
 Set operator parameter.
bool supports_incremental_upload () const override
 Whether every vertex mutation on this operator sets a group's dirty flag, so dirty_vertex_ranges() is the complete record of what changed since the last mark_vertex_data_clean().
std::vector< DrawRun > topology_runs () const override
 Coalesces adjacent items sharing a concatenable topology into one run; strip/fan items are always reported separately.
Public Member Functions inherited from MayaFlux::Nodes::Network::GraphicsOperator
void apply_one_to_one (std::string_view param, const std::shared_ptr< NodeNetwork > &source) override
 Apply ONE_TO_ONE parameter mapping.
bool consumes_upstream () const
 Whether this operator requests upstream vertex state before process().
virtual std::vector< std::pair< std::string, Kakshya::DataVariant > > extract_vertex_attributes () const
 Extra named, per-vertex attributes beyond position/color/size, for an external cache/export consumer.
virtual std::vector< glm::vec3 > extract_vertex_velocities () const
 Per-vertex velocity, for a consumer that wants to write it as a native channel (e.g.
bool participates_in_rendering () const
 Whether this operator contributes a vertex slice to rendering.
virtual void seed_from_upstream (const GraphicsOperator *upstream)
 Receive upstream vertex state before process() is called.
void set_consumes_upstream (bool value)
void set_force_internal_dt (bool value)
 Override the dt passed by the caller with a fixed internal value.
void set_participates_in_rendering (bool value)
bool uses_force_internal_dt () const
Public Member Functions inherited from MayaFlux::Nodes::Network::NetworkOperator
virtual void apply_mapped_one_to_one (ParameterKey key, const std::shared_ptr< NodeNetwork > &source)
 Apply a cached per-element key, delegating to apply_one_to_one by default.
virtual bool demands_full_vertex_restore () const
 Whether a downstream compute pass writes the network's vertex buffer in place each cycle, so the geometry producer must keep restoring the CPU-authoritative vertex data every frame.
template<typename Self>
Self::Controls get (this const Self &self)
 The controls with the values the operator holds now.
template<typename Self>
void set (this Self &self, const typename Self::Controls &incoming)
 Apply the members of this operator's Controls struct that hold a value.
virtual void set_mapped_parameter (ParameterKey key, double value)
 Apply a cached mapping key, delegating to set_parameter by default.
virtual ~NetworkOperator ()=default

Protected Member Functions

void * get_data_at (size_t global_index) override
 Get mutable access to point at global index.
Protected Member Functions inherited from MayaFlux::Nodes::Network::GraphicsOperator
void apply_point_control (Control &control, PointAttribute attribute)
 Write a control into every point's color or size when it is due.
Protected Member Functions inherited from MayaFlux::Nodes::Network::NetworkOperator
template<typename C>
C & declare_controls ()
 Create the operator's controls struct and keep it alive.
template<typename C>
void merge_controls (const C &incoming)
 Apply the members of incoming that hold a value, for an operator whose controls type is not fixed.
void refresh_controls ()
 Read node sources into their controls.
bool set_named_control (std::string_view name, double value)
 Sets the control called name, the way set() would.
bool settle_named_control (std::string_view name)
 Drops the pending typed value of the control called name.
template<typename C>
C snapshot_controls () const
 A copy of the declared struct, for an operator whose controls type is not fixed.

Private Attributes

std::vector< std::shared_ptr< GpuSync::GeometryWriterNode > > m_items
std::vector< uint8_t > m_vertex_data_aggregate

Additional Inherited Members

Public Types inherited from MayaFlux::Nodes::Network::GraphicsOperator
enum class  PointAttribute : uint8_t { COLOR , SIZE }
 A per-point attribute that apply_point_control writes. More...
Protected Attributes inherited from MayaFlux::Nodes::Network::GraphicsOperator
bool m_consumes_upstream {}
bool m_force_internal_dt {}
bool m_participates_in_rendering { true }

Detailed Description

Holds an unordered set of independent geometry items, rendered as one milled draw.

Not a specialized operator: unlike PathOperator/TopologyOperator/ PhysicsOperator, it interpolates, connects, or simulates nothing between items. Items are stored in a plain std::vector<shared_ptr<GeometryWriterNode>> in insertion order, not behind a handle: the shared_ptr each add_geometry() overload returns is itself the caller's access token for later mutation or removal, the same idiom PathOperator::add_node() already uses for a single path. Removal is a pointer-identity scan; if that becomes a hot per-frame path for thousands of items, revisit the storage, not the access API.

apply_one_to_one() is a documented no-op here (get_data_at() always returns nullptr): unrelated items added and removed independently have no positional correspondence for a ONE_TO_ONE per-index mapping to land on.

Definition at line 29 of file AssemblyOperator.hpp.


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