| 57 | } |
| 58 | |
| 59 | IECore::RunTimeTypedPtr ToGLSphereConverter::doConversion( IECore::ConstObjectPtr src, IECore::ConstCompoundObjectPtr operands ) const |
| 60 | { |
| 61 | const IECoreScene::SpherePrimitive *coreSphere = static_cast<const IECoreScene::SpherePrimitive *>( src.get() ); |
| 62 | IECoreGL::SpherePrimitivePtr glSphere = new IECoreGL::SpherePrimitive( coreSphere->radius(), coreSphere->zMin(), coreSphere->zMax(), coreSphere->thetaMax() ); |
| 63 | |
| 64 | for( IECoreScene::PrimitiveVariableMap::const_iterator it = coreSphere->variables.begin(), eIt = coreSphere->variables.end(); it != eIt; ++it ) |
| 65 | { |
| 66 | if( it->second.data ) |
| 67 | { |
| 68 | glSphere->addPrimitiveVariable( it->first, it->second ); |
| 69 | } |
| 70 | else |
| 71 | { |
| 72 | IECore::msg( IECore::Msg::Warning, "ToGLSphereConverter", boost::format( "No data given for primvar \"%s\"" ) % it->first ); |
| 73 | } |
| 74 | } |
| 75 | |
| 76 | return glSphere; |
| 77 | } |