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

Method ReadFloatBlock

IO/Geometry/vtkAVSucdReader.cxx:1142–1174  ·  view source on GitHub ↗

------------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

1140
1141//------------------------------------------------------------------------------
1142int vtkAVSucdReader::ReadFloatBlock(int n, float* block)
1143{
1144 if (this->BinaryFile)
1145 {
1146 this->FileStream->read((char*)block, n * sizeof(float));
1147 int retVal = static_cast<int>(this->FileStream->gcount()) / sizeof(int);
1148 if (this->ByteOrder == FILE_LITTLE_ENDIAN)
1149 {
1150 vtkByteSwap::Swap4LERange(block, n);
1151 }
1152 else
1153 {
1154 vtkByteSwap::Swap4BERange(block, n);
1155 }
1156 return retVal;
1157 }
1158 else
1159 {
1160 int count = 0;
1161 for (int i = 0; i < n; i++)
1162 {
1163 if (*(this->FileStream) >> block[i])
1164 {
1165 count++;
1166 }
1167 else
1168 {
1169 return 0;
1170 }
1171 }
1172 return count;
1173 }
1174}
1175VTK_ABI_NAMESPACE_END

Callers 4

RequestInformationMethod · 0.95
ReadXYZCoordsMethod · 0.95
ReadNodeDataMethod · 0.95
ReadCellDataMethod · 0.95

Calls 1

readMethod · 0.45

Tested by

no test coverage detected