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

Function getVertexOrdering

source/MRMesh/MREdgePaths.cpp:384–415  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

382}
383
384std::vector<VertId> getVertexOrdering( const MeshTopology & topology, VertBitSet region )
385{
386 MR_TIMER;
387
388 auto metric = [&]( EdgeId e )
389 {
390 return region.test( topology.dest( e ) ) ? 1.0f : FLT_MAX;
391 };
392 EdgePathsBuilder b( topology, metric );
393
394 std::vector<VertId> res;
395 res.reserve( region.count() );
396 auto addToRes = [&]( VertId v )
397 {
398 region.reset( v );
399 res.push_back( v );
400 };
401
402 while ( auto v0 = region.find_first() )
403 {
404 addToRes( v0 );
405 b.addStart( v0, 0 );
406 for(;;)
407 {
408 auto vinfo = b.growOneEdge();
409 if ( !vinfo.v )
410 break;
411 addToRes( vinfo.v );
412 }
413 }
414 return res;
415}
416
417std::vector<EdgeLoop> extractClosedLoops( const MeshTopology & topology, EdgeBitSet & edges )
418{

Callers

nothing calls this directly

Calls 9

countMethod · 0.80
push_backMethod · 0.80
testMethod · 0.45
destMethod · 0.45
reserveMethod · 0.45
resetMethod · 0.45
find_firstMethod · 0.45
addStartMethod · 0.45
growOneEdgeMethod · 0.45

Tested by

no test coverage detected