本文整理汇总了C++中iecore::ConstCompoundObjectPtr::copy方法的典型用法代码示例。如果您正苦于以下问题:C++ ConstCompoundObjectPtr::copy方法的具体用法?C++ ConstCompoundObjectPtr::copy怎么用?C++ ConstCompoundObjectPtr::copy使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类iecore::ConstCompoundObjectPtr
的用法示例。
在下文中一共展示了ConstCompoundObjectPtr::copy方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: computeProcessedGlobals
IECore::ConstCompoundObjectPtr Displays::computeProcessedGlobals( const Gaffer::Context *context, IECore::ConstCompoundObjectPtr inputGlobals ) const
{
const CompoundPlug *dsp = displaysPlug();
if( !dsp->children().size() )
{
return inputGlobals;
}
CompoundObjectPtr result = inputGlobals->copy();
// add our displays to the result
for( InputCompoundPlugIterator it( dsp ); it != it.end(); it++ )
{
const CompoundPlug *displayPlug = *it;
if( displayPlug->getChild<BoolPlug>( "active" )->getValue() )
{
std::string name = displayPlug->getChild<StringPlug>( "name" )->getValue();
std::string type = displayPlug->getChild<StringPlug>( "type" )->getValue();
std::string data = displayPlug->getChild<StringPlug>( "data" )->getValue();
if( name.size() && type.size() && data.size() )
{
DisplayPtr d = new Display( name, type, data );
displayPlug->getChild<CompoundDataPlug>( "parameters" )->fillCompoundData( d->parameters() );
result->members()["display:" + name] = d;
}
}
}
return result;
}
示例2: computeProcessedGlobals
IECore::ConstCompoundObjectPtr Options::computeProcessedGlobals( const Gaffer::Context *context, IECore::ConstCompoundObjectPtr inputGlobals ) const
{
IECore::CompoundObjectPtr result = inputGlobals->copy();
const CompoundDataPlug *p = optionsPlug();
std::string name;
for( CompoundDataPlug::MemberPlugIterator it( p ); it != it.end(); ++it )
{
IECore::DataPtr d = p->memberDataAndName( it->get(), name );
if( d )
{
result->members()["option:" + name] = d;
}
}
return result;
}
示例3: computeProcessedAttributes
IECore::ConstCompoundObjectPtr ShaderAssignment::computeProcessedAttributes( const ScenePath &path, const Gaffer::Context *context, IECore::ConstCompoundObjectPtr inputAttributes ) const
{
CompoundObjectPtr result = inputAttributes->copy();
const Shader *shader = shaderPlug()->source<Plug>()->ancestor<Shader>();
if( shader )
{
// Shader::state() returns a const object, so that in the future it may
// come from a cached value. we're putting it into our result which, once
// returned, will also be treated as const and cached. for that reason the
// temporary const_cast needed to put it into the result is justified -
// we never change the object and nor can anyone after it is returned.
ObjectVectorPtr state = boost::const_pointer_cast<ObjectVector>( shader->state() );
if( state->members().size() )
{
result->members()["shader"] = state;
}
}
return result;
}
示例4:
Implementation( ShaderLoaderPtr shaderLoader, TextureLoaderPtr textureLoader, const std::string &vertexSource, const std::string &geometrySource, const std::string &fragmentSource, IECore::ConstCompoundObjectPtr parameterValues )
: m_shaderLoader( shaderLoader ), m_textureLoader( textureLoader ), m_fragmentSource( fragmentSource ), m_geometrySource( geometrySource ),
m_vertexSource( vertexSource ), m_parameterMap( parameterValues->copy() ), m_shaderSetup( 0 )
{
}