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

◆ set_vertices()

void MayaFlux::Nodes::Network::PathOperator::set_vertices ( const std::vector< LineVertex > &  vertices)

Replace every control point, in extract_vertices() order, keeping the paths.

Parameters
verticesOne vertex per control point across all paths.

When the count differs from the current total this falls back to initialize().

Definition at line 374 of file PathOperator.cpp.

375{
376 size_t total = 0;
377 for (const auto& path : m_paths) {
378 total += path->get_control_point_count();
379 }
380
381 if (m_paths.empty() || vertices.size() != total) {
382 initialize(vertices);
383 return;
384 }
385
386 uint32_t expected = 0;
387 while (!m_access_token.compare_exchange_weak(expected, 1,
388 std::memory_order_acquire, std::memory_order_relaxed)) {
389 if (m_shutdown.load(std::memory_order_relaxed))
390 return;
391 expected = 0;
392 }
393
394 auto first = vertices.begin();
395 for (auto& path : m_paths) {
396 const auto count = static_cast<std::ptrdiff_t>(path->get_control_point_count());
397 path->set_control_points(std::vector<LineVertex>(first, first + count));
398 path->compute_frame();
399 first += count;
400 }
401
402 m_access_token.store(0, std::memory_order_release);
403}
uint32_t total
size_t count
std::vector< std::shared_ptr< GpuSync::PathGeneratorNode > > m_paths
void initialize()
Definition main.cpp:10

References count, initialize(), m_access_token, m_paths, m_shutdown, and total.

+ Here is the call graph for this function: