=============================================================================
| 279 | |
| 280 | //============================================================================= |
| 281 | void vtkExtractPolyDataPiece::AddGhostLevel(vtkPolyData* input, vtkIntArray* cellTags, int level) |
| 282 | { |
| 283 | // for layers of ghost cells after the first we have to search |
| 284 | // the entire input dataset. in the future we can extend this |
| 285 | // function to return the list of cells that we set on our |
| 286 | // level so we only have to search that subset for neighbors |
| 287 | const vtkIdType numCells = input->GetNumberOfCells(); |
| 288 | vtkNew<vtkIdList> cellPointIds; |
| 289 | vtkNew<vtkIdList> neighborIds; |
| 290 | for (vtkIdType idx = 0; idx < numCells; ++idx) |
| 291 | { |
| 292 | if (cellTags->GetValue(idx) == level - 1) |
| 293 | { |
| 294 | input->GetCellPoints(idx, cellPointIds); |
| 295 | const vtkIdType numCellPoints = cellPointIds->GetNumberOfIds(); |
| 296 | for (vtkIdType j = 0; j < numCellPoints; j++) |
| 297 | { |
| 298 | const vtkIdType pointId = cellPointIds->GetId(j); |
| 299 | input->GetPointCells(pointId, neighborIds); |
| 300 | |
| 301 | const vtkIdType numNeighbors = neighborIds->GetNumberOfIds(); |
| 302 | for (vtkIdType k = 0; k < numNeighbors; ++k) |
| 303 | { |
| 304 | const vtkIdType neighborCellId = neighborIds->GetId(k); |
| 305 | if (cellTags->GetValue(neighborCellId) == -1) |
| 306 | { |
| 307 | cellTags->SetValue(neighborCellId, level); |
| 308 | } |
| 309 | } |
| 310 | } |
| 311 | } |
| 312 | } |
| 313 | } |
| 314 | VTK_ABI_NAMESPACE_END |
no test coverage detected