MeshLib Documentation
Loading...
Searching...
No Matches
MRSceneLoad.h
Go to the documentation of this file.
1#pragma once
2
3#include "MRObject.h"
4
5namespace MR::SceneLoad
6{
7
10{
12 std::shared_ptr<SceneRootObject> scene;
14 bool isSceneConstructed = false;
16 std::vector<std::filesystem::path> loadedFiles;
18 // TODO: user-defined error format
19 std::string errorSummary;
21 // TODO: user-defined warning format
22 std::string warningSummary;
23};
24
26MRMESH_API SceneLoadResult fromAnySupportedFormat( const std::vector<std::filesystem::path>& files, ProgressCallback callback = {} );
27
30using PostLoadCallback = std::function<void ( SceneLoadResult )>;
31MRMESH_API void asyncFromAnySupportedFormat( const std::vector<std::filesystem::path>& files, PostLoadCallback postLoadCallback, ProgressCallback progressCallback = {} );
32
33} // namespace MR::SceneLoad
#define MRMESH_API
Definition MRMesh/MRMeshFwd.h:46
std::function< bool(float)> ProgressCallback
Definition MRMesh/MRMeshFwd.h:576
Definition MRIOFormatsRegistry.h:332
MRMESH_API SceneLoadResult fromAnySupportedFormat(const std::vector< std::filesystem::path > &files, ProgressCallback callback={})
Load scene from file.
MRMESH_API void asyncFromAnySupportedFormat(const std::vector< std::filesystem::path > &files, PostLoadCallback postLoadCallback, ProgressCallback progressCallback={})
std::function< void(SceneLoadResult)> PostLoadCallback
Definition MRSceneLoad.h:30
Scene loading result.
Definition MRSceneLoad.h:10
std::string errorSummary
Error summary text.
Definition MRSceneLoad.h:19
std::shared_ptr< SceneRootObject > scene
The loaded scene or empty object.
Definition MRSceneLoad.h:12
std::string warningSummary
Warning summary text.
Definition MRSceneLoad.h:22
bool isSceneConstructed
Marks whether the scene was loaded from a single file (false) or was built from scratch (true)
Definition MRSceneLoad.h:14
std::vector< std::filesystem::path > loadedFiles
List of successfully loaded files.
Definition MRSceneLoad.h:16