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

Function EMSCRIPTEN_BINDINGS

source/MRWasmModule/MRWasmMultiwayICP.cpp:13–48  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

11using namespace MR;
12
13EMSCRIPTEN_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}

Callers

nothing calls this directly

Calls 7

push_backMethod · 0.80
updateAllPointPairsMethod · 0.80
valueMethod · 0.45
reserveMethod · 0.45
getMeanSqDistToPointMethod · 0.45
getMeanSqDistToPlaneMethod · 0.45

Tested by

no test coverage detected