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

Method deactivateFarDistPairs_

source/MRMesh/MRMultiwayICP.cpp:798–828  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

796}
797
798void MultiwayICP::deactivateFarDistPairs_( ICPLayer l )
799{
800 MR_TIMER;
801 auto& pairs = pairsGridPerLayer_[l];
802 Vector<float, ICPElementId> maxDistSq( pairs.size() );
803 for ( int it = 0; it < 3; ++it )
804 {
805 ParallelFor( maxDistSq, [&] ( auto id )
806 {
807 maxDistSq[id] = sqr( prop_.farDistFactor * MR::calcMeanSqDistToPointEx( pairs, id ) );
808 } );
809
810 tbb::enumerable_thread_specific<size_t> counters( 0 );
811 ParallelFor( size_t( 0 ), pairs.size() * pairs.size(), [&] ( size_t r )
812 {
813 auto i = ICPElementId( r % pairs.size() );
814 auto j = ICPElementId( r / pairs.size() );
815 if ( i == j )
816 return;
817 if ( maxDistSq[i] >= prop_.distThresholdSq )
818 return;
819 counters.local() += MR::deactivateFarPairs( pairs[i][j], maxDistSq[i] );
820 } );
821
822 size_t numDeactivated = 0;
823 for ( auto counter : counters )
824 numDeactivated += counter;
825 if ( numDeactivated == 0 )
826 break;
827 }
828}
829
830bool MultiwayICP::doIteration_( bool p2pl )
831{

Callers

nothing calls this directly

Calls 5

ParallelForFunction · 0.85
calcMeanSqDistToPointExFunction · 0.85
deactivateFarPairsFunction · 0.85
sqrFunction · 0.70
sizeMethod · 0.45

Tested by

no test coverage detected