MayaFlux 0.2.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches
GraphicsOperator.hpp
Go to the documentation of this file.
1#pragma once
2
4#include "NetworkOperator.hpp"
5
7
8/**
9 * @class GraphicsOperator
10 * @brief Operator that produces GPU-renderable geometry
11 *
12 * Adds graphics-specific interface (vertex data, position extraction)
13 * on top of base NetworkOperator. Uses glm::vec3 for positions since
14 * that's the graphics domain standard.
15 */
16class MAYAFLUX_API GraphicsOperator : public NetworkOperator {
17public:
18 /**
19 * @brief Get vertex data for GPU upload
20 */
21 [[nodiscard]] virtual std::span<const uint8_t> get_vertex_data() const = 0;
22
23 /**
24 * @brief Get vertex data for specific collection (if multiple)
25 * @param idx Collection index
26 */
27 [[nodiscard]] virtual std::span<const uint8_t> get_vertex_data_for_collection(uint32_t idx = 0) const = 0;
28
29 /**
30 * @brief Get vertex layout describing vertex structure
31 */
32 [[nodiscard]] virtual Kakshya::VertexLayout get_vertex_layout() const = 0;
33
34 /**
35 * @brief Get number of vertices (may differ from point count for topology/path)
36 */
37 [[nodiscard]] virtual size_t get_vertex_count() const = 0;
38
39 /**
40 * @brief Check if geometry changed this frame
41 */
42 [[nodiscard]] virtual bool is_vertex_data_dirty() const = 0;
43
44 /**
45 * @brief Clear dirty flag after GPU upload
46 */
47 virtual void mark_vertex_data_clean() = 0;
48
49 /**
50 * @brief Get source point count (before topology expansion)
51 */
52 [[nodiscard]] virtual size_t get_point_count() const = 0;
53
54 /**
55 * @brief Apply ONE_TO_ONE parameter mapping
56 *
57 * Default implementation handles common graphics properties:
58 * - "color": Per-point color
59 * - "size": Per-point size (for point rendering)
60 */
61 void apply_one_to_one(
62 std::string_view param,
63 const std::shared_ptr<NodeNetwork>& source) override;
64
65 /**
66 * @brief Get human-readable vertex type name (for validation/debugging)
67 */
68 [[nodiscard]] virtual const char* get_vertex_type_name() const = 0;
69
70protected:
71 /**
72 * @brief Get mutable access to point at global index
73 * @return Pointer to vertex data, or nullptr if index invalid
74 *
75 * Subclasses must implement to provide per-point access
76 */
77 virtual void* get_data_at(size_t global_index) = 0;
78};
79
80} // namespace MayaFlux::Nodes::Network::Operators
virtual void * get_data_at(size_t global_index)=0
Get mutable access to point at global index.
virtual size_t get_point_count() const =0
Get source point count (before topology expansion)
virtual std::span< const uint8_t > get_vertex_data_for_collection(uint32_t idx=0) const =0
Get vertex data for specific collection (if multiple)
virtual size_t get_vertex_count() const =0
Get number of vertices (may differ from point count for topology/path)
virtual Kakshya::VertexLayout get_vertex_layout() const =0
Get vertex layout describing vertex structure.
virtual bool is_vertex_data_dirty() const =0
Check if geometry changed this frame.
virtual std::span< const uint8_t > get_vertex_data() const =0
Get vertex data for GPU upload.
virtual const char * get_vertex_type_name() const =0
Get human-readable vertex type name (for validation/debugging)
virtual void mark_vertex_data_clean()=0
Clear dirty flag after GPU upload.
Operator that produces GPU-renderable geometry.
Domain-agnostic interpretive lens for network processing.
Complete description of vertex data layout in a buffer.