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

◆ set_vertices()

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

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

Parameters
verticesOne vertex per point across all topologies.

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

Definition at line 337 of file TopologyOperator.cpp.

338{
339 if (m_topologies.empty() || vertices.size() != get_point_count()) {
340 initialize(vertices);
341 return;
342 }
343
344 uint32_t expected = 0;
345 while (!m_access_token.compare_exchange_weak(expected, 1,
346 std::memory_order_acquire, std::memory_order_relaxed)) {
347 if (m_shutdown.load(std::memory_order_relaxed))
348 return;
349 expected = 0;
350 }
351
352 auto first = vertices.begin();
353 for (auto& topology : m_topologies) {
354 const auto count = static_cast<std::ptrdiff_t>(topology->get_point_count());
355 topology->set_points(std::vector<LineVertex>(first, first + count));
356 topology->compute_frame();
357 first += count;
358 }
359
360 m_access_token.store(0, std::memory_order_release);
361}
PrimitiveTopology topology
size_t count
std::vector< std::shared_ptr< GpuSync::TopologyGeneratorNode > > m_topologies
size_t get_point_count() const override
Get source point count (before topology expansion)
void initialize()
Definition main.cpp:10

References count, get_point_count(), initialize(), m_access_token, m_shutdown, m_topologies, and topology.

+ Here is the call graph for this function: