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

Function getUnionFindStructureVerts

source/MRMesh/MRMeshComponents.cpp:856–884  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

854}
855
856UnionFind<VertId> getUnionFindStructureVerts( const MeshTopology& topology, const VertBitSet* region )
857{
858 MR_TIMER;
859
860 const VertBitSet& vertsRegion = topology.getVertIds( region );
861
862 auto test = [region]( VertId v )
863 {
864 if ( !region )
865 return true;
866 else
867 return region->test( v );
868 };
869
870 static_assert( VertBitSet::npos + 1 == 0 );
871 UnionFind<VertId> unionFindStructure( vertsRegion.find_last() + 1 );
872
873 VertId v1;
874 for ( auto v0 : vertsRegion )
875 {
876 for ( auto e : orgRing( topology, v0 ) )
877 {
878 v1 = topology.dest( e );
879 if ( v1.valid() && test( v1 ) && v1 < v0 )
880 unionFindStructure.unite( v0, v1 );
881 }
882 }
883 return unionFindStructure;
884}
885
886UnionFind<VertId> getUnionFindStructureVerts( const Mesh& mesh, const VertBitSet* region )
887{

Callers 9

getComponentVertsFunction · 0.70
getLargestComponentVertsFunction · 0.70
getLargeComponentVertsFunction · 0.70
getComponentsVertsFunction · 0.70
getAllComponentsVertsFunction · 0.70
getAllComponentsEdgesFunction · 0.70

Calls 8

orgRingFunction · 0.85
uniteMethod · 0.80
testMethod · 0.45
find_lastMethod · 0.45
destMethod · 0.45
validMethod · 0.45
lastValidVertMethod · 0.45
orgMethod · 0.45

Tested by

no test coverage detected