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

◆ build_cluster_ids()

std::vector< uint32_t > MayaFlux::Nodes::Network::AssemblyOperator::build_cluster_ids ( ) const
overridevirtual

One cluster id per item; coincides with get_vertex_count() since items carry no interpolation step of their own.

Reimplemented from MayaFlux::Nodes::Network::GraphicsOperator.

Definition at line 150 of file AssemblyOperator.cpp.

151{
152 std::vector<uint32_t> ids(get_vertex_count(), 0U);
153
154 if (m_items.size() <= 1) {
155 return ids;
156 }
157
158 size_t offset = 0;
159 uint32_t cluster = 0;
160 for (const auto& item : m_items) {
161 const size_t count = item->get_vertex_count();
162 for (size_t i = 0; i < count && offset + i < ids.size(); ++i) {
163 ids[offset + i] = cluster;
164 }
165 offset += count;
166 ++cluster;
167 }
168
169 return ids;
170}
size_t count
float offset
std::vector< std::shared_ptr< GpuSync::GeometryWriterNode > > m_items
size_t get_vertex_count() const override
Get number of vertices (may differ from point count for topology/path)

References count, get_vertex_count(), m_items, and offset.

+ Here is the call graph for this function: