------------------------------------------------------------------------------
| 816 | |
| 817 | //------------------------------------------------------------------------------ |
| 818 | void vtkMFIXReader::GetBlockOfInts(istream& in, vtkIntArray* v, int n) |
| 819 | { |
| 820 | constexpr int numberOfIntsInBlock = 512 / sizeof(int); |
| 821 | int tempArray[numberOfIntsInBlock]; |
| 822 | int numberOfRecords; |
| 823 | |
| 824 | if (n % numberOfIntsInBlock == 0) |
| 825 | { |
| 826 | numberOfRecords = n / numberOfIntsInBlock; |
| 827 | } |
| 828 | else |
| 829 | { |
| 830 | numberOfRecords = 1 + n / numberOfIntsInBlock; |
| 831 | } |
| 832 | |
| 833 | int c = 0; |
| 834 | for (int i = 0; i < numberOfRecords; ++i) |
| 835 | { |
| 836 | in.read((char*)&tempArray, 512); |
| 837 | for (int j = 0; j < numberOfIntsInBlock; ++j) |
| 838 | { |
| 839 | if (c < n) |
| 840 | { |
| 841 | int temp = tempArray[j]; |
| 842 | this->SwapInt(temp); |
| 843 | v->InsertValue(c, temp); |
| 844 | ++c; |
| 845 | } |
| 846 | } |
| 847 | } |
| 848 | } |
| 849 | |
| 850 | //------------------------------------------------------------------------------ |
| 851 | void vtkMFIXReader::GetBlockOfFloats(istream& in, vtkFloatArray* v, int n) |
no test coverage detected