MCPcopy Create free account
hub / github.com/ImageEngine/cortex / getVertexCount

Method getVertexCount

src/IECoreGL/Primitive.cpp:393–405  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

391}
392
393size_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
407bool Primitive::depthSortRequested( const State * state ) const
408{

Callers

nothing calls this directly

Calls 4

readableMethod · 0.80
findMethod · 0.45
endMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected