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

Method remapData

src/IECoreScene/MeshAlgoSplit.cpp:553–574  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

551 // and set the values to the corresponding input data.
552 template <typename T >
553 void remapData( const std::vector<T> &in, std::vector<T> &out )
554 {
555 computeIndices();
556 out.resize( m_numIdsUsed );
557 for( unsigned int i = 0; i < m_fromOldIds.size(); i++ )
558 {
559 auto &blockPointer = m_fromOldIds[ i ];
560 if( blockPointer )
561 {
562 std::vector<int> &block = *blockPointer;
563 for( int j = 0; j < m_blockSize; j++ )
564 {
565 int newId = block[j];
566 if( newId != -1 )
567 {
568 int oldId = i * m_blockSize + j;
569 out[ newId ] = in[oldId];
570 }
571 }
572 }
573 }
574 }
575
576 // Like remapData, but instead of returning remapped data, return the
577 // original id corresponding to each id of the output

Callers 1

operator()Method · 0.80

Calls 2

resizeMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected