(self)
| 135 | self.assertEqual(c.GetOutput().GetNumberOfCells(), 64) |
| 136 | |
| 137 | def testStructured2D(self): |
| 138 | planes = ['XY', 'XZ', 'YZ'] |
| 139 | expectedNCells = [42, 34, 68] |
| 140 | for plane, nCells in zip(planes,expectedNCells): |
| 141 | rt = vtkRTAnalyticSource() |
| 142 | if plane == 'XY': |
| 143 | rt.SetWholeExtent(-5, 5, -5, 5, 0, 0) |
| 144 | elif plane == 'XZ': |
| 145 | rt.SetWholeExtent(-5, 5, 0, 0, -5, 5) |
| 146 | else: |
| 147 | rt.SetWholeExtent(0, 0, -5, 5, -5, 5) |
| 148 | rt.Update() |
| 149 | i = rt.GetOutput() |
| 150 | |
| 151 | st = vtkStructuredGrid() |
| 152 | st.SetDimensions(i.GetDimensions()) |
| 153 | |
| 154 | nps = i.GetNumberOfPoints() |
| 155 | ps = vtkPoints() |
| 156 | ps.SetNumberOfPoints(nps) |
| 157 | for idx in range(nps): |
| 158 | ps.SetPoint(idx, i.GetPoint(idx)) |
| 159 | |
| 160 | st.SetPoints(ps) |
| 161 | |
| 162 | cyl = vtkCylinder() |
| 163 | cyl.SetRadius(2) |
| 164 | cyl.SetCenter(0,0,0) |
| 165 | transform = vtkTransform() |
| 166 | transform.RotateWXYZ(45,20,1,10) |
| 167 | cyl.SetTransform(transform) |
| 168 | |
| 169 | c = vtkTableBasedClipDataSet() |
| 170 | c.SetInputData(st) |
| 171 | c.SetClipFunction(cyl) |
| 172 | c.SetInsideOut(1) |
| 173 | |
| 174 | c.Update() |
| 175 | |
| 176 | self.assertEqual(c.GetOutput().GetNumberOfCells(), nCells) |
| 177 | |
| 178 | def testStructured(self): |
| 179 | rt = vtkRTAnalyticSource() |
nothing calls this directly
no test coverage detected