MeshLib Documentation
Loading...
Searching...
No Matches
MRMesh/MRMeshSave.h
Go to the documentation of this file.
1#pragma once
2
3#include "MRMeshFwd.h"
4#include "MRExpected.h"
5#include "MRIOFilters.h"
6#include "MRSaveSettings.h"
7#include <filesystem>
8#include <ostream>
9
10namespace MR
11{
12
13namespace MeshSave
14{
15
19
22MRMESH_API Expected<void> toMrmesh( const Mesh & mesh, const std::filesystem::path & file,
23 const SaveSettings & settings = {} );
24MRMESH_API Expected<void> toMrmesh( const Mesh & mesh, std::ostream & out,
25 const SaveSettings & settings = {} );
26
28MRMESH_API Expected<void> toOff( const Mesh & mesh, const std::filesystem::path & file,
29 const SaveSettings & settings = {} );
30MRMESH_API Expected<void> toOff( const Mesh & mesh, std::ostream & out,
31 const SaveSettings & settings = {} );
32
35MRMESH_API Expected<void> toObj( const Mesh & mesh, const std::filesystem::path & file,
36 const SaveSettings & settings, int firstVertId );
37MRMESH_API Expected<void> toObj( const Mesh & mesh, std::ostream & out,
38 const SaveSettings & settings, int firstVertId );
39MRMESH_API Expected<void> toObj( const Mesh & mesh, const std::filesystem::path & file, const SaveSettings & settings = {} );
40MRMESH_API Expected<void> toObj( const Mesh & mesh, std::ostream & out, const SaveSettings & settings = {} );
41
44MRMESH_API Expected<void> toBinaryStl( const Mesh & mesh, const std::filesystem::path & file, const SaveSettings & settings = {} );
45MRMESH_API Expected<void> toBinaryStl( const Mesh & mesh, std::ostream & out, const SaveSettings & settings = {} );
46
49MRMESH_API Expected<void> toAsciiStl( const Mesh& mesh, const std::filesystem::path& file, const SaveSettings & settings = {} );
50MRMESH_API Expected<void> toAsciiStl( const Mesh& mesh, std::ostream& out, const SaveSettings & settings = {} );
51
53MRMESH_API Expected<void> toPly( const Mesh& mesh, const std::filesystem::path& file, const SaveSettings & settings = {} );
54MRMESH_API Expected<void> toPly( const Mesh & mesh, std::ostream & out, const SaveSettings & settings = {} );
55
57MRMESH_API Expected<void> toAnySupportedFormat( const Mesh & mesh, const std::filesystem::path & file, const SaveSettings & settings = {} );
59MRMESH_API Expected<void> toAnySupportedFormat( const Mesh& mesh, const std::string& extension, std::ostream& out, const SaveSettings & settings = {} );
60
62
63} // namespace MeshSave
64
65} // namespace MR
#define MRMESH_API
Definition MRMesh/MRMeshFwd.h:46
MRMESH_API Expected< void > toAsciiStl(const Mesh &mesh, const std::filesystem::path &file, const SaveSettings &settings={})
MRMESH_API Expected< void > toOff(const Mesh &mesh, const std::filesystem::path &file, const SaveSettings &settings={})
saves in .off file
MRMESH_API Expected< void > toBinaryStl(const Mesh &mesh, const std::filesystem::path &file, const SaveSettings &settings={})
MRMESH_API Expected< void > toMrmesh(const Mesh &mesh, const std::filesystem::path &file, const SaveSettings &settings={})
MRMESH_API Expected< void > toAnySupportedFormat(const Mesh &mesh, const std::filesystem::path &file, const SaveSettings &settings={})
detects the format from file extension and save mesh to it
MRMESH_API Expected< void > toPly(const Mesh &mesh, const std::filesystem::path &file, const SaveSettings &settings={})
saves in .ply file
MRMESH_API Expected< void > toObj(const Mesh &mesh, const std::filesystem::path &file, const SaveSettings &settings, int firstVertId)
Definition MRCameraOrientationPlugin.h:8
tl::expected< T, E > Expected
Definition MRExpected.h:58
Definition MRMesh/MRMesh.h:23
determines how to save points/lines/mesh
Definition MRSaveSettings.h:14