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

Function ReadSparseArrayBinary

IO/Core/vtkArrayReader.cxx:104–135  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

102
103template <typename ValueT>
104vtkSparseArray<ValueT>* ReadSparseArrayBinary(istream& stream)
105{
106 // Create the array ...
107 vtkSmartPointer<vtkSparseArray<ValueT>> array = vtkSmartPointer<vtkSparseArray<ValueT>>::New();
108
109 // Read the file header ...
110 vtkArrayExtents extents;
111 vtkArrayExtents::SizeT non_null_size = 0;
112 bool swap_endian = false;
113 ReadHeader(stream, extents, non_null_size, array);
114 ReadEndianOrderMark(stream, swap_endian);
115
116 // Read the array nullptr value ...
117 ValueT null_value;
118 stream.read(reinterpret_cast<char*>(&null_value), sizeof(ValueT));
119 array->SetNullValue(null_value);
120
121 // Read array coordinates ...
122 array->ReserveStorage(non_null_size);
123
124 for (vtkArray::DimensionT i = 0; i != array->GetDimensions(); ++i)
125 {
126 stream.read(reinterpret_cast<char*>(array->GetCoordinateStorage(i)),
127 non_null_size * sizeof(vtkArray::CoordinateT));
128 }
129
130 // Read array values ...
131 stream.read(reinterpret_cast<char*>(array->GetValueStorage()), non_null_size * sizeof(ValueT));
132
133 array->Register(nullptr);
134 return array;
135}
136
137template <>
138vtkSparseArray<vtkStdString>* ReadSparseArrayBinary<vtkStdString>(istream& stream)

Callers

nothing calls this directly

Calls 6

ReadHeaderFunction · 0.85
ReadEndianOrderMarkFunction · 0.85
NewFunction · 0.50
readMethod · 0.45
GetDimensionsMethod · 0.45
RegisterMethod · 0.45

Tested by

no test coverage detected