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

Method CalculateFileSize

IO/Parallel/vtkMultiBlockPLOT3DReaderInternals.cxx:331–359  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

329}
330
331size_t vtkMultiBlockPLOT3DReaderInternals::CalculateFileSize(int mgrid,
332 int precision, // in bytes
333 int blanking, int ndims, int hasByteCount, int nGrids, int* gridDims)
334{
335 size_t size = 0; // the header portion, 3 ints
336
337 // N grids
338 if (mgrid)
339 {
340 size += 4; // int for nblocks
341 if (hasByteCount)
342 {
343 size += 2 * 4; // byte counts for nblocks
344 }
345 }
346 // Header
347 size += nGrids * ndims * 4;
348
349 if (hasByteCount)
350 {
351 size += 2 * 4; // byte counts for grid dims
352 }
353 for (int i = 0; i < nGrids; i++)
354 {
355 size += this->CalculateFileSizeForBlock(
356 precision, blanking, ndims, hasByteCount, gridDims + ndims * i);
357 }
358 return size;
359}
360
361size_t vtkMultiBlockPLOT3DReaderInternals::CalculateFileSizeForBlock(int precision, // in bytes
362 int blanking, int ndims, int hasByteCount, int* gridDims)

Callers 1

CheckCFileMethod · 0.95

Calls 1

Tested by

no test coverage detected