| 26 | from vtkmodules.util.vtkAlgorithm import VTKPythonAlgorithmBase |
| 27 | |
| 28 | class 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 | |
| 54 | class MovingPDC(VTKPythonAlgorithmBase): |
| 55 | def __init__(self): |
no outgoing calls
no test coverage detected