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

Method GetNumberOfCellsUsingEdge

Common/DataModel/vtkSimpleCellTessellator.cxx:2553–2579  ·  view source on GitHub ↗

------------------------------------------------------------------------------ Return number of cells using edge #edgeId

Source from the content-addressed store, hash-verified

2551//------------------------------------------------------------------------------
2552// Return number of cells using edge #edgeId
2553int vtkSimpleCellTessellator::GetNumberOfCellsUsingEdge(int edgeId)
2554{
2555 assert("pre: valid_range" && edgeId >= 0); // && edgeId<=5);
2556#if SLOW_API
2557 int result = 0;
2558 this->GenericCell->GetBoundaryIterator(this->CellIterator, 1);
2559 this->CellIterator->Begin();
2560
2561 int i = 0;
2562 while (!this->CellIterator->IsAtEnd() && (i < edgeId))
2563 {
2564 this->CellIterator->Next();
2565 ++i;
2566 }
2567
2568 assert("check: cell_found" && i == edgeId);
2569 // +1 because CountNeighbors does not include the cell itself.
2570 result = this->GenericCell->CountNeighbors(this->CellIterator->GetCell()) + 1;
2571 return result;
2572#else
2573 // The cell with the greatest number of edges is the hexagonal prism
2574 // 6*2+6
2575 int edgeSharing[18];
2576 this->GenericCell->CountEdgeNeighbors(edgeSharing);
2577 return edgeSharing[edgeId] + 1;
2578#endif
2579}
2580
2581//------------------------------------------------------------------------------
2582// Return number of cells using face #faceId

Callers 1

Calls 8

GetBoundaryIteratorMethod · 0.80
CountNeighborsMethod · 0.80
CountEdgeNeighborsMethod · 0.80
assertFunction · 0.50
BeginMethod · 0.45
IsAtEndMethod · 0.45
NextMethod · 0.45
GetCellMethod · 0.45

Tested by

no test coverage detected