------------------------------------------------------------------------------
| 179 | |
| 180 | //------------------------------------------------------------------------------ |
| 181 | int vtkSLACParticleReader::CanReadFile(const char* filename) |
| 182 | { |
| 183 | vtkSLACParticleReaderAutoCloseNetCDF ncFD(filename, NC_NOWRITE, true); |
| 184 | if (!ncFD.Valid()) |
| 185 | return 0; |
| 186 | |
| 187 | // Check for the existence of several arrays we know should be in the file. |
| 188 | int dummy; |
| 189 | if (nc_inq_varid(ncFD(), "particlePos", &dummy) != NC_NOERR) |
| 190 | return 0; |
| 191 | if (nc_inq_varid(ncFD(), "particleInfo", &dummy) != NC_NOERR) |
| 192 | return 0; |
| 193 | if (nc_inq_varid(ncFD(), "time", &dummy) != NC_NOERR) |
| 194 | return 0; |
| 195 | |
| 196 | return 1; |
| 197 | } |
| 198 | |
| 199 | //------------------------------------------------------------------------------ |
| 200 | vtkIdType vtkSLACParticleReader::GetNumTuplesInVariable( |
nothing calls this directly
no test coverage detected