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

Method CanReadFile

IO/NetCDF/vtkSLACReader.cxx:565–581  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

563
564//------------------------------------------------------------------------------
565int vtkSLACReader::CanReadFile(const char* filename)
566{
567 vtkSLACReaderAutoCloseNetCDF ncFD(filename, NC_NOWRITE, true);
568 if (!ncFD.Valid())
569 return 0;
570
571 // Check for the existence of several arrays we know should be in the file.
572 int dummy;
573 if (nc_inq_varid(ncFD, "coords", &dummy) != NC_NOERR)
574 return 0;
575 if (nc_inq_varid(ncFD, "tetrahedron_interior", &dummy) != NC_NOERR)
576 return 0;
577 if (nc_inq_varid(ncFD, "tetrahedron_exterior", &dummy) != NC_NOERR)
578 return 0;
579
580 return 1;
581}
582
583//------------------------------------------------------------------------------
584void vtkSLACReader::AddModeFileName(const char* fname)

Callers

nothing calls this directly

Calls 2

nc_inq_varidFunction · 0.85
ValidMethod · 0.45

Tested by

no test coverage detected