MeshLib Documentation
Loading...
Searching...
No Matches
MRObjectLoad.h
Go to the documentation of this file.
1#pragma once
2
3#include "MRMeshFwd.h"
4#include "MRIOFilters.h"
6#include "MRExpected.h"
9
10#include <filesystem>
11
12namespace MR
13{
14
17
20{
21 std::string* warnings = nullptr;
23};
24
26MRMESH_API Expected<ObjectMesh> makeObjectMeshFromFile( const std::filesystem::path& file, const MeshLoadInfo& info = {} );
27
29MRMESH_API Expected<std::shared_ptr<Object>> makeObjectFromMeshFile( const std::filesystem::path& file, const MeshLoadInfo& info = {},
30 bool returnOnlyMesh = false );
31
33MRMESH_API Expected<ObjectLines> makeObjectLinesFromFile( const std::filesystem::path& file, ProgressCallback callback = {} );
34
36MRMESH_API Expected<ObjectPoints> makeObjectPointsFromFile( const std::filesystem::path& file, ProgressCallback callback = {} );
37
40
42MRMESH_API Expected<ObjectGcode> makeObjectGcodeFromFile( const std::filesystem::path& file, ProgressCallback callback = {} );
43
51 std::string* loadWarn = nullptr, ProgressCallback callback = {} );
52
53// check if there are any supported files folder and subfolders
54MRMESH_API bool isSupportedFileInSubfolders( const std::filesystem::path& folder );
55
57MRMESH_API Expected<Object> makeObjectTreeFromFolder( const std::filesystem::path& folder, std::string* loadWarn = nullptr, ProgressCallback callback = {} );
58
59//tries to load scene from every format listed in SceneFormatFilters
61 std::string* loadWarn = nullptr, ProgressCallback callback = {} );
62
73 FolderCallback postDecompress = {},
74 ProgressCallback progressCb = {} );
75
85 ProgressCallback progressCb = {} );
86
88
89} // namespace MR
#define MRMESH_API
Definition MRMesh/MRMeshFwd.h:46
std::function< bool(float)> ProgressCallback
Definition MRMesh/MRMeshFwd.h:576
Definition MRCameraOrientationPlugin.h:8
MRMESH_API Expected< std::vector< std::shared_ptr< Object > > > loadObjectFromFile(const std::filesystem::path &filename, std::string *loadWarn=nullptr, ProgressCallback callback={})
load object (mesh, lines, points, voxels or scene) from file
std::function< void(const std::filesystem::path &tempFolderName)> FolderCallback
this callback will be called before compression on serialization and after decompression on deseriali...
Definition MRUniqueTemporaryFolder.h:11
MRMESH_API Expected< std::shared_ptr< Object > > deserializeObjectTree(const std::filesystem::path &path, FolderCallback postDecompress={}, ProgressCallback progressCb={})
loads objects tree from given scene file (zip/mru)
MRMESH_API Expected< ObjectLines > makeObjectLinesFromFile(const std::filesystem::path &file, ProgressCallback callback={})
loads lines from given file in new object
MRMESH_API Expected< std::shared_ptr< Object > > deserializeObjectTreeFromFolder(const std::filesystem::path &folder, ProgressCallback progressCb={})
loads objects tree from given scene folder
tl::expected< T, E > Expected
Definition MRExpected.h:58
MRMESH_API Expected< ObjectDistanceMap > makeObjectDistanceMapFromFile(const std::filesystem::path &file, ProgressCallback callback={})
loads distance map from given file in new object
MRMESH_API Expected< std::shared_ptr< Object > > makeObjectFromMeshFile(const std::filesystem::path &file, const MeshLoadInfo &info={}, bool returnOnlyMesh=false)
loads mesh from given file and makes either ObjectMesh or ObjectPoints (if the file has points but no...
MRMESH_API Expected< ObjectGcode > makeObjectGcodeFromFile(const std::filesystem::path &file, ProgressCallback callback={})
loads gcode from given file in new object
MRMESH_API bool isSupportedFileInSubfolders(const std::filesystem::path &folder)
MRMESH_API Expected< ObjectPoints > makeObjectPointsFromFile(const std::filesystem::path &file, ProgressCallback callback={})
loads points from given file in new object
MRMESH_API Expected< Object > makeObjectTreeFromFolder(const std::filesystem::path &folder, std::string *loadWarn=nullptr, ProgressCallback callback={})
loads meshes from given folder in new container object
MRMESH_API Expected< std::shared_ptr< Object > > loadSceneFromAnySupportedFormat(const std::filesystem::path &path, std::string *loadWarn=nullptr, ProgressCallback callback={})
MRMESH_API Expected< ObjectMesh > makeObjectMeshFromFile(const std::filesystem::path &file, const MeshLoadInfo &info={})
loads mesh from given file in new object
information about loading process and mesh construction from primitives
Definition MRObjectLoad.h:20
std::string * warnings
any warnings during loading will be appended here
Definition MRObjectLoad.h:21
ProgressCallback callback
callback for set progress and stop process
Definition MRObjectLoad.h:22