------------------------------------------------------------------------------
| 286 | |
| 287 | //------------------------------------------------------------------------------ |
| 288 | int vtkNetCDFCAMReader::RequestInformation(vtkInformation* vtkNotUsed(reqInfo), |
| 289 | vtkInformationVector** vtkNotUsed(inputVector), vtkInformationVector* outputVector) |
| 290 | { |
| 291 | if (this->FileName == nullptr) |
| 292 | { |
| 293 | vtkWarningMacro("Missing a file name."); |
| 294 | return 0; |
| 295 | } |
| 296 | |
| 297 | if (this->CurrentFileName != nullptr && strcmp(this->CurrentFileName, this->FileName) != 0) |
| 298 | { |
| 299 | this->Internals->closePoints(); |
| 300 | this->PointDataArraySelection->RemoveAllArrays(); |
| 301 | this->SetCurrentFileName(nullptr); |
| 302 | } |
| 303 | if (this->Internals->nc_points == -1) |
| 304 | { |
| 305 | if (!this->Internals->openPoints(this->FileName)) |
| 306 | { |
| 307 | vtkErrorMacro(<< "Can't read file " << this->FileName); |
| 308 | return 0; |
| 309 | } |
| 310 | this->SetCurrentFileName(this->FileName); |
| 311 | this->BuildVarArray(); |
| 312 | int dimid; |
| 313 | if (!this->Internals->nc_err(nc_inq_dimid(this->Internals->nc_points, "lev", &dimid), false)) |
| 314 | { |
| 315 | size_t size; |
| 316 | if (this->Internals->nc_err(nc_inq_dimlen(this->Internals->nc_points, dimid, &size))) |
| 317 | { |
| 318 | return 0; |
| 319 | } |
| 320 | this->MidpointLayersRange[1] = static_cast<int>(size - 1); |
| 321 | } |
| 322 | if (!this->Internals->nc_err(nc_inq_dimid(this->Internals->nc_points, "ilev", &dimid), false)) |
| 323 | { |
| 324 | size_t size; |
| 325 | if (this->Internals->nc_err(nc_inq_dimlen(this->Internals->nc_points, dimid, &size))) |
| 326 | { |
| 327 | return 0; |
| 328 | } |
| 329 | this->InterfaceLayersRange[1] = static_cast<int>(size - 1); |
| 330 | } |
| 331 | } |
| 332 | int dimid; |
| 333 | if (this->Internals->nc_err(nc_inq_dimid(this->Internals->nc_points, "time", &dimid))) |
| 334 | { |
| 335 | vtkErrorMacro("Cannot find the number of time steps (time dimension)."); |
| 336 | return 0; |
| 337 | } |
| 338 | size_t size; |
| 339 | if (this->Internals->nc_err(nc_inq_dimlen(this->Internals->nc_points, dimid, &size))) |
| 340 | { |
| 341 | return 0; |
| 342 | } |
| 343 | this->NumberOfTimeSteps = size; |
| 344 | vtkInformation* outInfo = outputVector->GetInformationObject(0); |
| 345 |
nothing calls this directly
no test coverage detected