本文整理汇总了C++中RendererPtr::procedural方法的典型用法代码示例。如果您正苦于以下问题:C++ RendererPtr::procedural方法的具体用法?C++ RendererPtr::procedural怎么用?C++ RendererPtr::procedural使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类RendererPtr
的用法示例。
在下文中一共展示了RendererPtr::procedural方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: render
//.........这里部分代码省略.........
}
else if( const Data *d = runTimeCast<const Data>( it->second.get() ) )
{
renderer->setAttribute( it->first, d );
}
}
// object
std::set<float> deformationTimes;
motionTimes( ( m_options.deformationBlur && m_attributes.deformationBlur ) ? m_attributes.deformationBlurSegments : 0, deformationTimes );
{
ContextPtr timeContext = new Context( *m_context );
Context::Scope scopedTimeContext( timeContext );
unsigned timeIndex = 0;
for( std::set<float>::const_iterator it = deformationTimes.begin(), eIt = deformationTimes.end(); it != eIt; it++, timeIndex++ )
{
timeContext->setFrame( *it );
ConstObjectPtr object = m_scenePlug->objectPlug()->getValue();
if( const Primitive *primitive = runTimeCast<const Primitive>( object.get() ) )
{
if( deformationTimes.size() > 1 && timeIndex == 0 )
{
renderer->motionBegin( deformationTimes );
}
primitive->render( renderer );
if( deformationTimes.size() > 1 && timeIndex == deformationTimes.size() - 1 )
{
renderer->motionEnd();
}
}
else if( const Camera *camera = runTimeCast<const Camera>( object.get() ) )
{
/// \todo This absolutely does not belong here, but until we have
/// a mechanism for drawing manipulators, we don't have any other
/// means of visualising the cameras.
if( renderer->isInstanceOf( "IECoreGL::Renderer" ) )
{
drawCamera( camera, renderer.get() );
}
break; // no motion blur for these chappies.
}
else if( const Light *light = runTimeCast<const Light>( object.get() ) )
{
/// \todo This doesn't belong here.
if( renderer->isInstanceOf( "IECoreGL::Renderer" ) )
{
drawLight( light, renderer.get() );
}
break; // no motion blur for these chappies.
}
else if( const VisibleRenderable* renderable = runTimeCast< const VisibleRenderable >( object.get() ) )
{
renderable->render( renderer );
break; // no motion blur for these chappies.
}
}
}
// children
ConstInternedStringVectorDataPtr childNames = m_scenePlug->childNamesPlug()->getValue();
if( childNames->readable().size() )
{
bool expand = true;
if( m_pathsToExpand )
{
expand = m_pathsToExpand->readable().match( m_scenePath ) & Filter::ExactMatch;
}
if( !expand )
{
renderer->setAttribute( "gl:primitive:wireframe", new BoolData( true ) );
renderer->setAttribute( "gl:primitive:solid", new BoolData( false ) );
renderer->setAttribute( "gl:curvesPrimitive:useGLLines", new BoolData( true ) );
Box3f b = m_scenePlug->boundPlug()->getValue();
CurvesPrimitive::createBox( b )->render( renderer );
}
else
{
ScenePlug::ScenePath childScenePath = m_scenePath;
childScenePath.push_back( InternedString() ); // for the child name
for( vector<InternedString>::const_iterator it=childNames->readable().begin(); it!=childNames->readable().end(); it++ )
{
childScenePath[m_scenePath.size()] = *it;
renderer->setAttribute( "name", new StringData( *it ) );
renderer->procedural( new SceneProcedural( *this, childScenePath ) );
}
}
}
}
catch( const std::exception &e )
{
IECore::msg( IECore::Msg::Error, "SceneProcedural::render()", e.what() );
}
}