| 427 | } |
| 428 | |
| 429 | VertBitSet getComponentsVerts( const Mesh& mesh, const VertBitSet& seeds, const VertBitSet* region /*= nullptr */ ) |
| 430 | { |
| 431 | MR_TIMER; |
| 432 | |
| 433 | VertBitSet res; |
| 434 | if ( seeds.none() ) |
| 435 | return res; |
| 436 | |
| 437 | auto unionFindStruct = getUnionFindStructureVerts( mesh, region ); |
| 438 | const VertBitSet& vertRegion = mesh.topology.getVertIds( region ); |
| 439 | |
| 440 | VertId vertRoot; |
| 441 | for ( auto s : seeds ) |
| 442 | { |
| 443 | if ( vertRoot < 0 ) |
| 444 | vertRoot = unionFindStruct.find( s ); |
| 445 | else |
| 446 | vertRoot = unionFindStruct.unite( vertRoot, s ).first; |
| 447 | } |
| 448 | |
| 449 | if ( vertRoot ) |
| 450 | { |
| 451 | const auto& allRoots = unionFindStruct.roots(); |
| 452 | res.resize( allRoots.size() ); |
| 453 | BitSetParallelFor( vertRegion, [&]( VertId v ) |
| 454 | { |
| 455 | if ( allRoots[v] == vertRoot ) |
| 456 | res.set( v ); |
| 457 | } ); |
| 458 | } |
| 459 | return res; |
| 460 | } |
| 461 | |
| 462 | size_t getNumComponents( const MeshPart& meshPart, FaceIncidence incidence, const UndirectedEdgeBitSet * isCompBd ) |
| 463 | { |
nothing calls this directly
no test coverage detected