本文整理汇总了C++中iecore::MurmurHash类的典型用法代码示例。如果您正苦于以下问题:C++ MurmurHash类的具体用法?C++ MurmurHash怎么用?C++ MurmurHash使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了MurmurHash类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: hashParameter
void hashParameter( const Gaffer::Plug *parameter, IECore::MurmurHash &h )
{
const Gaffer::Plug *effectiveParameter = this->effectiveParameter( parameter );
if( !effectiveParameter )
{
return;
}
const Shader *effectiveShader = static_cast<const Shader *>( effectiveParameter->node() );
if( isInputParameter( effectiveParameter ) )
{
effectiveShader->parameterHash( effectiveParameter, h );
hashParameterComponentConnections( parameter, h );
}
else
{
assert( isOutputParameter( effectiveParameter ) );
h.append( shaderHash( effectiveShader ) );
if( effectiveShader->outPlug()->isAncestorOf( effectiveParameter ) )
{
h.append( effectiveParameter->relativeName( effectiveShader->outPlug() ) );
}
return;
}
}
示例2: seedPlug
unsigned long int Random::computeSeed( const Context *context ) const
{
unsigned long int seed = seedPlug()->getValue();
std::string contextEntry = contextEntryPlug()->getValue();
if( contextEntry.size() )
{
const IECore::Data *contextData = 0;
try
{
contextData = context->get<IECore::Data>( contextEntry );
}
catch( ... )
{
}
if( contextData )
{
IECore::MurmurHash hash = contextData->Object::hash();
/// \todo It'd be nice if there was a way of getting the hash folded into an
/// int so we could avoid this jiggery pokery.
std::string s = hash.toString();
seed += boost::hash<std::string>()( s );
}
}
return seed;
}
示例3: effectiveNode
IECore::MurmurHash Shader::NetworkBuilder::shaderHash( const Shader *shaderNode )
{
shaderNode = effectiveNode( shaderNode );
if( !shaderNode )
{
IECore::MurmurHash h;
h.append( Shader::staticTypeId() );
return h;
}
ShaderAndHash &shaderAndHash = m_shaders[shaderNode];
if( shaderAndHash.hash != IECore::MurmurHash() )
{
return shaderAndHash.hash;
}
shaderAndHash.hash.append( shaderNode->typeId() );
shaderNode->namePlug()->hash( shaderAndHash.hash );
shaderNode->typePlug()->hash( shaderAndHash.hash );
parameterHashWalk( shaderNode, shaderNode->parametersPlug(), shaderAndHash.hash );
shaderNode->nodeNamePlug()->hash( shaderAndHash.hash );
shaderNode->nodeColorPlug()->hash( shaderAndHash.hash );
return shaderAndHash.hash;
}
示例4: parameterHash
void Shader::parameterHash( const Gaffer::Plug *parameterPlug, NetworkBuilder &network, IECore::MurmurHash &h ) const
{
const Plug *inputPlug = parameterPlug->source<Plug>();
if( inputPlug != parameterPlug )
{
const Shader *n = IECore::runTimeCast<const Shader>( inputPlug->node() );
if( n && ( inputPlug == n->outPlug() || n->outPlug()->isAncestorOf( inputPlug ) ) )
{
h.append( network.shaderHash( n ) );
if( inputPlug != n->outPlug() )
{
// shader has multiple outputs - we need to make sure the particular
// output in question is taken into account by the hash.
h.append( inputPlug->relativeName( n->outPlug() ) );
}
return;
}
// fall through to hash plug value
}
const ValuePlug *vplug = IECore::runTimeCast<const ValuePlug>( parameterPlug );
if( vplug )
{
vplug->hash( h );
}
else
{
h.append( parameterPlug->typeId() );
}
}
示例5: hashChannelData
void Shape::hashChannelData( const GafferImage::ImagePlug *parent, const Gaffer::Context *context, IECore::MurmurHash &h ) const
{
assert( parent == shapePlug() );
const std::string &channelName = context->get<std::string>( ImagePlug::channelNameContextName );
if( channelName == g_shapeChannelName )
{
// Private channel we use for caching the shape but don't advertise via channelNames.
hashShapeChannelData( context->get<V2i>( ImagePlug::tileOriginContextName ), context, h );
}
else
{
const MurmurHash shapeHash = parent->channelDataHash( g_shapeChannelName, context->get<V2i>( ImagePlug::tileOriginContextName ) );
const float c = channelValue( parent, channelName );
if( c == 1 )
{
h = shapeHash;
}
else
{
ImageProcessor::hashChannelData( parent, context, h );
h.append( shapeHash );
h.append( c );
}
}
}
示例6: objectSamples
AtNode *InstancingConverter::convert( const std::vector<const IECore::Primitive *> &samples, const std::vector<float> &sampleTimes, const IECore::MurmurHash &additionalHash )
{
IECore::MurmurHash h;
for( std::vector<const IECore::Primitive *>::const_iterator it = samples.begin(), eIt = samples.end(); it != eIt; ++it )
{
(*it)->hash( h );
}
h.append( additionalHash );
MemberData::Cache::accessor a;
if( m_data->cache.insert( a, h ) )
{
std::vector<const IECore::Object *> objectSamples( samples.begin(), samples.end() );
a->second = NodeAlgo::convert( objectSamples, sampleTimes );
return a->second;
}
else
{
if( a->second )
{
AtNode *instance = AiNode( "ginstance" );
AiNodeSetPtr( instance, "node", a->second );
return instance;
}
}
return NULL;
}
示例7: hashObject
void AlembicSource::hashObject( const ScenePath &path, const Gaffer::Context *context, const ScenePlug *parent, IECore::MurmurHash &h ) const
{
SceneNode::hashObject( path, context, parent, h );
fileNamePlug()->hash( h );
refreshCountPlug()->hash( h );
h.append( &(path[0]), path.size() );
h.append( context->getTime() );
}
示例8: hash
IECore::MurmurHash Context::hash() const
{
IECore::MurmurHash result;
for( Map::const_iterator it = m_map.begin(), eIt = m_map.end(); it != eIt; it++ )
{
result.append( it->first );
it->second.data->hash( result );
}
return result;
}
示例9: hashProcessedObject
void MapProjection::hashProcessedObject( const ScenePath &path, const Gaffer::Context *context, IECore::MurmurHash &h ) const
{
ScenePath cameraPath;
ScenePlug::stringToPath( cameraPlug()->getValue(), cameraPath );
h.append( inPlug()->objectHash( cameraPath ) );
h.append( inPlug()->transformHash( cameraPath ) );
inPlug()->transformPlug()->hash( h );
uvSetPlug()->hash( h );
}
示例10: hash
void Sampler::hash( IECore::MurmurHash &h ) const
{
for ( int x = m_cacheWindow.min.x; x < m_cacheWindow.max.x; x += GafferImage::ImagePlug::tileSize() )
{
for ( int y = m_cacheWindow.min.y; y < m_cacheWindow.max.y; y += GafferImage::ImagePlug::tileSize() )
{
h.append( m_plug->channelDataHash( m_channelName, Imath::V2i( x, y ) ) );
}
}
h.append( m_boundingMode );
h.append( m_dataWindow );
h.append( m_sampleWindow );
}
示例11: attributesHash
void ArnoldDisplacement::attributesHash( IECore::MurmurHash &h ) const
{
h.append( typeId() );
if( !enabledPlug()->getValue() )
{
return;
}
h.append( mapPlug()->attributesHash() );
heightPlug()->hash( h );
paddingPlug()->hash( h );
zeroValuePlug()->hash( h );
autoBumpPlug()->hash( h );
}
示例12: hashMapping
void BranchCreator::hashMapping( const Gaffer::Context *context, IECore::MurmurHash &h ) const
{
string parentAsString = parentPlug()->getValue();
h.append( parentAsString );
ScenePlug::ScenePath parent;
ScenePlug::stringToPath( parentAsString, parent );
h.append( inPlug()->childNamesHash( parent ) );
MurmurHash branchChildNamesHash;
hashBranchChildNames( parent, ScenePath(), context, branchChildNamesHash );
h.append( branchChildNamesHash );
}
示例13: hashDataWindow
void Reformat::hashDataWindow( const GafferImage::ImagePlug *output, const Gaffer::Context *context, IECore::MurmurHash &h ) const
{
ImageProcessor::hashDataWindow( output, context, h );
Format format = formatPlug()->getValue();
h.append( format.getDisplayWindow() );
h.append( format.getPixelAspect() );
Format inFormat = inPlug()->formatPlug()->getValue();
h.append( inFormat.getDisplayWindow() );
h.append( inFormat.getPixelAspect() );
inPlug()->dataWindowPlug()->hash( h );
}
示例14: hashBranchTransform
void Instancer::hashBranchTransform( const ScenePath &parentPath, const ScenePath &branchPath, const Gaffer::Context *context, IECore::MurmurHash &h ) const
{
ContextPtr ic = instanceContext( context, branchPath );
if( ic )
{
Context::Scope scopedContext( ic );
h = instancePlug()->transformPlug()->hash();
}
if( branchPath.size() == 1 )
{
h.append( inPlug()->objectHash( parentPath ) );
h.append( instanceIndex( branchPath ) );
}
}
示例15: hash
IECore::MurmurHash AtomicFormatPlug::hash() const
{
Format v = getValue();
if( v.getDisplayWindow().isEmpty() )
{
v = FormatPlug::getDefaultFormat( Context::current() );
}
IECore::MurmurHash result;
result.append( v.getDisplayWindow() );
result.append( v.getPixelAspect() );
return result;
return ValuePlug::hash();
}