MayaFlux 0.5.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches

◆ regenerate_segment_range()

void MayaFlux::Nodes::GpuSync::PathGeneratorNode::regenerate_segment_range ( size_t  start_ctrl_idx,
size_t  end_ctrl_idx 
)
private

Definition at line 511 of file PathGeneratorNode.cpp.

512{
513 const size_t num_points = m_control_points.size();
514
515 if (start_ctrl_idx >= num_points || end_ctrl_idx >= num_points) {
517 "Invalid segment range [{}, {}] for {} control points",
518 start_ctrl_idx, end_ctrl_idx, num_points);
519 return;
520 }
521
522 m_range_cache.clear();
523 m_range_cache.reserve(end_ctrl_idx - start_ctrl_idx + 1);
524 for (size_t i = start_ctrl_idx; i <= end_ctrl_idx; ++i) {
525 m_range_cache.push_back(m_control_points[i]);
526 }
527
528 if (m_range_cache.size() < 4) {
529 return;
530 }
531
532 const size_t per_window = vertices_per_window();
533 const size_t windows = m_range_cache.size() - 3;
534 const size_t start_vertex_idx = start_ctrl_idx * per_window;
535
536 if (start_vertex_idx + windows * per_window > m_vertices.size()) {
537 m_vertices.resize(start_vertex_idx + windows * per_window);
538 }
539
540 for (size_t w = 0; w < windows; ++w) {
542 m_vertices.data() + start_vertex_idx + w * per_window);
543 }
544}
#define MF_ERROR(comp, ctx,...)
size_t start_vertex_idx
size_t vertices_per_window() const
Vertices emitted per four-point window.
void write_curve_segment(const std::vector< LineVertex > &curve_verts, size_t start_idx, LineVertex *dst)
Evaluate one window and write its vertices.
std::vector< LineVertex > m_control_points
Control points, newest first: index 0 is the most recently added.
@ NodeProcessing
Node graph processing (Nodes::NodeGraphManager)
@ Nodes
DSP Generator and Filter Nodes, graph pipeline, node management.

References m_control_points, m_range_cache, m_vertices, MF_ERROR, MayaFlux::Journal::NodeProcessing, MayaFlux::Journal::Nodes, start_vertex_idx, vertices_per_window(), and write_curve_segment().

Referenced by regenerate_geometry().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: