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

Method ReadIntScalar

IO/Parallel/vtkMultiBlockPLOT3DReader.cxx:2815–2843  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2813}
2814
2815int vtkMultiBlockPLOT3DReader::ReadIntScalar(void* vfp, int extent[6], int wextent[6],
2816 vtkDataArray* scalar, vtkTypeUInt64 offset, const vtkMultiBlockPLOT3DReaderRecord& record)
2817{
2818 FILE* fp = reinterpret_cast<FILE*>(vfp);
2819 vtkIdType n = vtkStructuredData::GetNumberOfPoints(extent);
2820
2821 if (this->Internal->Settings.BinaryFile)
2822 {
2823 // precond: we assume the offset has been updated properly to step over
2824 // sub-record markers, if any.
2825 if (vtk_fseek(fp, offset, SEEK_SET) != 0)
2826 {
2827 return 0;
2828 }
2829
2830 vtkPLOT3DArrayReader<int> arrayReader;
2831 arrayReader.ByteOrder = this->Internal->Settings.ByteOrder;
2832 vtkIdType preskip, postskip;
2833 vtkMultiBlockPLOT3DReaderInternals::CalculateSkips(extent, wextent, preskip, postskip);
2834 vtkIntArray* intArray = static_cast<vtkIntArray*>(scalar);
2835 return arrayReader.ReadScalar(fp, preskip, n, postskip, intArray->WritePointer(0, n), record) ==
2836 n;
2837 }
2838 else
2839 {
2840 vtkIntArray* intArray = static_cast<vtkIntArray*>(scalar);
2841 return this->ReadIntBlock(fp, n, intArray->WritePointer(0, n));
2842 }
2843}
2844
2845int vtkMultiBlockPLOT3DReader::ReadScalar(void* vfp, int extent[6], int wextent[6],
2846 vtkDataArray* scalar, vtkTypeUInt64 offset, const vtkMultiBlockPLOT3DReaderRecord& record)

Callers 1

ReadMeshMethod · 0.95

Calls 4

ReadIntBlockMethod · 0.95
GetNumberOfPointsFunction · 0.50
ReadScalarMethod · 0.45
WritePointerMethod · 0.45

Tested by

no test coverage detected