13 layout.vertex_count = initial_capacity;
19 "Created LineSegmentsNode with capacity {}", initial_capacity);
53 const std::vector<LineVertex>& path_vertices,
61 const std::vector<LineVertex>& path_vertices,
69 const std::vector<LineVertex>& path_vertices,
91#ifdef MAYAFLUX_PLATFORM_MACOS
92 std::vector<LineVertex> expanded = expand_lines_to_triangles(
m_segments);
93 set_vertices<LineVertex>(std::span { expanded.data(), expanded.size() });
96 layout->vertex_count =
static_cast<uint32_t
>(expanded.size());
102 layout->vertex_count =
static_cast<uint32_t
>(
m_segments.size());
#define MF_DEBUG(comp, ctx,...)
bool m_vertex_data_dirty
Flag: vertex data or layout changed since last GPU upload.
std::optional< Kakshya::VertexLayout > get_vertex_layout() const
Get cached vertex layout.
void set_vertex_layout(const Kakshya::VertexLayout &layout)
Set cached vertex layout.
void resize_vertex_buffer(uint32_t vertex_count, bool preserve_data=false)
Resize vertex buffer to hold specified number of vertices.
void clear_segments()
Remove all accumulated segments and reset the vertex buffer.
void add_normal(const std::vector< LineVertex > &path_vertices, float length, size_t stride=1)
Append normal segments derived from a vertex path.
void add_line(const LineVertex &a, const LineVertex &b)
Add a segment between two vertices.
void compute_frame() override
Pack accumulated segments into the GPU vertex buffer.
void append_pairs(const std::vector< LineVertex > &pairs)
void add_axis(const LineVertex &origin, const glm::vec3 &direction, float length)
Add a directed axis segment originating from a point.
void add_curvature(const std::vector< LineVertex > &path_vertices, float scale, size_t stride=1)
Append curvature segments derived from a vertex path.
LineSegmentsNode(size_t initial_capacity=256)
Construct an empty segment accumulator.
std::vector< LineVertex > m_segments
void add_tangent(const std::vector< LineVertex > &path_vertices, float length, size_t stride=1)
Append tangent segments derived from a vertex path.
Generates dense vertex paths from sparse control points or freehand drawing.
@ NodeProcessing
Node graph processing (Nodes::NodeGraphManager)
@ Nodes
DSP Generator and Filter Nodes, graph pipeline, node management.
std::vector< Kakshya::LineVertex > compute_path_tangents(const std::vector< Kakshya::LineVertex > &path_vertices, float tangent_length, size_t stride)
Compute tangent vectors along a piecewise-linear path.
std::vector< Kakshya::LineVertex > compute_path_curvature(const std::vector< Kakshya::LineVertex > &path_vertices, float curvature_scale, size_t stride)
Compute curvature vectors along a path (2nd derivative approximation)
std::vector< Kakshya::LineVertex > compute_path_normals(const std::vector< Kakshya::LineVertex > &path_vertices, float normal_length, size_t stride)
Compute normal vectors along a piecewise-linear path.
Vertex type for line primitives (LINE_LIST / LINE_STRIP topology)
static VertexLayout for_lines(uint32_t stride=60)
Factory: layout for LineVertex (position, color, thickness, uv, normal, tangent)