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

Method ReadCoordinates

IO/NetCDF/vtkSLACReader.cxx:1355–1377  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

1353
1354//------------------------------------------------------------------------------
1355int vtkSLACReader::ReadCoordinates(int meshFD, vtkMultiBlockDataSet* output)
1356{
1357 // Read in the point coordinates. The coordinates are 3-tuples in an array
1358 // named "coords".
1359 int coordsVarId;
1360 CALL_NETCDF_INT(nc_inq_varid(meshFD, "coords", &coordsVarId));
1361
1362 vtkSmartPointer<vtkDataArray> coordData = this->ReadPointDataArray(meshFD, coordsVarId);
1363 if (!coordData)
1364 return 0;
1365 if (coordData->GetNumberOfComponents() != 3)
1366 {
1367 vtkErrorMacro(<< "Failed sanity check! Coords have wrong dimensions.");
1368 return 0;
1369 }
1370 coordData->SetName("coords");
1371
1372 vtkPoints* points =
1373 vtkPoints::SafeDownCast(output->GetInformation()->Get(vtkSLACReader::POINTS()));
1374 points->SetData(coordData);
1375
1376 return 1;
1377}
1378
1379//------------------------------------------------------------------------------
1380int vtkSLACReader::ReadFieldData(

Callers 1

RequestDataMethod · 0.95

Calls 7

ReadPointDataArrayMethod · 0.95
nc_inq_varidFunction · 0.85
GetNumberOfComponentsMethod · 0.45
SetNameMethod · 0.45
GetMethod · 0.45
GetInformationMethod · 0.45
SetDataMethod · 0.45

Tested by

no test coverage detected