------------------------------------------------------------------------------
| 31 | |
| 32 | //------------------------------------------------------------------------------ |
| 33 | int vtkTimeRange::RequestInformation( |
| 34 | vtkInformationVector** inputVector, vtkInformationVector* outputVector) |
| 35 | { |
| 36 | if (!inputVector || !inputVector[0]) |
| 37 | { |
| 38 | vtkErrorMacro("Input vector is nullptr"); |
| 39 | return 0; |
| 40 | } |
| 41 | |
| 42 | auto inInfo = inputVector[0]->GetInformationObject(0); |
| 43 | if (!inInfo) |
| 44 | { |
| 45 | vtkErrorMacro("Input info is nullptr"); |
| 46 | return 0; |
| 47 | } |
| 48 | |
| 49 | if (inInfo->Has(vtkStreamingDemandDrivenPipeline::TIME_STEPS())) |
| 50 | { |
| 51 | this->NumberOfTimeSteps = inInfo->Length(vtkStreamingDemandDrivenPipeline::TIME_STEPS()); |
| 52 | this->TimeValues.resize(this->NumberOfTimeSteps, 0.0); |
| 53 | auto timeValues = inInfo->Get(vtkStreamingDemandDrivenPipeline::TIME_STEPS()); |
| 54 | std::copy(timeValues, timeValues + this->NumberOfTimeSteps, this->TimeValues.begin()); |
| 55 | } |
| 56 | else |
| 57 | { |
| 58 | this->NumberOfTimeSteps = 1; |
| 59 | this->TimeValues.resize(this->NumberOfTimeSteps, 0.0); |
| 60 | this->TimeValues[0] = 0.0; |
| 61 | } |
| 62 | |
| 63 | // Output is no longer temporal |
| 64 | auto outInfo = outputVector->GetInformationObject(0); |
| 65 | outInfo->Remove(vtkStreamingDemandDrivenPipeline::TIME_STEPS()); |
| 66 | outInfo->Remove(vtkStreamingDemandDrivenPipeline::TIME_RANGE()); |
| 67 | |
| 68 | return 1; |
| 69 | } |
| 70 | |
| 71 | //------------------------------------------------------------------------------ |
| 72 | int vtkTimeRange::RequestUpdateExtent(std::size_t iteration, vtkInformationVector** inputVector, |