------------------------------------------------------------------------------ For an arbitrary (i.e. not nCells, nVertices, or Time) dimension, extract the dimension's metadata into memory (if needed) and return the last used index into the dimension values, or 0 if the dimension is new. For an arbitrary (i.e. not nCells, nVertices, or Time) dimension, extract ------------------------------------
| 414 | // For an arbitrary (i.e. not nCells, nVertices, or Time) dimension, extract |
| 415 | //------------------------------------------------------------------------------ |
| 416 | long vtkMPASReader::Internal::InitializeDimension(int nc_dim) |
| 417 | { |
| 418 | char name[NC_MAX_NAME + 1]; |
| 419 | if (nc_err(nc_inq_dimname(ncFile, nc_dim, name))) |
| 420 | { |
| 421 | return false; |
| 422 | } |
| 423 | Internal::DimMetaDataMap::const_iterator match = dimMetaDataMap.find(name); |
| 424 | |
| 425 | long result = 0; |
| 426 | if (match == dimMetaDataMap.end()) |
| 427 | { |
| 428 | DimMetaData metaData; |
| 429 | metaData.curIdx = result; |
| 430 | if (nc_err(nc_inq_dimlen(ncFile, nc_dim, &metaData.dimSize))) |
| 431 | { |
| 432 | return -1; |
| 433 | } |
| 434 | |
| 435 | dimMetaDataMap.insert(std::make_pair(std::string(name), metaData)); |
| 436 | dimMetaDataTime.Modified(); |
| 437 | } |
| 438 | else |
| 439 | { |
| 440 | result = match->second.curIdx; |
| 441 | } |
| 442 | |
| 443 | return result; |
| 444 | } |
| 445 | |
| 446 | //------------------------------------------------------------------------------ |
| 447 | vtkIdType vtkMPASReader::Internal::ComputeNumberOfTuples(int nc_var) const |
no test coverage detected