MCPcopy Create free account
hub / github.com/Kitware/VTK / DoPlot3DReaderTests

Function DoPlot3DReaderTests

IO/Parallel/Testing/Python/TestPDataSetReaderGrid.py:29–52  ·  view source on GitHub ↗
(reader)

Source from the content-addressed store, hash-verified

27VTK_DATA_ROOT = vtkGetDataRoot()
28
29def 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#

Callers 1

Calls 9

GetBlockMethod · 0.80
printFunction · 0.50
RemoveAllFunctionsMethod · 0.45
AddFunctionMethod · 0.45
UpdateMethod · 0.45
GetArrayMethod · 0.45
GetPointDataMethod · 0.45
GetOutputMethod · 0.45
exitMethod · 0.45

Tested by

no test coverage detected