------------------------------------------------------------------------------ Function for generating sort ordering for general arrays.
| 228 | //------------------------------------------------------------------------------ |
| 229 | // Function for generating sort ordering for general arrays. |
| 230 | void 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 |