MayaFlux 0.1.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches
PointCollectionNode.hpp
Go to the documentation of this file.
1#pragma once
2
3#include "PointNode.hpp"
4
6
7/**
8 * @class PointCollectionNode
9 * @brief Unstructured collection of 3D points for visualization
10 *
11 * Pure rendering helper - no relationships between points.
12 * Use for: static data viz, debug markers, reference grids.
13 *
14 * For dynamic/physics-driven points, use ParticleNetwork instead.
15 */
16class MAYAFLUX_API PointCollectionNode : public GeometryWriterNode {
17public:
18 /**
19 * @brief Create empty point source
20 * @param initial_capacity Reserve space for N points
21 */
22 explicit PointCollectionNode(size_t initial_capacity = 1024);
23
24 /**
25 * @brief Create with initial points
26 * @param points Vector of PointVertex
27 */
28 explicit PointCollectionNode(std::vector<PointVertex> points);
29
30 /**
31 * @brief Add a point to the collection
32 * @param position 3D position
33 */
34 // void add_point(const glm::vec3& position, const glm::vec3& color = glm::vec3(1.0f), float size = 5.0f);
35 void add_point(const PointVertex& point);
36
37 /**
38 * @brief Add multiple points
39 * @param positions Vector of positions
40 */
41 void add_points(const std::vector<PointVertex>& points);
42
43 /**
44 * @brief Set all points (replaces existing)
45 * @param positions New positions
46 */
47 void set_points(const std::vector<PointVertex>& points);
48
49 /**
50 * @brief Update specific point position
51 * @param index Point index
52 * @param position New position
53 */
54 void update_point(size_t index, const PointVertex& point);
55
56 /**
57 * @brief Get point position
58 * @param index Point index
59 * @return Position
60 */
61 [[nodiscard]] PointVertex get_point(size_t index) const;
62
63 /**
64 * @brief Get all points
65 * @return Vector of positions
66 */
67 [[nodiscard]] const std::vector<PointVertex>& get_points() const
68 {
69 return m_points;
70 }
71
72 /**
73 * @brief Clear all points
74 */
75 void clear_points();
76
77 /**
78 * @brief Get number of points
79 * @return Point count
80 */
81 [[nodiscard]] size_t get_point_count() const
82 {
83 return m_points.size();
84 }
85
86 /**
87 * @brief Compute frame - uploads positions to vertex buffer
88 */
89 void compute_frame() override;
90
91private:
92 std::vector<PointVertex> m_points;
93};
94
95} // namespace MayaFlux::Nodes
Base class for nodes that generate 3D geometry data.
const std::vector< PointVertex > & get_points() const
Get all points.
size_t get_point_count() const
Get number of points.
Unstructured collection of 3D points for visualization.