( self, mesh, primVarName )
| 46 | class 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] |
no test coverage detected