| 502 | } |
| 503 | |
| 504 | int vtkXArrayAccessor::get_vars_double(int vtkNotUsed(ncid), int varid, const size_t* startp, |
| 505 | const size_t* countp, const ptrdiff_t* vtkNotUsed(stridep), double* ip) |
| 506 | { |
| 507 | if (static_cast<size_t>(varid) >= this->Var.size()) |
| 508 | return NC_ENOTVAR; |
| 509 | size_t ndims = this->VarDims[varid].size(); |
| 510 | if (std::any_of(countp, countp + ndims, [](size_t val) { return val == 0; })) |
| 511 | { |
| 512 | vtkErrorMacro("Invalid countp: one of the elements is 0"); |
| 513 | return NC_ERANGE; |
| 514 | } |
| 515 | |
| 516 | char* arrayStart; |
| 517 | vtkIdType arraySize; |
| 518 | int vtkType = NetCDFTypeToVTKType(this->VarType[varid]); |
| 519 | if (this->IsContiguous(varid, startp, countp)) |
| 520 | { |
| 521 | this->GetContiguousStartSize(varid, startp, countp, arrayStart, arraySize); |
| 522 | for (vtkIdType i = 0; i < arraySize; ++i) |
| 523 | copyToDouble(vtkType, arrayStart + i * VTKSizeof(vtkType), ip + i); |
| 524 | } |
| 525 | else |
| 526 | { |
| 527 | this->Copy(varid, startp, countp, reinterpret_cast<char*>(ip)); |
| 528 | } |
| 529 | return NC_NOERR; |
| 530 | } |
| 531 | |
| 532 | int vtkXArrayAccessor::get_var_double(int ncid, int varid, double* ip) |
| 533 | { |
no test coverage detected