| 407 | } |
| 408 | |
| 409 | void vtkExtractUnstructuredGridPiece::AddGhostLevel( |
| 410 | vtkUnstructuredGrid* input, vtkIntArray* cellTags, int level) |
| 411 | { |
| 412 | // for layers of ghost cells after the first we have to search |
| 413 | // the entire input dataset. in the future we can extend this |
| 414 | // function to return the list of cells that we set on our |
| 415 | // level so we only have to search that subset for neighbors |
| 416 | const vtkIdType numCells = input->GetNumberOfCells(); |
| 417 | vtkNew<vtkIdList> cellPointIds; |
| 418 | vtkNew<vtkIdList> neighborIds; |
| 419 | for (vtkIdType idx = 0; idx < numCells; ++idx) |
| 420 | { |
| 421 | if (cellTags->GetValue(idx) == level - 1) |
| 422 | { |
| 423 | input->GetCellPoints(idx, cellPointIds); |
| 424 | const vtkIdType numCellPoints = cellPointIds->GetNumberOfIds(); |
| 425 | for (vtkIdType j = 0; j < numCellPoints; j++) |
| 426 | { |
| 427 | const vtkIdType pointId = cellPointIds->GetId(j); |
| 428 | input->GetPointCells(pointId, neighborIds); |
| 429 | |
| 430 | const vtkIdType numNeighbors = neighborIds->GetNumberOfIds(); |
| 431 | for (vtkIdType k = 0; k < numNeighbors; ++k) |
| 432 | { |
| 433 | const vtkIdType neighborCellId = neighborIds->GetId(k); |
| 434 | if (cellTags->GetValue(neighborCellId) == -1) |
| 435 | { |
| 436 | cellTags->SetValue(neighborCellId, level); |
| 437 | } |
| 438 | } |
| 439 | } |
| 440 | } |
| 441 | } |
| 442 | } |
| 443 | VTK_ABI_NAMESPACE_END |
no test coverage detected