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

Function deserializeObjectTreeFrom3mf

source/MRIOExtras/MR3mf.cpp:1331–1353  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1329}
1330
1331Expected<LoadedObject> deserializeObjectTreeFrom3mf( const std::filesystem::path& path, const ProgressCallback& callback )
1332{
1333 const UniqueTemporaryFolder tmpFolder;
1334
1335 auto resZip = decompressZip( path, tmpFolder );
1336 if ( !resZip )
1337 return unexpected( "ZIP container error: " + resZip.error() );
1338
1339 if ( !reportProgress( callback, 0.1f ) )
1340 return unexpectedOperationCanceled();
1341
1342 std::vector<std::filesystem::path> files;
1343 std::error_code ec;
1344
1345 for ( auto const& dirEntry : DirectoryRecursive{ tmpFolder, ec } )
1346 if ( !dirEntry.is_directory( ec ) )
1347 files.push_back( dirEntry.path() );
1348
1349 if ( files.empty() )
1350 return unexpected( "Could not find .model" );
1351
1352 return ThreeMFLoader{}.load( files, tmpFolder, subprogress( callback, 0.1f, 0.9f ) );
1353}
1354
1355Expected<LoadedObject> deserializeObjectTreeFromModel( const std::filesystem::path& path, const ProgressCallback& callback )
1356{

Callers

nothing calls this directly

Calls 9

decompressZipFunction · 0.85
reportProgressFunction · 0.85
subprogressFunction · 0.85
errorMethod · 0.80
push_backMethod · 0.80
unexpectedFunction · 0.50
emptyMethod · 0.45
loadMethod · 0.45

Tested by

no test coverage detected