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

Function getUniqueRootIds

source/MRMesh/MRMeshComponents.cpp:24–40  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

22/// 2. the total number of roots/regions
23template<typename T>
24static std::pair<Vector<RegionId, Id<T>>, int> getUniqueRootIds( const Vector<Id<T>, Id<T>>& allRoots, const TaggedBitSet<T>& region )
25{
26 MR_TIMER;
27 Vector<RegionId, Id<T>> uniqueRootsMap( allRoots.size() );
28 int k = 0;
29 for ( auto f : region )
30 {
31 auto& uniqIndex = uniqueRootsMap[allRoots[f]];
32 if ( uniqIndex < 0 )
33 {
34 uniqIndex = RegionId( k );
35 ++k;
36 }
37 uniqueRootsMap[f] = uniqIndex;
38 }
39 return { std::move( uniqueRootsMap ), k };
40}
41
42FaceBitSet getComponent( const MeshPart& meshPart, FaceId id, FaceIncidence incidence, const UndirectedEdgeBitSet * isCompBd )
43{

Callers 6

getLargestComponentFunction · 0.70
getAllComponentsMapFunction · 0.70
getFacePairRegionMapFunction · 0.70
getAllComponentsVertsFunction · 0.70

Calls 1

sizeMethod · 0.45

Tested by

no test coverage detected