MeshLib C++ Docs
Loading...
Searching...
No Matches
MRSceneLoad.h
Go to the documentation of this file.
1#pragma once
2
3#include "MRObject.h"
4#include "MRUnitInfo.h"
5#include <optional>
6
7namespace MR::SceneLoad
8{
9
10struct Settings
11{
14 std::optional<LengthUnit> targetUnit;
15
17 ProgressCallback progress;
18
21 using OpenFolder = std::function<Expected<LoadedObjects>( const std::filesystem::path&, const ProgressCallback& )>;
22 OpenFolder openFolder;
23};
24
26struct Result
27{
29 std::shared_ptr<SceneRootObject> scene;
31 bool isSceneConstructed = false;
33 std::vector<std::filesystem::path> loadedFiles;
35 // TODO: user-defined error format
36 std::string errorSummary;
38 // TODO: user-defined warning format
39 std::string warningSummary;
40};
41
44MRMESH_API Result fromAnySupportedFormat( const std::vector<std::filesystem::path>& files, const Settings& settings = {} );
45
48using PostLoadCallback = std::function<void ( Result )>;
49MRMESH_API void asyncFromAnySupportedFormat( const std::vector<std::filesystem::path>& files, const PostLoadCallback& postLoadCallback, const Settings& settings = {} );
50
51} // namespace MR::SceneLoad
#define MRMESH_API
Definition MRMeshFwd.h:80
Definition MRSceneLoad.h:27
new unsafe MR.Std.String errorSummary
new unsafe MR.Std.String warningSummary
new unsafe ref bool isSceneConstructed
new unsafe MR.SceneRootObject scene
new unsafe MR.Std.Vector_StdFilesystemPath loadedFiles
Definition MRSceneLoad.h:11
new unsafe MR.Std.Optional_MRLengthUnit targetUnit
new unsafe MR.Std.Function_BoolFuncFromFloat progress
Definition MRIOFormatsRegistry.h:346
MRMESH_API Result fromAnySupportedFormat(const std::vector< std::filesystem::path > &files, const Settings &settings={})
MRMESH_API void asyncFromAnySupportedFormat(const std::vector< std::filesystem::path > &files, const PostLoadCallback &postLoadCallback, const Settings &settings={})