MeshLib
 
Loading...
Searching...
No Matches
MRObjectLoad.h
Go to the documentation of this file.
1#pragma once
2
3#include "MRMeshFwd.h"
5#include "MRExpected.h"
7#include <filesystem>
8
9namespace MR
10{
11
14
17{
18 std::string* warnings = nullptr;
20};
21
23MRMESH_API Expected<ObjectMesh> makeObjectMeshFromFile( const std::filesystem::path& file, const MeshLoadInfo& info = {} );
24
26MRMESH_API Expected<std::shared_ptr<Object>> makeObjectFromMeshFile( const std::filesystem::path& file, const MeshLoadInfo& info = {},
27 bool returnOnlyMesh = false );
28
30MRMESH_API Expected<ObjectLines> makeObjectLinesFromFile( const std::filesystem::path& file, ProgressCallback callback = {} );
31
33MRMESH_API Expected<ObjectPoints> makeObjectPointsFromFile( const std::filesystem::path& file, ProgressCallback callback = {} );
34
37
39MRMESH_API Expected<ObjectGcode> makeObjectGcodeFromFile( const std::filesystem::path& file, ProgressCallback callback = {} );
40
41#ifndef MRMESH_NO_OPENVDB
44#endif
45
53 std::string* loadWarn = nullptr, ProgressCallback callback = {} );
54
55// check if there are any supported files folder and subfolders
56MRMESH_API bool isSupportedFileInSubfolders( const std::filesystem::path& folder );
57
59MRMESH_API Expected<Object> makeObjectTreeFromFolder( const std::filesystem::path& folder, std::string* loadWarn = nullptr, ProgressCallback callback = {} );
60
61//tries to load scene from every format listed in SceneFormatFilters
63 std::string* loadWarn = nullptr, ProgressCallback callback = {} );
64
66
67} // namespace MR
#define MRMESH_API
Definition MRMesh/MRMeshFwd.h:46
std::function< bool(float)> ProgressCallback
Definition MRMesh/MRMeshFwd.h:589
Definition MRCameraOrientationPlugin.h:7
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
MRMESH_API Expected< ObjectLines > makeObjectLinesFromFile(const std::filesystem::path &file, ProgressCallback callback={})
loads lines from given file in new object
tl::expected< T, E > Expected
Definition MRExpected.h:49
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< std::vector< std::shared_ptr< ObjectVoxels > > > makeObjectVoxelsFromFile(const std::filesystem::path &file, ProgressCallback callback={})
loads voxels from given file in new object
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:17
std::string * warnings
any warnings during loading will be appended here
Definition MRObjectLoad.h:18
ProgressCallback callback
callback for set progress and stop process
Definition MRObjectLoad.h:19