MCPcopy Create free account
hub / github.com/Kitware/VTK / Copy

Method Copy

IO/NetCDF/vtkXArrayAccessor.cxx:394–416  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

392}
393
394void 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
418void vtkXArrayAccessor::GetContiguousStartSize(
419 int varid, const size_t* startp, const size_t* countp, char*& arrayStart, vtkIdType& arraySize)

Callers 3

get_varsMethod · 0.95
get_vars_doubleMethod · 0.95

Calls 8

GetDimIncrementMethod · 0.95
DecrementAndUpdateMethod · 0.95
VTKSizeofFunction · 0.85
NetCDFTypeToVTKTypeFunction · 0.70
copyFunction · 0.50
sizeMethod · 0.45
resizeMethod · 0.45
dataMethod · 0.45

Tested by

no test coverage detected