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

Method GetCellNeighbors

Common/DataModel/vtkStructuredGrid.cxx:185–214  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

183
184//------------------------------------------------------------------------------
185void vtkStructuredGrid::GetCellNeighbors(vtkIdType cellId, vtkIdList* ptIds, vtkIdList* cellIds)
186{
187 int numPtIds = ptIds->GetNumberOfIds();
188
189 // Use special methods for speed
190 switch (numPtIds)
191 {
192 case 0:
193 cellIds->Reset();
194 return;
195
196 case 1:
197 case 2:
198 case 4: // vertex, edge, face neighbors
199 vtkStructuredData::GetCellNeighbors(cellId, ptIds, cellIds, this->Dimensions);
200 break;
201
202 default:
203 this->Superclass::GetCellNeighbors(cellId, ptIds, cellIds);
204 }
205
206 // If blanking, remove blanked cells.
207 if (this->GetPointGhostArray() || this->GetCellGhostArray())
208 {
209 vtkIdType* pCellIds = cellIds->GetPointer(0);
210 vtkIdType* end =
211 std::remove_if(pCellIds, pCellIds + cellIds->GetNumberOfIds(), CellVisibility(this));
212 cellIds->Resize(std::distance(pCellIds, end));
213 }
214}
215
216//------------------------------------------------------------------------------
217void vtkStructuredGrid::GetCellNeighbors(

Callers

nothing calls this directly

Calls 10

GetCellNeighborsFunction · 0.85
remove_ifFunction · 0.85
GetPointGhostArrayMethod · 0.80
GetCellGhostArrayMethod · 0.80
CellVisibilityClass · 0.70
distanceFunction · 0.50
GetNumberOfIdsMethod · 0.45
ResetMethod · 0.45
GetPointerMethod · 0.45
ResizeMethod · 0.45

Tested by

no test coverage detected