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

Method hash

src/IECoreScene/SceneCache.cpp:676–765  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

674 }
675
676 void hash( HashType hashType, double time, MurmurHash &h, bool ignoreSceneHash = false ) const
677 {
678 size_t s0, s1;
679 double x;
680
681 h.append( (unsigned char)hashType );
682
683 // all kinds of hashes, except the child names depend on time.
684 switch( hashType )
685 {
686 case TransformHash:
687
688 if ( m_indexedIO->hasEntry( transformEntry ) )
689 {
690 x = transformSampleInterval( time, s0, s1 );
691 h.append( lerp( (double)s0, (double)s1, x ) );
692 }
693 else
694 {
695 // return a simple hash for the identity transform (which does not include the scene location).
696 return;
697 }
698 break;
699
700 case AttributesHash:
701 {
702 NameList attrs;
703 attributeNames( attrs );
704 if ( !attrs.size() )
705 {
706 // return a simple hash for no attributes (which does not include the scene location).
707 return;
708 }
709 for ( NameList::const_iterator aIt = attrs.begin(); aIt != attrs.end(); aIt++ )
710 {
711 x = attributeSampleInterval( *aIt, time, s0, s1 );
712 h.append( lerp( (double)s0, (double)s1, x ) );
713 }
714 }
715 break;
716
717 case BoundHash:
718
719 x = boundSampleInterval( time, s0, s1 );
720 h.append( lerp( (double)s0, (double)s1, x ) );
721 break;
722
723 case ObjectHash:
724
725 if ( m_indexedIO->hasEntry( objectEntry ) )
726 {
727 x = objectSampleInterval( time, s0, s1 );
728 h.append( lerp( (double)s0, (double)s1, x ) );
729 }
730 else
731 {
732 // return a simple hash for no object (which does not include the scene location).
733 return;

Callers

nothing calls this directly

Calls 12

transformSampleIntervalFunction · 0.85
attributeSampleIntervalFunction · 0.85
boundSampleIntervalFunction · 0.85
objectSampleIntervalFunction · 0.85
sceneHashFunction · 0.85
appendMethod · 0.80
hasEntryMethod · 0.80
attributeNamesFunction · 0.50
hashFunction · 0.50
sizeMethod · 0.45
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected