(self)
| 45 | self.assertEqual(c.GetOutput().GetNumberOfCells(), 0) |
| 46 | |
| 47 | def testImage2DScalar(self): |
| 48 | planes = ['XY', 'XZ', 'YZ'] |
| 49 | expectedNCells = [38, 46, 42] |
| 50 | expectedNClippedCells = [104, 104, 106] |
| 51 | for plane, nCells, nClippedCells in zip(planes,expectedNCells,expectedNClippedCells): |
| 52 | r = vtkRTAnalyticSource() |
| 53 | r.SetXFreq(600); |
| 54 | r.SetYFreq(400); |
| 55 | r.SetZFreq(900); |
| 56 | if plane == 'XY': |
| 57 | r.SetWholeExtent(-5, 5, -5, 5, 0, 0) |
| 58 | elif plane == 'XZ': |
| 59 | r.SetWholeExtent(-5, 5, 0, 0, -5, 5) |
| 60 | else: |
| 61 | r.SetWholeExtent(0, 0, -5, 5, -5, 5) |
| 62 | r.Update() |
| 63 | |
| 64 | c = vtkTableBasedClipDataSet() |
| 65 | c.SetInputConnection(r.GetOutputPort()) |
| 66 | c.SetUseValueAsOffset(0) |
| 67 | c.SetValue(150) |
| 68 | c.SetInsideOut(1) |
| 69 | c.SetGenerateClippedOutput(1) |
| 70 | |
| 71 | c.Update() |
| 72 | |
| 73 | self.assertEqual(c.GetOutput().GetNumberOfCells(), nCells) |
| 74 | self.assertEqual(c.GetClippedOutput().GetNumberOfCells(), nClippedCells) |
| 75 | |
| 76 | def testImage(self): |
| 77 | r = vtkRTAnalyticSource() |
nothing calls this directly
no test coverage detected