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

Method computeIndices

src/IECoreScene/MeshAlgoSplit.cpp:603–639  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

601private:
602
603 void computeIndices()
604 {
605 // Once indices have been added, and before using them, this function is called to
606 // compute the new indices.
607 if( m_indicesComputed )
608 {
609 return;
610 }
611
612 m_indicesComputed = true;
613
614 for( unsigned int blockId = 0; blockId < m_fromOldIds.size(); blockId++ )
615 {
616 auto &block = m_fromOldIds[ blockId ];
617 if( !block )
618 {
619 continue;
620 }
621
622 for( int i = 0; i < m_blockSize; i++ )
623 {
624 if( (*block)[i] != -1 )
625 {
626 (*block)[i] = m_numIdsUsed;
627 m_numIdsUsed++;
628 }
629 }
630 }
631
632 for( int &id : m_newIndices )
633 {
634 int blockId = id / m_blockSize;
635 int subIndex = id % m_blockSize;
636
637 id = (*m_fromOldIds[ blockId ])[subIndex];
638 }
639 }
640
641 // IntVectorData to hold the new indices
642 IntVectorDataPtr m_newIndicesData;

Callers

nothing calls this directly

Calls 1

sizeMethod · 0.45

Tested by

no test coverage detected