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

Method CanReadFile

IO/NetCDF/vtkSLACParticleReader.cxx:181–197  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

179
180//------------------------------------------------------------------------------
181int 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//------------------------------------------------------------------------------
200vtkIdType vtkSLACParticleReader::GetNumTuplesInVariable(

Callers

nothing calls this directly

Calls 2

nc_inq_varidFunction · 0.85
ValidMethod · 0.45

Tested by

no test coverage detected