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

◆ build_direct_connections()

void MayaFlux::Nodes::GpuSync::TopologyGeneratorNode::build_direct_connections ( std::span< LineVertex points,
size_t  num_points 
)
private

Definition at line 440 of file TopologyGeneratorNode.cpp.

443{
444 size_t valid_connections = std::ranges::count_if(m_connections,
445 [num_points](const auto& conn) {
446 return conn.first < num_points && conn.second < num_points;
447 });
448
449 m_vertices.clear();
450 m_vertices.reserve(valid_connections * 2);
451
452 for (const auto& [a, b] : m_connections) {
453 if (a >= num_points || b >= num_points) {
454 continue;
455 }
456
457 glm::vec3 color_a = m_force_uniform_color ? m_line_color : points[a].color;
458 glm::vec3 color_b = m_force_uniform_color ? m_line_color : points[b].color;
459
460 float thick_a = m_force_uniform_thickness ? m_line_thickness : points[a].thickness;
461 float thick_b = m_force_uniform_thickness ? m_line_thickness : points[b].thickness;
462
463 m_vertices.emplace_back(LineVertex {
464 .position = points[a].position,
465 .color = color_a,
466 .thickness = thick_a });
467
468 m_vertices.emplace_back(LineVertex {
469 .position = points[b].position,
470 .color = color_b,
471 .thickness = thick_b });
472 }
473}
std::vector< glm::vec2 > * points
size_t a
size_t b
std::vector< std::pair< size_t, size_t > > m_connections
bool m_force_uniform_color
If true, all vertices use m_line_color instead of per-vertex color.
bool m_force_uniform_thickness
If true, all vertices use m_line_thickness instead of per-vertex thickness.
Kakshya::LineVertex LineVertex
Definition VertexSpec.hpp:8

References a, b, m_connections, m_force_uniform_color, m_force_uniform_thickness, m_line_color, m_line_thickness, m_vertices, points, and MayaFlux::Kakshya::LineVertex::position.

Referenced by build_vertex_buffer(), and refresh_attributes().

+ Here is the caller graph for this function: