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

Method FakeStructuredCoordinates

IO/NetCDF/vtkNetCDFCFReader.cxx:1364–1386  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

1362
1363//------------------------------------------------------------------------------
1364void vtkNetCDFCFReader::FakeStructuredCoordinates(vtkStructuredGrid* structuredOutput)
1365{
1366 int extent[6];
1367 structuredOutput->GetExtent(extent);
1368
1369 vtkNew<vtkPoints> points;
1370 points->SetDataTypeToDouble();
1371 points->Allocate(
1372 (extent[1] - extent[0] + 1) * (extent[3] - extent[2] + 1) * (extent[5] - extent[4] + 1));
1373
1374 for (int kIndex = extent[4]; kIndex <= extent[5]; kIndex++)
1375 {
1376 for (int jIndex = extent[2]; jIndex <= extent[3]; jIndex++)
1377 {
1378 for (int iIndex = extent[0]; iIndex <= extent[1]; iIndex++)
1379 {
1380 points->InsertNextPoint(iIndex, jIndex, kIndex);
1381 }
1382 }
1383 }
1384
1385 structuredOutput->SetPoints(points);
1386}
1387
1388//------------------------------------------------------------------------------
1389void vtkNetCDFCFReader::Add1DRectilinearCoordinates(

Callers 1

RequestDataMethod · 0.95

Calls 4

GetExtentMethod · 0.45
AllocateMethod · 0.45
InsertNextPointMethod · 0.45
SetPointsMethod · 0.45

Tested by

no test coverage detected