(reader)
| 27 | VTK_DATA_ROOT = vtkGetDataRoot() |
| 28 | |
| 29 | def DoPlot3DReaderTests(reader): |
| 30 | # Ensure disable function works. |
| 31 | reader.RemoveAllFunctions() |
| 32 | reader.AddFunction(211) # vorticity magnitude. |
| 33 | reader.Update() |
| 34 | if reader.GetOutput().GetBlock(0).GetPointData().GetArray("VorticityMagnitude") is None: |
| 35 | print("Failed to read `VorticityMagnitude`") |
| 36 | sys.exit(1) |
| 37 | if reader.GetOutput().GetBlock(0).GetPointData().GetArray("Velocity") is None: |
| 38 | print("Failed to read `Velocity` to compute `VorticityMagnitude`") |
| 39 | sys.exit(1) |
| 40 | reader.RemoveAllFunctions() |
| 41 | reader.Update() |
| 42 | if reader.GetOutput().GetBlock(0).GetPointData().GetArray("VorticityMagnitude") is not None: |
| 43 | print("Failed to not-read `VorticityMagnitude`") |
| 44 | sys.exit(1) |
| 45 | |
| 46 | # Let's ensure intermediate results can be dropped. |
| 47 | reader.PreserveIntermediateFunctionsOff() |
| 48 | reader.AddFunction(211) # vorticity magnitude. |
| 49 | reader.Update() |
| 50 | if reader.GetOutput().GetBlock(0).GetPointData().GetArray("Velocity") is not None: |
| 51 | print("PreserveIntermediateFunctionsOff is not working as expected.") |
| 52 | sys.exit(1) |
| 53 | |
| 54 | # Create the RenderWindow, Renderer and both Actors |
| 55 | # |
no test coverage detected