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

Method CountNeighbors

Testing/GenericBridge/vtkBridgeCell.cxx:306–322  ·  view source on GitHub ↗

------------------------------------------------------------------------------ Description: Number of cells (dimension>boundary->GetDimension()) of the dataset that share the boundary `boundary' of `this'. `this' IS NOT INCLUDED. \pre boundary_exists: boundary!=0 \pre real_boundary: !boundary->IsInDataSet() \pre cell_of_the_dataset: IsInDataSet() \pre boundary: HasBoundary(boundary) \post positive

Source from the content-addressed store, hash-verified

304// \pre boundary: HasBoundary(boundary)
305// \post positive_result: result>=0
306int vtkBridgeCell::CountNeighbors(vtkGenericAdaptorCell* boundary)
307{
308 assert("pre: boundary_exists" && boundary != nullptr);
309 assert("pre: real_boundary" && !boundary->IsInDataSet());
310 assert("pre: cell_of_the_dataset" && IsInDataSet());
311
312 vtkIdList* cells = vtkIdList::New();
313 vtkBridgeCell* b = static_cast<vtkBridgeCell*>(boundary);
314 vtkIdList* pts = b->Cell->GetPointIds();
315 this->DataSet->Implementation->GetCellNeighbors(this->Id, pts, cells);
316 int result = cells->GetNumberOfIds();
317 cells->Delete();
318
319 assert("post: positive_result" && result >= 0);
320
321 return result;
322}
323
324//------------------------------------------------------------------------------
325// \pre large_enough: GetDimension()>=2

Callers 2

Calls 7

IsInDataSetMethod · 0.80
DeleteMethod · 0.65
assertFunction · 0.50
NewFunction · 0.50
GetPointIdsMethod · 0.45
GetCellNeighborsMethod · 0.45
GetNumberOfIdsMethod · 0.45

Tested by

no test coverage detected