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

Function getComponents

source/MRMesh/MRMeshComponents.cpp:170–195  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

168}
169
170FaceBitSet getComponents( const MeshTopology& topology, const FaceBitSet & seeds, const FaceBitSet* region0,
171 FaceIncidence incidence, const UndirectedEdgeBitSet * isCompBd )
172{
173 MR_TIMER;
174
175 FaceBitSet res;
176 if ( seeds.none() )
177 return res;
178
179 auto unionFindStruct = getUnionFindStructureFaces( topology, region0, incidence, isCompBd );
180 const FaceBitSet& region = topology.getFaceIds( region0 );
181
182 const auto& allRoots = unionFindStruct.roots();
183 // collect the roots of all components that contain a seed
184 FaceBitSet seedRoots( allRoots.size() );
185 for ( auto s : seeds )
186 seedRoots.set( allRoots[s] );
187
188 res.resize( allRoots.size() );
189 BitSetParallelFor( region, [&]( FaceId f )
190 {
191 if ( seedRoots.test( allRoots[f] ) )
192 res.set( f );
193 } );
194 return res;
195}
196
197FaceBitSet getComponents( const MeshPart& meshPart, const FaceBitSet & seeds, FaceIncidence incidence, const UndirectedEdgeBitSet * isCompBd )
198{

Callers 3

EMSCRIPTEN_BINDINGSFunction · 0.85
expandToComponentsFunction · 0.85
separateClosedContourFunction · 0.85

Calls 7

BitSetParallelForFunction · 0.85
noneMethod · 0.80
sizeMethod · 0.45
setMethod · 0.45
resizeMethod · 0.45
testMethod · 0.45

Tested by

no test coverage detected