| 11 | using namespace MR; |
| 12 | |
| 13 | EMSCRIPTEN_BINDINGS( meshlib_multiway_icp ) |
| 14 | { |
| 15 | emscripten::enum_<MultiwayICPSamplingParameters::CascadeMode>( "CascadeMode" ) |
| 16 | .value( "Sequential", MultiwayICPSamplingParameters::CascadeMode::Sequential ) |
| 17 | .value( "AABBTreeBased", MultiwayICPSamplingParameters::CascadeMode::AABBTreeBased ); |
| 18 | |
| 19 | emscripten::class_<MultiwayICPSamplingParameters>( "MultiwayICPSamplingParameters" ) |
| 20 | .constructor<>() |
| 21 | .property( "samplingVoxelSize", &MultiwayICPSamplingParameters::samplingVoxelSize ) |
| 22 | .property( "maxGroupSize", &MultiwayICPSamplingParameters::maxGroupSize ) |
| 23 | .property( "cascadeMode", &MultiwayICPSamplingParameters::cascadeMode ); |
| 24 | |
| 25 | emscripten::class_<MultiwayICP>( "MultiwayICP" ) |
| 26 | .constructor( +[]( const emscripten::val& objects, const MultiwayICPSamplingParameters& params ) |
| 27 | { |
| 28 | ICPObjects objs; |
| 29 | const size_t n = objects[ "length" ].as<size_t>(); |
| 30 | objs.reserve( n ); |
| 31 | for ( size_t i = 0; i < n; ++i ) |
| 32 | objs.push_back( objects[ i ].as<MeshOrPointsXf>() ); |
| 33 | return new MultiwayICP( objs, params ); |
| 34 | }, emscripten::allow_raw_pointers() ) |
| 35 | .function( "calculateTransformations", +[]( MultiwayICP& self ) |
| 36 | { |
| 37 | return Wasm::packedToTypedArray<Vector<AffineXf3f, ObjId>, float, 12>( self.calculateTransformations() ); |
| 38 | } ) |
| 39 | .function( "resamplePoints", &MultiwayICP::resamplePoints ) |
| 40 | .function( "updateAllPointPairs", +[]( MultiwayICP& self ) { return self.updateAllPointPairs(); } ) |
| 41 | .function( "setParams", &MultiwayICP::setParams ) |
| 42 | .function( "getParams", +[]( const MultiwayICP& self ) { return self.getParams(); } ) |
| 43 | .function( "getMeanSqDistToPoint", +[]( const MultiwayICP& self ) { return self.getMeanSqDistToPoint(); } ) |
| 44 | .function( "getMeanSqDistToPlane", +[]( const MultiwayICP& self ) { return self.getMeanSqDistToPlane(); } ) |
| 45 | .function( "getNumSamples", &MultiwayICP::getNumSamples ) |
| 46 | .function( "getNumActivePairs", &MultiwayICP::getNumActivePairs ) |
| 47 | .function( "getStatusInfo", &MultiwayICP::getStatusInfo ); |
| 48 | } |
nothing calls this directly
no test coverage detected