| 391 | } |
| 392 | |
| 393 | size_t Primitive::getVertexCount() const |
| 394 | { |
| 395 | // NOTE : It would perhaps be better if the vertex count was stored as a member variable, then we could |
| 396 | // check the size of each registered vertex attribute as it is added. Derived classes would need |
| 397 | // to set this value perhaps as an argument to the constructor. However that would break ABI so for |
| 398 | // now determine the vertex count by inspecting the size of the "P" attribute which ALL primitives |
| 399 | // should have registered. |
| 400 | |
| 401 | const AttributeMap::const_iterator it = m_vertexAttributes.find( g_P ); |
| 402 | return ( ( it != m_vertexAttributes.end() ) && ( IECore::runTimeCast< const IECore::V3fVectorData >( it->second ) ) ) |
| 403 | ? static_cast< size_t >( IECore::assertedStaticCast< const IECore::V3fVectorData >( it->second )->readable().size() ) |
| 404 | : static_cast< size_t >( 0 ); |
| 405 | } |
| 406 | |
| 407 | bool Primitive::depthSortRequested( const State * state ) const |
| 408 | { |