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

Method RequestData

IO/Fides/Testing/Python/TestFidesWriterTime.py:44–67  ·  view source on GitHub ↗
(self, request, inInfo, outInfo)

Source from the content-addressed store, hash-verified

42
43
44 def RequestData(self, request, inInfo, outInfo):
45 info = outInfo.GetInformationObject(0)
46 output = vtkPolyData.GetData(info)
47
48 timestep = info.Get(vtkStreamingDemandDrivenPipeline.UPDATE_TIME_STEP())
49
50 sphere = vtkSphereSource()
51 sphere.SetRadius(1.0)
52 sphere.SetThetaResolution(16)
53 sphere.SetPhiResolution(16)
54 sphere.SetCenter(timestep * 2.0, 0, 0)
55 sphere.Update()
56
57 data = sphere.GetOutput()
58 numPts = data.GetNumberOfPoints()
59 npArray = np.sin(timestep + np.linspace(0, np.pi, numPts))
60
61 array = numpy_to_vtk(npArray)
62 array.SetName('MyPointField')
63
64 data.GetPointData().AddArray(array)
65 output.ShallowCopy(data)
66
67 return 1
68
69
70class TestFidesWriterTime(Testing.vtkTest):

Callers

nothing calls this directly

Calls 15

numpy_to_vtkFunction · 0.90
GetInformationObjectMethod · 0.80
SetThetaResolutionMethod · 0.80
SetPhiResolutionMethod · 0.80
sinMethod · 0.80
vtkSphereSourceClass · 0.50
GetDataMethod · 0.45
GetMethod · 0.45
SetRadiusMethod · 0.45
SetCenterMethod · 0.45
UpdateMethod · 0.45
GetOutputMethod · 0.45

Tested by

no test coverage detected