(self)
| 39 | self.assertEqual(r.GetOutputDataObject(0).GetNumberOfCells(), TestEnsemble.npolys[i]) |
| 40 | |
| 41 | def test2(self): |
| 42 | global nExecutions |
| 43 | |
| 44 | r = self.createSource() |
| 45 | |
| 46 | nExecutions = 0 |
| 47 | def addToCounter(obj, event): |
| 48 | global nExecutions |
| 49 | nExecutions += 1 |
| 50 | r.AddObserver('StartEvent', addToCounter) |
| 51 | |
| 52 | shrink = vtkShrinkPolyData() |
| 53 | shrink.SetInputConnection(r.GetOutputPort()) |
| 54 | shrink.UpdateInformation() |
| 55 | |
| 56 | self.assertTrue(shrink.GetOutputInformation(0).Has(vtkEnsembleSource.META_DATA())) |
| 57 | |
| 58 | metaData = shrink.GetOutputInformation(0).Has(vtkEnsembleSource.META_DATA()) |
| 59 | |
| 60 | shrink.Update() |
| 61 | |
| 62 | oInfo = shrink.GetOutputInformation(0) |
| 63 | oInfo.Set(vtkEnsembleSource.UPDATE_MEMBER(), 2) |
| 64 | shrink.Update() |
| 65 | |
| 66 | output = shrink.GetOutputDataObject(0) |
| 67 | |
| 68 | self.assertEqual(output.GetNumberOfCells(), TestEnsemble.npolys[2]) |
| 69 | |
| 70 | shrink.Update() |
| 71 | |
| 72 | oInfo = shrink.GetOutputInformation(0) |
| 73 | oInfo.Set(vtkEnsembleSource.UPDATE_MEMBER(), 1) |
| 74 | shrink.Update() |
| 75 | |
| 76 | self.assertEqual(output.GetNumberOfCells(), TestEnsemble.npolys[1]) |
| 77 | |
| 78 | shrink2 = vtkShrinkPolyData() |
| 79 | shrink2.SetInputConnection(r.GetOutputPort()) |
| 80 | |
| 81 | shrink2.Update() |
| 82 | |
| 83 | output2 = shrink2.GetOutputDataObject(0) |
| 84 | |
| 85 | self.assertEqual(output.GetNumberOfCells(), TestEnsemble.npolys[1]) |
| 86 | |
| 87 | self.assertEqual(nExecutions, 3) |
| 88 | |
| 89 | if __name__ == "__main__": |
| 90 | Testing.main([(TestEnsemble, 'test')]) |
nothing calls this directly
no test coverage detected