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

Method resampleUpperLayers_

source/MRMesh/MRMultiwayICP.cpp:625–653  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

623}
624
625std::optional<MultiwayICP::LayerSamples> MultiwayICP::resampleUpperLayers_( const ProgressCallback& cb )
626{
627 MR_TIMER;
628 if ( pairsGridPerLayer_.size() < 2 )
629 return {};
630
631 auto numLayers = cascadeIndexer_->getNumLayers();
632 LayerSamples samples( numLayers );
633 for ( ICPLayer l = 1; l < numLayers; ++l )
634 {
635 auto& layerSamples = samples[l];
636 layerSamples.resize( cascadeIndexer_->getNumElements( l ) );
637 bool keepGoing = ParallelFor( layerSamples, [&] ( ICPElementId gId )
638 {
639 const auto& layerLeaves = cascadeIndexer_->getElementLeaves( l, gId );
640 Vector<ModelPointsData, ObjId> groupData;
641 groupData.reserve( layerLeaves.count() );
642 for ( ObjId oId : layerLeaves )
643 {
644 const auto& obj = objs_[oId];
645 groupData.emplace_back( ModelPointsData{ .points = &obj.obj.points(), .validPoints = &obj.obj.validPoints(),.xf = &obj.xf,.fakeObjId = oId } );
646 }
647 layerSamples[gId] = *multiModelGridSampling( groupData, samplingSize_ );
648 }, subprogress( cb, float( l - 1 ) / float( numLayers - 1 ), float( l ) / float( numLayers - 1 ) ) );
649 if ( !keepGoing )
650 return {};
651 }
652 return samples;
653}
654
655bool MultiwayICP::reserveUpperLayerPairs_( LayerSamples&& samples, const ProgressCallback& cb )
656{

Callers

nothing calls this directly

Calls 10

ParallelForFunction · 0.85
multiModelGridSamplingFunction · 0.85
subprogressFunction · 0.85
countMethod · 0.80
sizeMethod · 0.45
getNumLayersMethod · 0.45
resizeMethod · 0.45
getNumElementsMethod · 0.45
getElementLeavesMethod · 0.45
reserveMethod · 0.45

Tested by

no test coverage detected