MayaFlux 0.2.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 346 of file TopologyGeneratorNode.cpp.

349{
350 size_t valid_connections = std::ranges::count_if(m_connections,
351 [num_points](const auto& conn) {
352 return conn.first < num_points && conn.second < num_points;
353 });
354
355 m_vertices.clear();
356 m_vertices.reserve(valid_connections * 2);
357
358 for (const auto& [a, b] : m_connections) {
359 if (a >= num_points || b >= num_points) {
360 continue;
361 }
362
363 glm::vec3 color_a = m_force_uniform_color ? m_line_color : points[a].color;
364 glm::vec3 color_b = m_force_uniform_color ? m_line_color : points[b].color;
365
366 float thick_a = m_force_uniform_thickness ? m_line_thickness : points[a].thickness;
367 float thick_b = m_force_uniform_thickness ? m_line_thickness : points[b].thickness;
368
369 m_vertices.emplace_back(LineVertex {
370 .position = points[a].position,
371 .color = color_a,
372 .thickness = thick_a });
373
374 m_vertices.emplace_back(LineVertex {
375 .position = points[b].position,
376 .color = color_b,
377 .thickness = thick_b });
378 }
379}
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.

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

Referenced by build_vertex_buffer().

+ Here is the caller graph for this function: