| 102 | |
| 103 | template <typename ValueT> |
| 104 | vtkSparseArray<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 | |
| 137 | template <> |
| 138 | vtkSparseArray<vtkStdString>* ReadSparseArrayBinary<vtkStdString>(istream& stream) |
nothing calls this directly
no test coverage detected