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

Method variableSize

src/IECoreScene/PatchMeshPrimitive.cpp:328–369  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

326}
327
328size_t PatchMeshPrimitive::variableSize( PrimitiveVariable::Interpolation interpolation ) const
329{
330 switch ( interpolation )
331 {
332 case PrimitiveVariable::Constant :
333 return 1;
334 case PrimitiveVariable::Uniform :
335 return uPatches() * vPatches();
336 case PrimitiveVariable::Vertex :
337 return m_uPoints * m_vPoints;
338 case PrimitiveVariable::Varying :
339 case PrimitiveVariable::FaceVarying :
340
341 {
342 if ( !m_uPeriodic )
343 {
344 if ( m_vPeriodic )
345 {
346 return ( uPatches() + 1 ) * vPatches();
347 }
348 else
349 {
350 return ( uPatches() + 1 ) * ( vPatches() + 1 );
351 }
352 }
353 else
354 {
355 if ( !m_vPeriodic )
356 {
357 return uPatches() * ( vPatches() + 1 );
358 }
359 else
360 {
361 return uPatches() * vPatches();
362 }
363 }
364 }
365 assert( false ); // Unreachable
366 default :
367 return 0;
368 }
369}

Callers 1

testVariableSizeMethod · 0.95

Calls

no outgoing calls

Tested by 1

testVariableSizeMethod · 0.76