MeshLib C++ Docs
Loading...
Searching...
No Matches
MRMeshLoad.h
Go to the documentation of this file.
1#pragma once
2
3#include "MRMeshFwd.h"
4#include "MRIOFilters.h"
5#include "MRId.h"
7#include "MRExpected.h"
9#include <filesystem>
10#include <iosfwd>
11#include <string>
12
13namespace MR
14{
15
17
21
23MRMESH_API Expected<Mesh> loadMrmesh( const std::filesystem::path& file, const MeshLoadSettings& settings = {} );
24
27MRMESH_API Expected<Mesh> loadMrmesh( std::istream& in, const MeshLoadSettings& settings = {} );
28
30MRMESH_API Expected<Mesh> loadOff( const std::filesystem::path& file, const MeshLoadSettings& settings = {} );
31
34MRMESH_API Expected<Mesh> loadOff( std::istream& in, const MeshLoadSettings& settings = {} );
35
37MRMESH_API Expected<Mesh> loadObj( const std::filesystem::path& file, const MeshLoadSettings& settings = {} );
38
41MRMESH_API Expected<Mesh> loadObj( std::istream& in, const MeshLoadSettings& settings = {} );
42
44MRMESH_API Expected<Mesh> loadStl( const std::filesystem::path& file, const MeshLoadSettings& settings = {} );
45
48MRMESH_API Expected<Mesh> loadStl( std::istream& in, const MeshLoadSettings& settings = {} );
49
51MRMESH_API Expected<Mesh> loadBinaryStl( const std::filesystem::path& file, const MeshLoadSettings& settings = {} );
52
55MRMESH_API Expected<Mesh> loadBinaryStl( std::istream& in, const MeshLoadSettings& settings = {} );
56
58MRMESH_API Expected<Mesh> loadASCIIStl( const std::filesystem::path& file, const MeshLoadSettings& settings = {} );
59
61MRMESH_API Expected<Mesh> loadASCIIStl( std::istream& in, const MeshLoadSettings& settings = {} );
62
66MRMESH_API Expected<TriMesh> loadBinaryStlAsTriMesh( std::istream& in, const MeshLoadSettings& settings = {} );
67
70MRMESH_API Expected<TriMesh> loadASCIIStlAsTriMesh( const std::filesystem::path& file, const MeshLoadSettings& settings = {} );
71
74MRMESH_API Expected<TriMesh> loadASCIIStlAsTriMesh( std::istream& in, const MeshLoadSettings& settings = {} );
75
77MRMESH_API Expected<Mesh> loadPly( const std::filesystem::path& file, const MeshLoadSettings& settings = {} );
78
81MRMESH_API Expected<Mesh> loadPly( std::istream& in, const MeshLoadSettings& settings = {} );
82
84MRMESH_API Expected<Mesh> loadDxf( const std::filesystem::path& path, const MeshLoadSettings& settings = {} );
85
87MRMESH_API Expected<Mesh> loadDxf( std::istream& in, const MeshLoadSettings& settings = {} );
88
90MRMESH_API Expected<Mesh> loadMesh( const std::filesystem::path& file, const MeshLoadSettings& settings = {} );
91
94MRMESH_API Expected<Mesh> loadMesh( std::istream& in, const std::string& extension, const MeshLoadSettings& settings = {} );
95
97namespace MeshLoad
98{
99
101MRMESH_API Expected<Mesh> fromMrmesh( const std::filesystem::path& file, const MeshLoadSettings& settings = {} );
102
105MRMESH_API Expected<Mesh> fromMrmesh( std::istream& in, const MeshLoadSettings& settings = {} );
106
108MRMESH_API Expected<Mesh> fromOff( const std::filesystem::path& file, const MeshLoadSettings& settings = {} );
109
112MRMESH_API Expected<Mesh> fromOff( std::istream& in, const MeshLoadSettings& settings = {} );
113
116MRMESH_API Expected<FaceSoup> fromOffAsFaceSoup( const std::filesystem::path& file, const MeshLoadSettings& settings = {} );
117
121MRMESH_API Expected<FaceSoup> fromOffAsFaceSoup( std::istream& in, const MeshLoadSettings& settings = {} );
122
124MRMESH_API Expected<Mesh> fromObj( const std::filesystem::path& file, const MeshLoadSettings& settings = {} );
125
128MRMESH_API Expected<Mesh> fromObj( std::istream& in, const MeshLoadSettings& settings = {} );
129
132MRMESH_API Expected<TriMesh> fromObjAsTriMesh( const std::filesystem::path& file, const MeshLoadSettings& settings = {} );
133
137MRMESH_API Expected<TriMesh> fromObjAsTriMesh( std::istream& in, const MeshLoadSettings& settings = {} );
138
140MRMESH_API Expected<Mesh> fromAnyStl( const std::filesystem::path& file, const MeshLoadSettings& settings = {} );
141
144MRMESH_API Expected<Mesh> fromAnyStl( std::istream& in, const MeshLoadSettings& settings = {} );
145
148MRMESH_API Expected<TriMesh> fromAnyStlAsTriMesh( const std::filesystem::path& file, const MeshLoadSettings& settings = {} );
149
153MRMESH_API Expected<TriMesh> fromAnyStlAsTriMesh( std::istream& in, const MeshLoadSettings& settings = {} );
154
156MRMESH_API Expected<Mesh> fromBinaryStl( const std::filesystem::path& file, const MeshLoadSettings& settings = {} );
157
160MRMESH_API Expected<Mesh> fromBinaryStl( std::istream& in, const MeshLoadSettings& settings = {} );
161
164MRMESH_API Expected<TriMesh> fromBinaryStlAsTriMesh( const std::filesystem::path& file, const MeshLoadSettings& settings = {} );
165
169MRMESH_API Expected<TriMesh> fromBinaryStlAsTriMesh( std::istream& in, const MeshLoadSettings& settings = {} );
170
172MRMESH_API Expected<Mesh> fromASCIIStl( const std::filesystem::path& file, const MeshLoadSettings& settings = {} );
173
175MRMESH_API Expected<Mesh> fromASCIIStl( std::istream& in, const MeshLoadSettings& settings = {} );
176
179MRMESH_API Expected<TriMesh> fromASCIIStlAsTriMesh( const std::filesystem::path& file, const MeshLoadSettings& settings = {} );
180
183MRMESH_API Expected<TriMesh> fromASCIIStlAsTriMesh( std::istream& in, const MeshLoadSettings& settings = {} );
184
186MRMESH_API Expected<Mesh> fromPly( const std::filesystem::path& file, const MeshLoadSettings& settings = {} );
187
190MRMESH_API Expected<Mesh> fromPly( std::istream& in, const MeshLoadSettings& settings = {} );
191
194MRMESH_API Expected<TriMesh> fromPlyAsTriMesh( const std::filesystem::path& file, const MeshLoadSettings& settings = {} );
195
199MRMESH_API Expected<TriMesh> fromPlyAsTriMesh( std::istream& in, const MeshLoadSettings& settings = {} );
200
202MRMESH_API Expected<Mesh> fromDxf( const std::filesystem::path& path, const MeshLoadSettings& settings = {} );
203
205MRMESH_API Expected<Mesh> fromDxf( std::istream& in, const MeshLoadSettings& settings = {} );
206
209MRMESH_API Expected<TriMesh> fromDxfAsTriMesh( const std::filesystem::path& path, const MeshLoadSettings& settings = {} );
210
213MRMESH_API Expected<TriMesh> fromDxfAsTriMesh( std::istream& in, const MeshLoadSettings& settings = {} );
214
216MR_BIND_OVERLOAD_SUFFIX() MRMESH_API Expected<Mesh> fromAnySupportedFormat( const std::filesystem::path& file, const MeshLoadSettings& settings = {} );
217
220MR_BIND_OVERLOAD_SUFFIX(stream) MRMESH_API Expected<Mesh> fromAnySupportedFormat( std::istream& in, const std::string& extension, const MeshLoadSettings& settings = {} );
221
223MR_BIND_IGNORE MRMESH_API void telemetryLogSize( const Mesh& mesh );
224
225
226}
227
229
230}
#define MRMESH_API
Definition MRMeshFwd.h:85
tl::expected< T, E > Expected
Definition MRExpected.h:31
Expected< Mesh > loadBinaryStl(const std::filesystem::path &file, const MeshLoadSettings &settings={})
loads mesh from file in binary .STL format
Expected< Mesh > loadASCIIStl(const std::filesystem::path &file, const MeshLoadSettings &settings={})
loads mesh from file in textual .STL format
Expected< Mesh > loadDxf(const std::filesystem::path &path, const MeshLoadSettings &settings={})
loads mesh from file in .DXF format;
Expected< Mesh > loadStl(const std::filesystem::path &file, const MeshLoadSettings &settings={})
loads mesh from file in any .STL format: both binary and ASCII
Expected< TriMesh > loadASCIIStlAsTriMesh(const std::filesystem::path &file, const MeshLoadSettings &settings={})
Expected< Mesh > loadObj(const std::filesystem::path &file, const MeshLoadSettings &settings={})
loads mesh from file in .OBJ format
Expected< Mesh > loadMesh(const std::filesystem::path &file, const MeshLoadSettings &settings={})
loads mesh from file in the format detected from file extension
Expected< TriMesh > loadBinaryStlAsTriMesh(std::istream &in, const MeshLoadSettings &settings={})
Expected< Mesh > loadMrmesh(const std::filesystem::path &file, const MeshLoadSettings &settings={})
loads mesh from file in internal MeshLib format
Expected< Mesh > loadPly(const std::filesystem::path &file, const MeshLoadSettings &settings={})
loads mesh from file in .PLY format;
Expected< Mesh > loadOff(const std::filesystem::path &file, const MeshLoadSettings &settings={})
loads mesh from file in textual or binary .OFF format
Expected< TriMesh > fromPlyAsTriMesh(const std::filesystem::path &file, const MeshLoadSettings &settings={})
Expected< Mesh > fromDxf(const std::filesystem::path &path, const MeshLoadSettings &settings={})
loads mesh from file in .DXF format;
Expected< TriMesh > fromAnyStlAsTriMesh(const std::filesystem::path &file, const MeshLoadSettings &settings={})
Expected< Mesh > fromASCIIStl(const std::filesystem::path &file, const MeshLoadSettings &settings={})
loads mesh from file in textual .STL format
Expected< Mesh > fromPly(const std::filesystem::path &file, const MeshLoadSettings &settings={})
loads mesh from file in .PLY format;
Expected< TriMesh > fromASCIIStlAsTriMesh(const std::filesystem::path &file, const MeshLoadSettings &settings={})
Expected< Mesh > fromOff(const std::filesystem::path &file, const MeshLoadSettings &settings={})
loads mesh from file in textual or binary .OFF format
Expected< Mesh > fromMrmesh(const std::filesystem::path &file, const MeshLoadSettings &settings={})
loads mesh from file in internal MeshLib format
Expected< Mesh > fromAnyStl(const std::filesystem::path &file, const MeshLoadSettings &settings={})
loads mesh from file in any .STL format: both binary and ASCII
Expected< Mesh > fromAnySupportedFormat(const std::filesystem::path &file, const MeshLoadSettings &settings={})
loads mesh from file in the format detected from file extension
void telemetryLogSize(const Mesh &mesh)
emits telemetry signal with the integer logarithm of mesh size
Expected< FaceSoup > fromOffAsFaceSoup(const std::filesystem::path &file, const MeshLoadSettings &settings={})
Expected< TriMesh > fromObjAsTriMesh(const std::filesystem::path &file, const MeshLoadSettings &settings={})
Expected< TriMesh > fromBinaryStlAsTriMesh(const std::filesystem::path &file, const MeshLoadSettings &settings={})
Expected< Mesh > fromBinaryStl(const std::filesystem::path &file, const MeshLoadSettings &settings={})
loads mesh from file in binary .STL format
Expected< TriMesh > fromDxfAsTriMesh(const std::filesystem::path &path, const MeshLoadSettings &settings={})
Expected< Mesh > fromObj(const std::filesystem::path &file, const MeshLoadSettings &settings={})
loads mesh from file in .OBJ format
Only strictly necessary for the bindings (to make MR::MeshIntersectionResult a complete type).
Definition MRCameraOrientationPlugin.h:8
setting for mesh loading from external format, and locations of optional output data
Definition MRMeshLoadSettings.h:14
Definition MRMesh.h:24