------------------------------------------------------------------------------
| 475 | |
| 476 | //------------------------------------------------------------------------------ |
| 477 | void 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 | //------------------------------------------------------------------------------ |
| 511 | void vtkExplicitStructuredGrid::SetExtent(int extent[6]) |
no test coverage detected