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

Class MovingSphereSource

Filters/General/Testing/Python/TestGroupTimeStepsFilter.py:28–52  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

26from vtkmodules.util.vtkAlgorithm import VTKPythonAlgorithmBase
27
28class MovingSphereSource(VTKPythonAlgorithmBase):
29 def __init__(self):
30 VTKPythonAlgorithmBase.__init__(self,
31 nInputPorts=0,
32 nOutputPorts=1, outputType='vtkPolyData')
33
34 def RequestInformation(self, request, inInfo, outInfo):
35 info = outInfo.GetInformationObject(0)
36 t = range(0, 10)
37 info.Set(vtkStreamingDemandDrivenPipeline.TIME_STEPS(), t, len(t))
38 info.Set(vtkStreamingDemandDrivenPipeline.TIME_RANGE(), [t[0], t[-1]], 2)
39 return 1
40
41 def RequestData(self, request, inInfo, outInfo):
42 info = outInfo.GetInformationObject(0)
43 output = vtkPolyData.GetData(outInfo)
44
45 t = info.Get(vtkStreamingDemandDrivenPipeline.UPDATE_TIME_STEP())
46
47 sphere = vtkSphereSource()
48 sphere.SetCenter(0, t * 2, 0)
49 sphere.Update()
50
51 output.ShallowCopy(sphere.GetOutput())
52 return 1
53
54class MovingPDC(VTKPythonAlgorithmBase):
55 def __init__(self):

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected