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

Method AddGhostLevel

Filters/Parallel/vtkExtractPolyDataPiece.cxx:281–313  ·  view source on GitHub ↗

=============================================================================

Source from the content-addressed store, hash-verified

279
280//=============================================================================
281void 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}
314VTK_ABI_NAMESPACE_END

Callers 2

RequestDataMethod · 0.95
RequestDataMethod · 0.45

Calls 7

GetNumberOfCellsMethod · 0.45
GetValueMethod · 0.45
GetCellPointsMethod · 0.45
GetNumberOfIdsMethod · 0.45
GetIdMethod · 0.45
GetPointCellsMethod · 0.45
SetValueMethod · 0.45

Tested by

no test coverage detected