--------------------------------------------------------------------------------------------------
| 116 | |
| 117 | //-------------------------------------------------------------------------------------------------- |
| 118 | int vtkNetCDFUGRIDReader::RequestData( |
| 119 | vtkInformation*, vtkInformationVector**, vtkInformationVector* outputVector) |
| 120 | { |
| 121 | this->UpdateProgress(0.0); |
| 122 | |
| 123 | if (!this->Open()) |
| 124 | { |
| 125 | vtkErrorMacro("Can not open file."); |
| 126 | return 0; |
| 127 | } |
| 128 | |
| 129 | this->UpdateProgress(0.125); |
| 130 | |
| 131 | if (!this->ParseHeader()) |
| 132 | { |
| 133 | vtkErrorMacro("Can not parse header."); |
| 134 | this->Close(); |
| 135 | return 0; |
| 136 | } |
| 137 | |
| 138 | vtkInformation* outInfo = outputVector->GetInformationObject(0); |
| 139 | vtkUnstructuredGrid* output = |
| 140 | vtkUnstructuredGrid::SafeDownCast(outInfo->Get(vtkDataObject::DATA_OBJECT())); |
| 141 | |
| 142 | vtkInformationDoubleKey* timeKey = |
| 143 | vtkInformationDoubleKey::SafeDownCast(vtkStreamingDemandDrivenPipeline::UPDATE_TIME_STEP()); |
| 144 | |
| 145 | double time{}; |
| 146 | if (outInfo->Has(timeKey)) |
| 147 | { |
| 148 | time = outInfo->Get(timeKey); |
| 149 | } |
| 150 | |
| 151 | output->GetInformation()->Set(vtkDataObject::DATA_TIME_STEP(), time); |
| 152 | |
| 153 | std::size_t timeStep{}; |
| 154 | for (std::size_t step{}; step < this->TimeSteps.size(); step++) |
| 155 | { |
| 156 | if (this->TimeSteps[step] >= time) |
| 157 | { |
| 158 | timeStep = step; |
| 159 | break; |
| 160 | } |
| 161 | } |
| 162 | |
| 163 | this->UpdateProgress(0.25); |
| 164 | |
| 165 | if (!this->FillPoints(output)) |
| 166 | { |
| 167 | vtkErrorMacro("Failed to get point data"); |
| 168 | this->Close(); |
| 169 | return 0; |
| 170 | } |
| 171 | |
| 172 | this->UpdateProgress(0.5); |
| 173 | |
| 174 | if (!this->FillCells(output)) |
| 175 | { |
nothing calls this directly
no test coverage detected