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

Method GetNeighbors

Filters/Geometry/vtkStructuredGridConnectivity.cxx:217–243  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

215
216//------------------------------------------------------------------------------
217vtkIdList* vtkStructuredGridConnectivity::GetNeighbors(int gridID, int* extents)
218{
219 assert("pre: input extents array is nullptr" && (extents != nullptr));
220
221 int N = this->GetNumberOfNeighbors(gridID);
222 if (N < 1)
223 {
224 return nullptr;
225 }
226
227 vtkIdList* neiList = vtkIdList::New();
228 neiList->SetNumberOfIds(N);
229
230 unsigned int nei = 0;
231 for (; nei < this->Neighbors[gridID].size(); ++nei)
232 {
233 vtkIdType neiId = this->Neighbors[gridID][nei].NeighborID;
234 neiList->SetId(nei, neiId);
235 for (int i = 0; i < 6; ++i)
236 {
237 extents[nei * 6 + i] = this->Neighbors[gridID][nei].OverlapExtent[i];
238 }
239 } // END for all neighbors
240
241 assert("post: N==neiList.size()" && (N == neiList->GetNumberOfIds()));
242 return (neiList);
243}
244
245//------------------------------------------------------------------------------
246void vtkStructuredGridConnectivity::ComputeNeighbors()

Callers

nothing calls this directly

Calls 7

SetNumberOfIdsMethod · 0.80
assertFunction · 0.50
NewFunction · 0.50
GetNumberOfNeighborsMethod · 0.45
sizeMethod · 0.45
SetIdMethod · 0.45
GetNumberOfIdsMethod · 0.45

Tested by

no test coverage detected