MCPcopy Create free account
hub / github.com/Kitware/VTK / GenerateSortIndices

Method GenerateSortIndices

Common/Core/vtkSortDataArray.cxx:230–253  ·  view source on GitHub ↗

------------------------------------------------------------------------------ Function for generating sort ordering for general arrays.

Source from the content-addressed store, hash-verified

228//------------------------------------------------------------------------------
229// Function for generating sort ordering for general arrays.
230void vtkSortDataArray::GenerateSortIndices(
231 int dataType, void* dataIn, vtkIdType numKeys, int numComp, int k, vtkIdType* idx)
232{
233 // Specialized and faster for single component arrays
234 if (numComp == 1)
235 {
236 vtkSortDataArray::GenerateSort1Indices(dataType, dataIn, numKeys, idx);
237 return;
238 }
239
240 if (dataType == VTK_VARIANT)
241 {
242 vtkSMPTools::Sort(
243 idx, idx + numKeys, TupleComp<vtkVariant>(static_cast<vtkVariant*>(dataIn), numComp, k));
244 }
245 else
246 {
247 switch (dataType)
248 {
249 vtkExtendedTemplateMacro(vtkSMPTools::Sort(
250 idx, idx + numKeys, TupleComp<VTK_TT>(static_cast<VTK_TT*>(dataIn), numComp, k)));
251 }
252 }
253}
254
255//------------------------------------------------------------------------------
256// Set up the actual templated shuffling operation. This method is for

Callers

nothing calls this directly

Calls 1

SortFunction · 0.70

Tested by

no test coverage detected