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

Method SetExtent

Common/DataModel/vtkExplicitStructuredGrid.cxx:477–508  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

475
476//------------------------------------------------------------------------------
477void vtkExplicitStructuredGrid::SetExtent(int x0, int x1, int y0, int y1, int z0, int z1)
478{
479 this->Extent[0] = x0;
480 this->Extent[1] = x1;
481 this->Extent[2] = y0;
482 this->Extent[3] = y1;
483 this->Extent[4] = z0;
484 this->Extent[5] = z1;
485
486 if (this->Links)
487 {
488 this->Links->Initialize();
489 }
490
491 vtkIdType expectedCells = (this->Extent[1] - this->Extent[0]) *
492 (this->Extent[3] - this->Extent[2]) * (this->Extent[5] - this->Extent[4]);
493
494 vtkNew<vtkCellArray> cells;
495 cells->UseFixedSize64BitStorage(8);
496 this->SetCells(cells);
497
498 // Initialize the cell array
499 if (expectedCells > 0)
500 {
501 cells->AllocateEstimate(expectedCells, 8);
502 vtkIdType ids[8] = { 0, 0, 0, 0, 0, 0, 0, 0 };
503 for (vtkIdType i = 0; i < expectedCells; i++)
504 {
505 cells->InsertNextCell(8, ids);
506 }
507 }
508}
509
510//------------------------------------------------------------------------------
511void vtkExplicitStructuredGrid::SetExtent(int extent[6])

Callers 3

InternalCopyMethod · 0.95
SetDimensionsMethod · 0.95
CropMethod · 0.95

Calls 5

AllocateEstimateMethod · 0.80
InitializeMethod · 0.45
SetCellsMethod · 0.45
InsertNextCellMethod · 0.45

Tested by

no test coverage detected