| 52 | return 1 |
| 53 | |
| 54 | class MovingPDC(VTKPythonAlgorithmBase): |
| 55 | def __init__(self): |
| 56 | VTKPythonAlgorithmBase.__init__(self, |
| 57 | nInputPorts=0, |
| 58 | nOutputPorts=1, outputType='vtkPartitionedDataSetCollection') |
| 59 | |
| 60 | def RequestInformation(self, request, inInfo, outInfo): |
| 61 | info = outInfo.GetInformationObject(0) |
| 62 | t = range(0, 10) |
| 63 | info.Set(vtkStreamingDemandDrivenPipeline.TIME_STEPS(), t, len(t)) |
| 64 | info.Set(vtkStreamingDemandDrivenPipeline.TIME_RANGE(), [t[0], t[-1]], 2) |
| 65 | return 1 |
| 66 | |
| 67 | def RequestData(self, request, inInfo, outInfo): |
| 68 | info = outInfo.GetInformationObject(0) |
| 69 | output = vtkDataObject.GetData(outInfo) |
| 70 | |
| 71 | t = info.Get(vtkStreamingDemandDrivenPipeline.UPDATE_TIME_STEP()) |
| 72 | |
| 73 | source = vtkPartitionedDataSetCollectionSource() |
| 74 | source.SetNumberOfShapes(int(1 + t % 3)) |
| 75 | |
| 76 | transform = vtkTransform() |
| 77 | transform.Identity() |
| 78 | transform.Translate(2, t*2, 0) |
| 79 | |
| 80 | xform = vtkTransformPolyDataFilter() |
| 81 | xform.SetTransform(transform) |
| 82 | xform.SetInputConnection(source.GetOutputPort()) |
| 83 | xform.Update() |
| 84 | |
| 85 | output.ShallowCopy(xform.GetOutputDataObject(0)) |
| 86 | return 1 |
| 87 | |
| 88 | source1 = MovingSphereSource() |
| 89 | group1 = vtkGroupTimeStepsFilter() |
no outgoing calls
no test coverage detected