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

Method min

source/MRMesh/MRDistanceMap.cpp:987–1024  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

985}
986
987DistanceMap DistanceMap::min( const DistanceMap& rhs) const
988{
989 DistanceMap res( resX(), resY() );
990 for ( auto iY = 0; iY < resY(); iY++ )
991 {
992 for ( auto iX = 0; iX < resX(); iX++ )
993 {
994 const auto val = get( iX, iY );
995 if ( iX < rhs.resX() && iY < rhs.resY() )
996 {
997 const auto valrhs = rhs.get( iX, iY );
998 if ( val )
999 {
1000 if ( valrhs )
1001 {
1002 res.set( iX, iY, std::min( *val, *valrhs ) );
1003 }
1004 else
1005 {
1006 res.set( iX, iY, *val );
1007 }
1008 }
1009 else
1010 {
1011 if ( valrhs )
1012 {
1013 res.set( iX, iY, *valrhs );
1014 }
1015 }
1016 }
1017 else
1018 {
1019 res.set( iX, iY, *val );
1020 }
1021 }
1022 }
1023 return res;
1024}
1025
1026const DistanceMap& DistanceMap::mergeMin( const DistanceMap& rhs )
1027{

Callers 15

updateEventsFunction · 0.80
setWasmLoadProgressFunction · 0.80
roundtrip.test.mjsFile · 0.80
setActiveBoundsMethod · 0.80
MRObjectVoxels.cppFile · 0.80
fixGridByAccessorFunction · 0.80
translateToZeroFunction · 0.80
VoxelsVolumeAccessorMethod · 0.80
mask2setFunction · 0.80
getInstanceSeedsFunction · 0.80
operator()Method · 0.80
voxelFilterFunction · 0.80

Calls 6

minFunction · 0.85
resXMethod · 0.80
resYMethod · 0.80
getFunction · 0.70
getMethod · 0.45
setMethod · 0.45

Tested by

no test coverage detected