| 476 | } |
| 477 | |
| 478 | void MeshPrimitive::save( IECore::Object::SaveContext *context ) const |
| 479 | { |
| 480 | Primitive::save(context); |
| 481 | IndexedIOPtr container = context->container( staticTypeName(), m_ioVersion ); |
| 482 | context->save( m_verticesPerFace.get(), container.get(), g_verticesPerFaceEntry ); |
| 483 | context->save( m_vertexIds.get(), container.get(), g_vertexIdsEntry ); |
| 484 | |
| 485 | /// \todo: mac has problems with the size_t type, resulting in the write() call being |
| 486 | /// ambiguous to the compiler |
| 487 | unsigned int numVertices = m_numVertices; |
| 488 | container->write( g_numVerticesEntry, numVertices ); |
| 489 | |
| 490 | container->write( g_interpolationEntry, m_interpolation ); |
| 491 | |
| 492 | if( m_cornerIds->readable().size() ) |
| 493 | { |
| 494 | context->save( m_cornerIds.get(), container.get(), g_cornerIdsEntry ); |
| 495 | context->save( m_cornerSharpnesses.get(), container.get(), g_cornerSharpnessesEntry ); |
| 496 | } |
| 497 | |
| 498 | if( m_creaseLengths->readable().size() ) |
| 499 | { |
| 500 | context->save( m_creaseLengths.get(), container.get(), g_creaseLengthsEntry ); |
| 501 | context->save( m_creaseIds.get(), container.get(), g_creaseIdsEntry ); |
| 502 | context->save( m_creaseSharpnesses.get(), container.get(), g_creaseSharpnessesEntry ); |
| 503 | } |
| 504 | |
| 505 | container->write( g_interpolateBoundaryEntry, getInterpolateBoundary().string() ); |
| 506 | container->write( g_faceVaryingLinearInterpolationEntry, getFaceVaryingLinearInterpolation().string() ); |
| 507 | container->write( g_triangleSubdivisionRuleEntry, getTriangleSubdivisionRule().string() ); |
| 508 | } |
| 509 | |
| 510 | void MeshPrimitive::load( IECore::Object::LoadContextPtr context ) |
| 511 | { |