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

Method ShouldAddEdge2D

Filters/HyperTree/vtkHyperTreeGridFeatureEdges.cxx:260–274  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

258
259//----------------------------------------------------------------------------------------------
260bool vtkHyperTreeGridFeatureEdges::ShouldAddEdge2D(
261 vtkHyperTreeGridNonOrientedVonNeumannSuperCursor* cursor, unsigned int edgeId)
262{
263 auto neighborVisible = [&cursor](unsigned int neighborId)
264 { return cursor->HasTree(neighborId) && !cursor->IsMasked(neighborId); };
265
266 const unsigned int neighborId = VON_NEUMANN_NEIGH_ID_2D[edgeId];
267
268 // A leaf cell generate an edge if:
269 // - The cell is visible and there is no visible neighbor (of same level) sharing the edge
270 // - The cell is masked and there is a visible neighbor of inferior level (leaf) sharing the edge
271 return (!cursor->IsMasked() && !neighborVisible(neighborId)) ||
272 (cursor->IsMasked() && neighborVisible(neighborId) &&
273 cursor->GetLevel(neighborId) < cursor->GetLevel());
274}
275
276//----------------------------------------------------------------------------------------------
277bool vtkHyperTreeGridFeatureEdges::ShouldAddEdge3D(

Callers 1

Calls 3

HasTreeMethod · 0.45
IsMaskedMethod · 0.45
GetLevelMethod · 0.45

Tested by

no test coverage detected