MCPcopy Create free account
hub / github.com/MeshInspector/MeshLib / getComponent

Function getComponent

source/MRMesh/MRPolylineComponents.cpp:68–83  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

66}
67
68UndirectedEdgeBitSet getComponent( const PolylineTopology& topology, UndirectedEdgeId id )
69{
70 MR_TIMER;
71 auto unionFindStruct = getUnionFindStructure( topology );
72
73 int edgeRoot = unionFindStruct.find( id );
74 const auto& allRoots = unionFindStruct.roots();
75 UndirectedEdgeBitSet res;
76 res.resize( allRoots.size() );
77 for ( auto u : undirectedEdges( topology ) )
78 {
79 if ( allRoots[u] == edgeRoot )
80 res.set( u );
81 }
82 return res;
83}
84
85std::pair<std::vector<UndirectedEdgeBitSet>, int> getAllComponents( const PolylineTopology& topology, int maxComponentCount )
86{

Callers

nothing calls this directly

Calls 6

getUnionFindStructureFunction · 0.85
undirectedEdgesFunction · 0.70
findMethod · 0.45
resizeMethod · 0.45
sizeMethod · 0.45
setMethod · 0.45

Tested by

no test coverage detected