本文整理汇总了C++中DisplayPtr::parameters方法的典型用法代码示例。如果您正苦于以下问题:C++ DisplayPtr::parameters方法的具体用法?C++ DisplayPtr::parameters怎么用?C++ DisplayPtr::parameters使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DisplayPtr
的用法示例。
在下文中一共展示了DisplayPtr::parameters方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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 Outputs::computeProcessedGlobals( const Gaffer::Context *context, IECore::ConstCompoundObjectPtr inputGlobals ) const
{
const CompoundPlug *dsp = outputsPlug();
if( !dsp->children().size() )
{
return inputGlobals;
}
IECore::CompoundObjectPtr result = new IECore::CompoundObject;
// Since we're not going to modify any existing members (only add new ones),
// and our result becomes const on returning it, we can directly reference
// the input members in our result without copying. Be careful not to modify
// them though!
result->members() = inputGlobals->members();
// add our outputs to the result
for( InputCompoundPlugIterator it( dsp ); it != it.end(); it++ )
{
const CompoundPlug *outputPlug = it->get();
if( outputPlug->getChild<BoolPlug>( "active" )->getValue() )
{
// backwards compatibility with old plug layout
const StringPlug *namePlug = outputPlug->getChild<StringPlug>( "label" );
if( !namePlug )
{
namePlug = outputPlug->getChild<StringPlug>( "name" );
}
const std::string name = namePlug->getValue();
const StringPlug *fileNamePlug = outputPlug->getChild<StringPlug>( "fileName" );
if( !fileNamePlug )
{
// backwards compatibility with old plug layout
fileNamePlug = outputPlug->getChild<StringPlug>( "name" );
}
const std::string fileName = fileNamePlug->getValue();
const std::string type = outputPlug->getChild<StringPlug>( "type" )->getValue();
const std::string data = outputPlug->getChild<StringPlug>( "data" )->getValue();
if( name.size() && fileName.size() && type.size() && data.size() )
{
DisplayPtr d = new Display( fileName, type, data );
outputPlug->getChild<CompoundDataPlug>( "parameters" )->fillCompoundData( d->parameters() );
result->members()["output:" + name] = d;
}
}
}
return result;
}