Internal function to read a float array. Returns zero if there was an error.
| 2824 | // Internal function to read a float array. |
| 2825 | // Returns zero if there was an error. |
| 2826 | int vtkEnSight6BinaryReader::ReadFloatArray(float* result, int numFloats) |
| 2827 | { |
| 2828 | if (numFloats <= 0) |
| 2829 | { |
| 2830 | return 1; |
| 2831 | } |
| 2832 | |
| 2833 | if (!this->BinaryIFile->read((char*)result, sizeof(float) * numFloats)) |
| 2834 | { |
| 2835 | vtkErrorMacro("Read failed."); |
| 2836 | return 0; |
| 2837 | } |
| 2838 | |
| 2839 | if (this->ByteOrder == FILE_LITTLE_ENDIAN) |
| 2840 | { |
| 2841 | vtkByteSwap::Swap4LERange(result, numFloats); |
| 2842 | } |
| 2843 | else |
| 2844 | { |
| 2845 | vtkByteSwap::Swap4BERange(result, numFloats); |
| 2846 | } |
| 2847 | |
| 2848 | return 1; |
| 2849 | } |
| 2850 | |
| 2851 | //------------------------------------------------------------------------------ |
| 2852 | void vtkEnSight6BinaryReader::PrintSelf(ostream& os, vtkIndent indent) |
no test coverage detected