| 392 | } |
| 393 | |
| 394 | void vtkXArrayAccessor::Copy(int varid, const size_t* startp, const size_t* countp, char* dst) |
| 395 | { |
| 396 | // the last dim is the most rapidly varying |
| 397 | auto dimIncrement = this->GetDimIncrement(varid); |
| 398 | size_t ndims = dimIncrement.size(); |
| 399 | std::vector<size_t> count; |
| 400 | count.resize(ndims); |
| 401 | std::copy(countp, countp + count.size(), count.data()); |
| 402 | char* src = this->VarValue[varid]; |
| 403 | int vtkType = NetCDFTypeToVTKType(this->VarType[varid]); |
| 404 | for (size_t i = 0; i < ndims; ++i) |
| 405 | { |
| 406 | src += dimIncrement[i] * startp[i] * VTKSizeof(vtkType); |
| 407 | } |
| 408 | size_t copyLength = countp[ndims - 1] * VTKSizeof(vtkType); |
| 409 | count[ndims - 1] = 0; |
| 410 | do |
| 411 | { |
| 412 | std::copy(src, src + copyLength, dst); |
| 413 | src += copyLength; |
| 414 | dst += copyLength; |
| 415 | } while (this->DecrementAndUpdate(varid, count, startp, countp, dimIncrement, src)); |
| 416 | } |
| 417 | |
| 418 | void vtkXArrayAccessor::GetContiguousStartSize( |
| 419 | int varid, const size_t* startp, const size_t* countp, char*& arrayStart, vtkIdType& arraySize) |
no test coverage detected