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

Method RequestInformation

IO/NetCDF/vtkSLACParticleReader.cxx:231–256  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

229
230//------------------------------------------------------------------------------
231int vtkSLACParticleReader::RequestInformation(vtkInformation* vtkNotUsed(request),
232 vtkInformationVector** vtkNotUsed(inputVector), vtkInformationVector* outputVector)
233{
234 if (!this->FileName)
235 {
236 vtkErrorMacro("No filename specified.");
237 return 0;
238 }
239
240 vtkSLACParticleReaderAutoCloseNetCDF ncFD(this->FileName, NC_NOWRITE);
241 if (!ncFD.Valid())
242 return 0;
243
244 int timeVar;
245 CALL_NETCDF_INT(nc_inq_varid(ncFD(), "time", &timeVar));
246 double timeValue;
247 CALL_NETCDF_INT(nc_get_var_double(ncFD(), timeVar, &timeValue));
248
249 vtkInformation* outInfo = outputVector->GetInformationObject(0);
250 outInfo->Set(vtkStreamingDemandDrivenPipeline::TIME_STEPS(), &timeValue, 1);
251 double timeRange[2];
252 timeRange[0] = timeRange[1] = timeValue;
253 outInfo->Set(vtkStreamingDemandDrivenPipeline::TIME_RANGE(), timeRange, 2);
254
255 return 1;
256}
257
258//------------------------------------------------------------------------------
259int vtkSLACParticleReader::RequestData(vtkInformation* vtkNotUsed(request),

Callers

nothing calls this directly

Calls 5

nc_inq_varidFunction · 0.85
nc_get_var_doubleFunction · 0.85
GetInformationObjectMethod · 0.80
ValidMethod · 0.45
SetMethod · 0.45

Tested by

no test coverage detected