MeshLib C++ Docs
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#include "MRLoadedObjects.h"
10
11#include <filesystem>
12
13namespace MR
14{
15
18
20MRMESH_API Expected<LoadedObjectMesh> makeObjectMeshFromFile( const std::filesystem::path& file, const ProgressCallback& cb = {} );
21
23MRMESH_API Expected<LoadedObject> makeObjectFromMeshFile( const std::filesystem::path& file, const ProgressCallback& cb = {},
24 bool returnOnlyMesh = false );
25
27MRMESH_API Expected<ObjectLines> makeObjectLinesFromFile( const std::filesystem::path& file, ProgressCallback callback = {} );
28
30MRMESH_API Expected<ObjectPoints> makeObjectPointsFromFile( const std::filesystem::path& file, ProgressCallback callback = {} );
31
34
36MRMESH_API Expected<ObjectGcode> makeObjectGcodeFromFile( const std::filesystem::path& file, ProgressCallback callback = {} );
37
42MRMESH_API Expected<LoadedObjects> loadObjectFromFile( const std::filesystem::path& filename, const ProgressCallback& callback = {} );
43
44// check if there are any supported files folder and subfolders
45MRMESH_API bool isSupportedFileInSubfolders( const std::filesystem::path& folder );
46
47//tries to load scene from every format listed in SceneFormatFilters
48MRMESH_API Expected<LoadedObject> loadSceneFromAnySupportedFormat( const std::filesystem::path& path, const ProgressCallback& callback = {} );
49
59MRMESH_API Expected<LoadedObject> deserializeObjectTree( const std::filesystem::path& path,
60 const FolderCallback& postDecompress = {},
61 const ProgressCallback& progressCb = {} );
62
72 const ProgressCallback& progressCb = {} );
73
74
77
79
80} // namespace MR
#define MRMESH_API
Definition MRMesh/MRMeshFwd.h:68
std::function< bool(float)> ProgressCallback
Definition MRMesh/MRMeshFwd.h:600
MRMESH_API Expected< LoadedObjects > loadObjectFromFile(const std::filesystem::path &filename, const ProgressCallback &callback={})
load all objects (or any type: mesh, lines, points, voxels or scene) from file
MRMESH_API Expected< LoadedObjectMesh > makeObjectMeshFromFile(const std::filesystem::path &file, const ProgressCallback &cb={})
loads mesh from given file in new object
MRMESH_API Expected< LoadedObject > makeObjectFromMeshFile(const std::filesystem::path &file, const ProgressCallback &cb={}, bool returnOnlyMesh=false)
loads data from given file and makes either ObjectMesh or ObjectPoints (if the file has points but no...
MRMESH_API Expected< ObjectLines > makeObjectLinesFromFile(const std::filesystem::path &file, ProgressCallback callback={})
loads lines from given file in new object
MRMESH_API Expected< LoadedObject > deserializeObjectTree(const std::filesystem::path &path, const FolderCallback &postDecompress={}, const ProgressCallback &progressCb={})
loads objects tree from given scene file (zip/mru)
MRMESH_API Expected< ObjectDistanceMap > makeObjectDistanceMapFromFile(const std::filesystem::path &file, ProgressCallback callback={})
loads distance map from given file in new object
MRMESH_API Expected< LoadedObject > loadSceneFromAnySupportedFormat(const std::filesystem::path &path, const ProgressCallback &callback={})
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 IOFilters getAllFilters()
returns filters for all supported file formats for all types of objects
MRMESH_API Expected< ObjectPoints > makeObjectPointsFromFile(const std::filesystem::path &file, ProgressCallback callback={})
loads points from given file in new object
MRMESH_API Expected< LoadedObject > deserializeObjectTreeFromFolder(const std::filesystem::path &folder, const ProgressCallback &progressCb={})
loads objects tree from given scene folder
std::vector< IOFilter > IOFilters
Definition MRIOFilters.h:32
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
tl::expected< T, E > Expected
Definition MRExpected.h:58