(numPoints=None, numCells=None)
| 29 | |
| 30 | |
| 31 | def CheckSelection(numPoints=None, numCells=None): |
| 32 | global counter |
| 33 | # need to save the active source so we can restore it later |
| 34 | source = GetActiveSource() |
| 35 | Render() |
| 36 | SaveScreenshot("tmp%d.png" % counter) |
| 37 | print("Saving %s" % ("tmp%d.png" % counter)) |
| 38 | counter = counter + 1 |
| 39 | es = ExtractSelection() |
| 40 | es.UpdatePipeline() |
| 41 | info = es.GetDataInformation() |
| 42 | print("Points and cells:", info.GetNumberOfPoints(), info.GetNumberOfCells()) |
| 43 | if numPoints is not None: |
| 44 | assert numPoints == info.GetNumberOfPoints() |
| 45 | if numCells is not None: |
| 46 | assert numCells == info.GetNumberOfCells() |
| 47 | # del es is not enough, need to also Delete() |
| 48 | Delete(es) |
| 49 | del es |
| 50 | SetActiveSource(source) |
| 51 | |
| 52 | |
| 53 | SetActiveSource(s) |
no test coverage detected