MCPcopy Create free account
hub / github.com/ThatOpen/engine_web-ifc / OpenModel

Function OpenModel

src/cpp/wasm/web-ifc-wasm.cpp:52–64  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

50}
51
52int OpenModel(webifc::manager::LoaderSettings settings, emscripten::val callback)
53{
54 auto modelID = manager.CreateModel(settings);
55 const std::function<uint32_t(char *, size_t, size_t)> loaderFunc = [callback](char *dest, size_t sourceOffset, size_t destSize)
56 {
57 emscripten::val retVal = callback((uint32_t)dest, sourceOffset, destSize);
58 uint32_t len = retVal.as<uint32_t>();
59 return len;
60 };
61
62 manager.GetIfcLoader(modelID)->LoadFile(loaderFunc);
63 return modelID;
64}
65
66void SaveModel(uint32_t modelID, emscripten::val callback)
67{

Callers

nothing calls this directly

Calls 4

callbackFunction · 0.85
LoadFileMethod · 0.80
GetIfcLoaderMethod · 0.80
CreateModelMethod · 0.45

Tested by

no test coverage detected