本文整理汇总了C++中iecore::InternedString::string方法的典型用法代码示例。如果您正苦于以下问题:C++ InternedString::string方法的具体用法?C++ InternedString::string怎么用?C++ InternedString::string使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类iecore::InternedString
的用法示例。
在下文中一共展示了InternedString::string方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
void Shader::NetworkBuilder::parameterValueWalk( const Shader *shaderNode, const Gaffer::Plug *parameterPlug, const IECore::InternedString ¶meterName, IECore::CompoundDataMap &values )
{
for( InputPlugIterator it( parameterPlug ); it != it.end(); ++it )
{
IECore::InternedString childParameterName;
if( parameterName.string().size() )
{
childParameterName = parameterName.string() + "." + (*it)->getName().string();
}
else
{
childParameterName = (*it)->getName();
}
if( (*it)->typeId() == CompoundPlug::staticTypeId() )
{
parameterValueWalk( shaderNode, it->get(), childParameterName, values );
}
else
{
if( IECore::DataPtr value = shaderNode->parameterValue( it->get(), *this ) )
{
values[childParameterName] = value;
}
}
}
}
示例2: addParameterWalk
void addParameterWalk( const Gaffer::Plug *parameter, const IECore::InternedString ¶meterName, IECoreScene::Shader *shader, vector<IECoreScene::ShaderNetwork::Connection> &connections )
{
if( !isLeafParameter( parameter ) || parameter->parent<Node>() )
{
// Compound parameter - recurse
for( InputPlugIterator it( parameter ); !it.done(); ++it )
{
IECore::InternedString childParameterName;
if( parameterName.string().size() )
{
childParameterName = parameterName.string() + "." + (*it)->getName().string();
}
else
{
childParameterName = (*it)->getName();
}
addParameterWalk( it->get(), childParameterName, shader, connections );
}
}
else if( const Gaffer::ArrayPlug *array = IECore::runTimeCast<const Gaffer::ArrayPlug>( parameter ) )
{
int i = 0;
for( InputPlugIterator it( array ); !it.done(); ++it, ++i )
{
IECore::InternedString childParameterName = parameterName.string() + "[" + std::to_string( i ) + "]";
addParameter( it->get(), childParameterName, shader, connections );
}
}
else
{
addParameter( parameter, parameterName, shader, connections );
}
}
示例3: checkName
void Path::checkName( const IECore::InternedString &name ) const
{
if( name.string().find( '/' ) != string::npos )
{
throw IECore::Exception( "Path name contains '/'." );
}
if( name.string().empty() )
{
throw IECore::Exception( "Path name is empty." );
}
}
示例4: nodeMetadataChanged
void NoduleLayout::nodeMetadataChanged( IECore::TypeId nodeTypeId, IECore::InternedString key, const Gaffer::Node *node )
{
const Node *typedParent = runTimeCast<const Node>( m_parent.get() );
if( !typedParent || !affectedByChange( typedParent, nodeTypeId, node ) )
{
return;
}
if( affectsSpacing( key, m_section ) )
{
updateSpacing();
}
if( affectsDirection( key, m_section ) )
{
updateDirection();
}
if( affectsOrientation( key, m_section ) )
{
updateOrientation();
}
if( boost::starts_with( key.string(), "noduleLayout:customGadget" ) )
{
updateLayout();
}
}
示例5: addParameterComponentConnections
void addParameterComponentConnections( const Gaffer::Plug *parameter, const IECore::InternedString ¶meterName, vector<IECoreScene::ShaderNetwork::Connection> &connections )
{
if( !isCompoundNumericPlug( parameter ) )
{
return;
}
for( InputPlugIterator it( parameter ); !it.done(); ++it )
{
const Gaffer::Plug *effectiveParameter = this->effectiveParameter( it->get() );
if( effectiveParameter && isOutputParameter( effectiveParameter ) )
{
const Shader *effectiveShader = static_cast<const Shader *>( effectiveParameter->node() );
IECore::InternedString outputName;
if( effectiveShader->outPlug()->isAncestorOf( effectiveParameter ) )
{
outputName = effectiveParameter->relativeName( effectiveShader->outPlug() );
}
IECore::InternedString inputName = parameterName.string() + "." + (*it)->getName().string();
connections.push_back( {
{ this->handle( effectiveShader ), outputName },
{ IECore::InternedString(), inputName }
} );
}
}
}
示例6: contextChanged
void CameraTool::contextChanged( const IECore::InternedString &name )
{
if( !boost::starts_with( name.string(), "ui:" ) )
{
m_cameraSelectionDirty = true;
view()->viewportGadget()->renderRequestSignal()( view()->viewportGadget() );
}
}
示例7: contextChanged
void ImageGadget::contextChanged( const IECore::InternedString &name )
{
if( !boost::starts_with( name.string(), "ui:" ) )
{
m_dirtyFlags = AllDirty;
requestRender();
}
}
示例8: computeSetNames
IECore::ConstInternedStringVectorDataPtr ObjectSource::computeSetNames( const Gaffer::Context *context, const ScenePlug *parent ) const
{
IECore::InternedStringVectorDataPtr result = new IECore::InternedStringVectorData;
Gaffer::tokenize( setsPlug()->getValue(), ' ', result->writable() );
IECore::InternedString n = standardSetName();
if( n.string().size() )
{
result->writable().push_back( n );
}
return result;
}
示例9: hashSet
void Set::hashSet( const IECore::InternedString &setName, const Gaffer::Context *context, const ScenePlug *parent, IECore::MurmurHash &h ) const
{
const std::string allSets = " " + namePlug()->getValue() + " ";
const std::string setNameToFind = " " + setName.string() + " ";
if( allSets.find( setNameToFind ) == std::string::npos )
{
h = inPlug()->setPlug()->hash();
return;
}
FilteredSceneProcessor::hashSet( setName, context, parent, h );
inPlug()->setPlug()->hash( h );
modePlug()->hash( h );
pathMatcherPlug()->hash( h );
}
示例10: ScenePlug
InteractiveRender::InteractiveRender( const IECore::InternedString &rendererType, const std::string &name )
: Node( name ),
m_state( Stopped )
{
storeIndexOfNextChild( g_firstPlugIndex );
addChild( new ScenePlug( "in" ) );
addChild( new StringPlug( rendererType.string().empty() ? "renderer" : "__renderer", Plug::In, rendererType.string() ) );
addChild( new IntPlug( "state", Plug::In, Stopped, Stopped, Paused, Plug::Default & ~Plug::Serialisable ) );
addChild( new ScenePlug( "out", Plug::Out, Plug::Default & ~Plug::Serialisable ) );
addChild( new ScenePlug( "__adaptedIn", Plug::In, Plug::Default & ~Plug::Serialisable ) );
SceneProcessorPtr adaptors = RendererAlgo::createAdaptors();
setChild( "__adaptors", adaptors );
adaptors->inPlug()->setInput( inPlug() );
adaptedInPlug()->setInput( adaptors->outPlug() );
outPlug()->setInput( inPlug() );
plugDirtiedSignal().connect( boost::bind( &InteractiveRender::plugDirtied, this, ::_1 ) );
}
示例11: computeSet
GafferScene::ConstPathMatcherDataPtr Set::computeSet( const IECore::InternedString &setName, const Gaffer::Context *context, const ScenePlug *parent ) const
{
const std::string allSets = " " + namePlug()->getValue() + " ";
const std::string setNameToFind = " " + setName.string() + " ";
if( allSets.find( setNameToFind ) == std::string::npos )
{
return inPlug()->setPlug()->getValue();
}
ConstPathMatcherDataPtr pathMatcher = pathMatcherPlug()->getValue();
switch( modePlug()->getValue() )
{
case Add : {
ConstPathMatcherDataPtr inputSet = inPlug()->setPlug()->getValue();
if( !inputSet->readable().isEmpty() )
{
PathMatcherDataPtr result = inputSet->copy();
result->writable().addPaths( pathMatcher->readable() );
return result;
}
// Input set empty - fall through to create mode.
}
case Create : {
return pathMatcher;
}
case Remove :
default : {
ConstPathMatcherDataPtr inputSet = inPlug()->setPlug()->getValue();
if( inputSet->readable().isEmpty() )
{
return inputSet;
}
PathMatcherDataPtr result = inputSet->copy();
result->writable().removePaths( pathMatcher->readable() );
return result;
}
}
}
示例12: plugMetadataChanged
void NoduleLayout::plugMetadataChanged( IECore::TypeId nodeTypeId, const Gaffer::MatchPattern &plugPath, IECore::InternedString key, const Gaffer::Plug *plug )
{
if( childAffectedByChange( m_parent.get(), nodeTypeId, plugPath, plug ) )
{
if(
key == g_sectionKey || key == g_indexKey || key == g_visibleKey ||
key == g_noduleTypeKey ||
key == g_nodulePositionKey || key == g_noduleIndexKey
)
{
updateLayout();
}
}
if( const Plug *typedParent = runTimeCast<const Plug>( m_parent.get() ) )
{
if( affectedByChange( typedParent, nodeTypeId, plugPath, plug ) )
{
if( affectsSpacing( key, m_section ) )
{
updateSpacing();
}
if( affectsDirection( key, m_section ) )
{
updateDirection();
}
if( affectsOrientation( key, m_section ) )
{
updateOrientation();
}
if( boost::starts_with( key.string(), "noduleLayout:customGadget" ) )
{
updateLayout();
}
}
}
}
示例13:
const std::string &handleKey() const { return handle.string(); }
示例14: visualise
IECoreGL::ConstRenderablePtr StandardLightVisualiser::visualise( const IECore::InternedString &attributeName, const IECore::ObjectVector *shaderVector, IECoreGL::ConstStatePtr &state ) const
{
if( !shaderVector || shaderVector->members().size() == 0 )
{
return NULL;
}
IECore::InternedString metadataTarget;
const IECore::CompoundData *shaderParameters = NULL;
if( const IECore::Shader *shader = IECore::runTimeCast<const IECore::Shader>( shaderVector->members().back().get() ) )
{
metadataTarget = attributeName.string() + ":" + shader->getName();
shaderParameters = shader->parametersData();
}
else if( const IECore::Light *light = IECore::runTimeCast<const IECore::Light>( shaderVector->members().back().get() ) )
{
/// \todo Remove once all Light node derived classes are
/// creating only shaders.
metadataTarget = attributeName.string() + ":" + light->getName();
shaderParameters = light->parametersData().get();
}
if( !shaderParameters )
{
return NULL;
}
ConstStringDataPtr type = Metadata::value<StringData>( metadataTarget, "type" );
ConstM44fDataPtr orientation = Metadata::value<M44fData>( metadataTarget, "visualiserOrientation" );
const Color3f color = parameter<Color3f>( metadataTarget, shaderParameters, "colorParameter", Color3f( 1.0f ) );
const float intensity = parameter<float>( metadataTarget, shaderParameters, "intensityParameter", 1 );
const float exposure = parameter<float>( metadataTarget, shaderParameters, "exposureParameter", 0 );
const Color3f finalColor = color * intensity * pow( 2.0f, exposure );
if( type && type->readable() == "area" )
{
const std::string textureName = parameter<std::string>( metadataTarget, shaderParameters, "textureNameParameter", "" );
const bool flipNormal = parameter<bool>( metadataTarget, shaderParameters, "flipNormalParameter", 0 );
const bool doubleSided = parameter<bool>( metadataTarget, shaderParameters, "doubleSidedParameter", 0 );
const bool sphericalProjection = parameter<bool>( metadataTarget, shaderParameters, "sphericalProjectionParameter", 0 );
M44f projectionTransform = parameter<M44f>( metadataTarget, shaderParameters, "projectionTransformParameter", M44f() );
const std::vector<float> projectionTransformVector = parameter<std::vector<float> >( metadataTarget, shaderParameters, "projectionTransformParameter", std::vector<float>() );
if( projectionTransformVector.size() == 16 )
{
projectionTransform = M44f( (float(*)[4])(&projectionTransformVector[0]) );
}
addAreaLightVisualiser( state, finalColor, textureName, flipNormal, doubleSided,
sphericalProjection, projectionTransform );
return NULL;
}
GroupPtr result = new Group;
const float locatorScale = parameter<float>( metadataTarget, shaderParameters, "locatorScaleParameter", 1 );
Imath::M44f topTrans;
if( orientation )
{
topTrans = orientation->readable();
}
topTrans.scale( V3f( locatorScale ) );
result->setTransform( topTrans );
if( type && type->readable() == "environment" )
{
const std::string textureName = parameter<std::string>( metadataTarget, shaderParameters, "textureNameParameter", "" );
addEnvLightVisualiser( result, finalColor, textureName );
}
else
{
float coneAngle = parameter<float>( metadataTarget, shaderParameters, "coneAngleParameter", 0.0f );
float penumbraAngle = parameter<float>( metadataTarget, shaderParameters, "penumbraAngleParameter", 0.0f );
if( ConstStringDataPtr angleUnit = Metadata::value<StringData>( metadataTarget, "angleUnit" ) )
{
if( angleUnit->readable() == "radians" )
{
coneAngle *= 180.0 / M_PI;
penumbraAngle *= 180 / M_PI;
}
}
const std::string *penumbraType = NULL;
ConstStringDataPtr penumbraTypeData = Metadata::value<StringData>( metadataTarget, "penumbraType" );
if( penumbraTypeData )
{
penumbraType = &penumbraTypeData->readable();
}
float lensRadius = 0.0f;
if( parameter<bool>( metadataTarget, shaderParameters, "lensRadiusEnableParameter", true ) )
{
lensRadius = parameter<float>( metadataTarget, shaderParameters, "lensRadiusParameter", 0.0f );
}
addBasicLightVisualiser( type, result, finalColor, coneAngle, penumbraAngle, penumbraType, lensRadius / locatorScale );
}
//.........这里部分代码省略.........