| 3015 | } |
| 3016 | |
| 3017 | int vtkMultiBlockPLOT3DReader::CanReadBinaryFile(const char* fname) |
| 3018 | { |
| 3019 | FILE* xyzFp; |
| 3020 | |
| 3021 | if (!fname || fname[0] == '\0') |
| 3022 | { |
| 3023 | return 0; |
| 3024 | } |
| 3025 | |
| 3026 | if (this->CheckFile(xyzFp, fname) != VTK_OK) |
| 3027 | { |
| 3028 | return 0; |
| 3029 | } |
| 3030 | |
| 3031 | this->CalculateFileSize(xyzFp); |
| 3032 | |
| 3033 | if (!this->AutoDetectionCheck(xyzFp)) |
| 3034 | { |
| 3035 | fclose(xyzFp); |
| 3036 | return 0; |
| 3037 | } |
| 3038 | clearerr(xyzFp); // clear error and EOF flags |
| 3039 | fseek(xyzFp, 0, SEEK_SET); // move to beginning |
| 3040 | |
| 3041 | int numBlocks = this->GetNumberOfBlocksInternal(xyzFp, 0); |
| 3042 | fclose(xyzFp); |
| 3043 | if (numBlocks != 0) |
| 3044 | { |
| 3045 | return 1; |
| 3046 | } |
| 3047 | return 0; |
| 3048 | } |
| 3049 | |
| 3050 | // Read the header and return the number of grids. |
| 3051 | int vtkMultiBlockPLOT3DReader::GetNumberOfBlocksInternal(FILE* xyzFp, int vtkNotUsed(allocate)) |
nothing calls this directly
no test coverage detected