Like remapData, but instead of returning remapped data, return the original id corresponding to each id of the output
| 576 | // Like remapData, but instead of returning remapped data, return the |
| 577 | // original id corresponding to each id of the output |
| 578 | void getDataRemapping( std::vector<int> &dataRemap ) |
| 579 | { |
| 580 | computeIndices(); |
| 581 | dataRemap.resize( m_numIdsUsed ); |
| 582 | for( unsigned int i = 0; i < m_fromOldIds.size(); i++ ) |
| 583 | { |
| 584 | auto &blockPointer = m_fromOldIds[ i ]; |
| 585 | if( blockPointer ) |
| 586 | { |
| 587 | std::vector<int> &block = *blockPointer; |
| 588 | for( int j = 0; j < m_blockSize; j++ ) |
| 589 | { |
| 590 | int newId = block[j]; |
| 591 | if( newId != -1 ) |
| 592 | { |
| 593 | int oldId = i * m_blockSize + j; |
| 594 | dataRemap[ newId ] = oldId; |
| 595 | } |
| 596 | } |
| 597 | } |
| 598 | } |
| 599 | } |
| 600 | |
| 601 | private: |
| 602 |