Returns a list of face offsets and counts based on the input attributes id array.

std::vector<std::pair<size_t,size_t>> ComputeSubsets(
   _In_reads_opt_(nFaces) const uint32_t* attributes, _In_ size_t nFaces );

Return values

The result is a std::vector of value pairs (as a std::pair<size_t,size_t>) where each first value is the offset in the faces array for the start of the attribute subset, and second is the number of faces in that attribute subset.

Remark

For a sorted attribute array, it returns a minimum length list of subsets which covers all faces.

Example

uint32_t cubeAttributes[ 12 ] = { 0, 0, 1, 1, 2, 2, 3, 3, 3, 3, 5, 5 };

auto subsets = ComputeSubsets( cubeAttributes, 12 );

// subsets contains 5 pairs: <0, 2>, <2, 2>, <4, 2>, <6, 4>, <10, 2>

Last edited Jun 26, 2014 at 9:49 PM by walbourn, version 3