MCPcopy Create free account
hub / github.com/ImageEngine/cortex / getDataRemapping

Method getDataRemapping

src/IECoreScene/MeshAlgoSplit.cpp:578–599  ·  view source on GitHub ↗

Like remapData, but instead of returning remapped data, return the original id corresponding to each id of the output

Source from the content-addressed store, hash-verified

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
601private:
602

Callers 1

meshMethod · 0.80

Calls 2

resizeMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected