------------------------------------------------------------------------------
| 43 | |
| 44 | //------------------------------------------------------------------------------ |
| 45 | vtkTypeBool vtkMultiTimeStepAlgorithm::ProcessRequest( |
| 46 | vtkInformation* request, vtkInformationVector** inputVector, vtkInformationVector* outputVector) |
| 47 | { |
| 48 | // create the output |
| 49 | if (request->Has(vtkDemandDrivenPipeline::REQUEST_DATA_OBJECT())) |
| 50 | { |
| 51 | return this->RequestDataObject(request, inputVector, outputVector); |
| 52 | } |
| 53 | |
| 54 | // set update extent |
| 55 | if (request->Has(vtkCompositeDataPipeline::REQUEST_UPDATE_EXTENT())) |
| 56 | { |
| 57 | int retVal(1); |
| 58 | vtkInformation* inInfo = inputVector[0]->GetInformationObject(0); |
| 59 | if (this->RequestUpdateIndex == 0) |
| 60 | { |
| 61 | retVal = this->RequestUpdateExtent(request, inputVector, outputVector); |
| 62 | } |
| 63 | |
| 64 | size_t nTimeSteps = this->UpdateTimeSteps.size(); |
| 65 | if (nTimeSteps > 0) |
| 66 | { |
| 67 | bool inCache = true; |
| 68 | for (size_t i = 0; i < nTimeSteps; i++) |
| 69 | { |
| 70 | size_t idx; |
| 71 | if (!this->IsInCache(this->UpdateTimeSteps[i], idx)) |
| 72 | { |
| 73 | inCache = false; |
| 74 | break; |
| 75 | } |
| 76 | } |
| 77 | if (!inCache) |
| 78 | { |
| 79 | inInfo->Set(vtkStreamingDemandDrivenPipeline::UPDATE_TIME_STEP(), |
| 80 | this->UpdateTimeSteps[this->RequestUpdateIndex]); |
| 81 | } |
| 82 | else |
| 83 | { |
| 84 | // Ask for any time step. This should not update unless something else changed. |
| 85 | inInfo->Remove(vtkStreamingDemandDrivenPipeline::UPDATE_TIME_STEP()); |
| 86 | } |
| 87 | } |
| 88 | return retVal; |
| 89 | } |
| 90 | |
| 91 | // generate the data |
| 92 | if (request->Has(vtkCompositeDataPipeline::REQUEST_DATA())) |
| 93 | { |
| 94 | int retVal = 1; |
| 95 | vtkInformation* inInfo = inputVector[0]->GetInformationObject(0); |
| 96 | auto inData = vtk::MakeSmartPointer(inInfo->Get(vtkDataObject::DATA_OBJECT())); |
| 97 | |
| 98 | if (this->UpdateTimeSteps.empty()) |
| 99 | { |
| 100 | vtkErrorMacro("No temporal data has been requested. "); |
| 101 | return 0; |
| 102 | } |
nothing calls this directly
no test coverage detected