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

Method splitAll

test/IECoreScene/MeshAlgoSplitTest.py:48–66  ·  view source on GitHub ↗
( self, mesh, primVarName )

Source from the content-addressed store, hash-verified

46class MeshAlgoSplitTest( unittest.TestCase ) :
47
48 def splitAll( self, mesh, primVarName ):
49 splitter = IECoreScene.MeshAlgo.MeshSplitter( mesh, mesh[primVarName] )
50 result = []
51 for i in range( splitter.numMeshes() ):
52 b = splitter.bound( i )
53 m = splitter.mesh( i )
54
55 # While evaluating all the tests, make sure that the fast path to compute just the bound
56 # yields the same result as getting the whole mesh, and computing the bound from that
57
58 self.assertEqual( m.bound(), b )
59 key = splitter.value( i ).value
60 self.assertEqual( key, m[primVarName].data[0] )
61 result.append( ( key, m ) )
62
63 # While we want to encourage the MeshSplitter API now, I suppose we should still check that
64 # that the segment call works
65 self.assertEqual( result, self.splitAllDeprecated( mesh, primVarName ) )
66 return result
67
68 def splitAllDeprecated( self, mesh, primVarName ):
69 p = mesh[primVarName]

Callers 2

Calls 7

boundMethod · 0.95
meshMethod · 0.95
splitAllDeprecatedMethod · 0.95
MeshSplitterMethod · 0.80
appendMethod · 0.80
boundMethod · 0.45
valueMethod · 0.45

Tested by

no test coverage detected