(self)
| 92 | self.assertEqual(c.GetOutput().GetNumberOfCells(), 64) |
| 93 | |
| 94 | def testRectilinear(self): |
| 95 | rt = vtkRTAnalyticSource() |
| 96 | rt.SetWholeExtent(-5, 5, -5, 5, -5, 5) |
| 97 | rt.Update() |
| 98 | i = rt.GetOutput() |
| 99 | |
| 100 | r = vtkRectilinearGrid() |
| 101 | dims = i.GetDimensions() |
| 102 | r.SetDimensions(dims) |
| 103 | exts = i.GetExtent() |
| 104 | orgs = i.GetOrigin() |
| 105 | |
| 106 | xs = vtkFloatArray() |
| 107 | xs.SetNumberOfTuples(dims[0]) |
| 108 | for d in range(dims[0]): |
| 109 | xs.SetTuple1(d, orgs[0] + exts[0] + d) |
| 110 | r.SetXCoordinates(xs) |
| 111 | |
| 112 | ys = vtkFloatArray() |
| 113 | ys.SetNumberOfTuples(dims[1]) |
| 114 | for d in range(dims[1]): |
| 115 | ys.SetTuple1(d, orgs[1] + exts[2] + d) |
| 116 | r.SetYCoordinates(ys) |
| 117 | |
| 118 | zs = vtkFloatArray() |
| 119 | zs.SetNumberOfTuples(dims[2]) |
| 120 | for d in range(dims[2]): |
| 121 | zs.SetTuple1(d, orgs[2] + exts[4] + d) |
| 122 | r.SetZCoordinates(zs) |
| 123 | |
| 124 | s = vtkSphere() |
| 125 | s.SetRadius(2) |
| 126 | s.SetCenter(0,0,0) |
| 127 | |
| 128 | c = vtkTableBasedClipDataSet() |
| 129 | c.SetInputData(r) |
| 130 | c.SetClipFunction(s) |
| 131 | c.SetInsideOut(1) |
| 132 | |
| 133 | c.Update() |
| 134 | |
| 135 | self.assertEqual(c.GetOutput().GetNumberOfCells(), 64) |
| 136 | |
| 137 | def testStructured2D(self): |
| 138 | planes = ['XY', 'XZ', 'YZ'] |
nothing calls this directly
no test coverage detected