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

Method GetNumTuplesInVariable

IO/NetCDF/vtkSLACParticleReader.cxx:200–228  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

198
199//------------------------------------------------------------------------------
200vtkIdType vtkSLACParticleReader::GetNumTuplesInVariable(
201 int ncFD, int varId, int expectedNumComponents)
202{
203 int numDims;
204 CALL_NETCDF_INT(nc_inq_varndims(ncFD, varId, &numDims));
205 if (numDims != 2)
206 {
207 char name[NC_MAX_NAME + 1];
208 CALL_NETCDF_INT(nc_inq_varname(ncFD, varId, name));
209 vtkErrorMacro(<< "Wrong dimensions on " << name);
210 return 0;
211 }
212
213 int dimIds[2];
214 CALL_NETCDF_INT(nc_inq_vardimid(ncFD, varId, dimIds));
215
216 size_t dimLength;
217 CALL_NETCDF_INT(nc_inq_dimlen(ncFD, dimIds[1], &dimLength));
218 if (static_cast<int>(dimLength) != expectedNumComponents)
219 {
220 char name[NC_MAX_NAME + 1];
221 CALL_NETCDF_INT(nc_inq_varname(ncFD, varId, name));
222 vtkErrorMacro(<< "Unexpected tuple size on " << name);
223 return 0;
224 }
225
226 CALL_NETCDF_INT(nc_inq_dimlen(ncFD, dimIds[0], &dimLength));
227 return static_cast<vtkIdType>(dimLength);
228}
229
230//------------------------------------------------------------------------------
231int vtkSLACParticleReader::RequestInformation(vtkInformation* vtkNotUsed(request),

Callers 1

RequestDataMethod · 0.95

Calls 4

nc_inq_varndimsFunction · 0.85
nc_inq_varnameFunction · 0.85
nc_inq_vardimidFunction · 0.85
nc_inq_dimlenFunction · 0.85

Tested by

no test coverage detected