本文整理汇总了C++中iecore::InternedString类的典型用法代码示例。如果您正苦于以下问题:C++ InternedString类的具体用法?C++ InternedString怎么用?C++ InternedString使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了InternedString类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: contextChanged
void SceneView::contextChanged( const IECore::InternedString &name )
{
if( name.value() == "ui:scene:selectedPaths" )
{
// if only the selection has changed then we can just update the selection
// on our existing scene representation.
const StringVectorData *sc = getContext()->get<StringVectorData>( "ui:scene:selectedPaths" );
RenderableGadget::Selection sr;
sr.insert( sc->readable().begin(), sc->readable().end() );
BlockedConnection blockedConnection( m_selectionChangedConnection );
m_renderableGadget->setSelection( sr );
return;
}
if(
name.value().compare( 0, 3, "ui:" ) == 0 &&
name.value() != "ui:scene:expandedPaths"
)
{
// if it's just a ui context entry that has changed, and it doesn't
// affect our expansion, then early out.
return;
}
// the context change might affect the scene itself, so we must
// schedule an update.
updateRequestSignal()( this );
}
示例2: contextChanged
void SceneView::contextChanged( const IECore::InternedString &name )
{
if( name.value() == "ui:scene:selectedPaths" )
{
// If only the selection has changed then we can just update the selection
// on our existing scene representation.
const StringVectorData *sc = getContext()->get<StringVectorData>( "ui:scene:selectedPaths" );
/// \todo Store selection as PathMatcherData within the context, so we don't need
/// this conversion.
GafferScene::PathMatcherDataPtr sg = new GafferScene::PathMatcherData;
sg->writable().init( sc->readable().begin(), sc->readable().end() );
m_sceneGadget->setSelection( sg );
return;
}
else if( name.value() == "ui:scene:expandedPaths" )
{
const GafferScene::PathMatcherData *expandedPaths = getContext()->get<GafferScene::PathMatcherData>( "ui:scene:expandedPaths" );
m_sceneGadget->setExpandedPaths( expandedPaths );
return;
}
else if( boost::starts_with( name.value(), "ui:" ) )
{
// ui context entries shouldn't affect computation.
return;
}
}
示例3:
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;
}
}
}
}
示例4: 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 );
}
}
示例5: 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;
}
示例6: 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." );
}
}
示例7: contextChanged
void ScenePath::contextChanged( const IECore::InternedString &key )
{
if( !boost::starts_with( key.c_str(), "ui:" ) )
{
emitPathChanged();
}
}
示例8: 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();
}
}
示例9: 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 }
} );
}
}
}
示例10: contextChanged
void CameraTool::contextChanged( const IECore::InternedString &name )
{
if( !boost::starts_with( name.string(), "ui:" ) )
{
m_cameraSelectionDirty = true;
view()->viewportGadget()->renderRequestSignal()( view()->viewportGadget() );
}
}
示例11: contextChanged
void ImageGadget::contextChanged( const IECore::InternedString &name )
{
if( !boost::starts_with( name.string(), "ui:" ) )
{
m_dirtyFlags = AllDirty;
requestRender();
}
}
示例12: operator
boost::signals::detail::unusable operator()( boost::python::object slot, ConstContextPtr context, const IECore::InternedString &name )
{
try
{
slot( IECore::constPointerCast<Context>( context ), name.value() );
}
catch( const error_already_set &e )
{
PyErr_PrintEx( 0 ); // clears the error status
}
return boost::signals::detail::unusable();
}
示例13: removeShader
void removeShader( const IECore::InternedString &handle )
{
auto it = m_nodes.find( handle );
if( it == m_nodes.end() )
{
throw IECore::Exception( boost::str(
boost::format(
"Shader \"%1%\" not in network"
) % handle.c_str()
) );
}
removeShader( it );
}
示例14: 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 );
}
示例15: outputConnections
ShaderNetwork::ConnectionRange outputConnections( const IECore::InternedString &handle ) const
{
auto it = m_nodes.find( handle );
if( it == m_nodes.end() )
{
throw IECore::Exception( boost::str(
boost::format(
"Source shader \"%1%\" not in network"
) % handle.c_str()
) );
}
return ConnectionRange(
ConnectionIterator( &it->outputConnections, it->outputConnections.size() ? &*it->outputConnections.begin() : nullptr ),
ConnectionIterator( &it->outputConnections, nullptr )
);
}