MeshLib C++ Docs
Loading...
Searching...
No Matches
MRCtm.h
Go to the documentation of this file.
1#pragma once
2
3#include "config.h"
4#ifndef MRIOEXTRAS_NO_CTM
5#include "exports.h"
6
7#include <MRMesh/MRExpected.h>
11
12#include <filesystem>
13
14namespace MR
15{
18
19
20namespace MeshLoad
21{
22
24MRIOEXTRAS_API Expected<Mesh> fromCtm( const std::filesystem::path& file, const MeshLoadSettings& settings = {} );
25MRIOEXTRAS_API Expected<Mesh> fromCtm( std::istream& in, const MeshLoadSettings& settings = {} );
26
27}
28
29namespace MeshSave
30{
31
33{
34 enum class MeshCompression
35 {
36 None,
37 Lossless,
38 Lossy
39 };
43 float vertexPrecision = 1.0f / 1024.0f;
47 const char * comment = "MeshInspector.com";
48};
49
51MRIOEXTRAS_API Expected<void> toCtm( const Mesh & mesh, const std::filesystem::path & file, const CtmSaveOptions & options );
52MRIOEXTRAS_API Expected<void> toCtm( const Mesh & mesh, std::ostream & out, const CtmSaveOptions & options );
53MRIOEXTRAS_API Expected<void> toCtm( const Mesh & mesh, const std::filesystem::path & file, const SaveSettings & settings = {} );
54MRIOEXTRAS_API Expected<void> toCtm( const Mesh & mesh, std::ostream & out, const SaveSettings & settings = {} );
55
56}
57
58namespace PointsLoad
59{
60
62MRIOEXTRAS_API Expected<PointCloud> fromCtm( const std::filesystem::path& file, const PointsLoadSettings& settings = {} );
63MRIOEXTRAS_API Expected<PointCloud> fromCtm( std::istream& in, const PointsLoadSettings& settings = {} );
64
65}
66
67namespace PointsSave
68{
69
71{
75 const char* comment = "MeshInspector Points";
76};
77
79MRIOEXTRAS_API Expected<void> toCtm( const PointCloud& points, const std::filesystem::path& file, const CtmSavePointsOptions& options );
80MRIOEXTRAS_API Expected<void> toCtm( const PointCloud& points, std::ostream& out, const CtmSavePointsOptions& options );
81MRIOEXTRAS_API Expected<void> toCtm( const PointCloud& points, const std::filesystem::path& file, const SaveSettings& settings = {} );
82MRIOEXTRAS_API Expected<void> toCtm( const PointCloud& points, std::ostream& out, const SaveSettings& settings = {} );
83
84}
85
86}
87#endif
int compressionLevel
LZMA compression: 0 - minimal compression, but fast; 9 - maximal compression, but slow.
Definition MRCtm.h:45
const char * comment
comment saved in the file
Definition MRCtm.h:47
MRIOEXTRAS_API Expected< void > toCtm(const Mesh &mesh, const std::filesystem::path &file, const CtmSaveOptions &options)
saves in .ctm file
float vertexPrecision
Definition MRCtm.h:43
MeshCompression meshCompression
Definition MRCtm.h:40
const char * comment
comment saved in the file
Definition MRCtm.h:75
tl::expected< T, E > Expected
Definition MRExpected.h:31
int compressionLevel
0 - minimal compression, but fast; 9 - maximal compression, but slow
Definition MRCtm.h:73
MRIOEXTRAS_API Expected< PointCloud > fromCtm(const std::filesystem::path &file, const PointsLoadSettings &settings={})
loads from .ctm file
MRIOEXTRAS_API Expected< void > toCtm(const PointCloud &points, const std::filesystem::path &file, const CtmSavePointsOptions &options)
saves in .ctm file
MRIOEXTRAS_API Expected< Mesh > fromCtm(const std::filesystem::path &file, const MeshLoadSettings &settings={})
loads from .ctm file
MeshCompression
Definition MRCtm.h:35
@ None
no compression at all, fast but not effective
@ Lossless
compression without any loss in vertex coordinates
@ Lossy
compression with loss in vertex coordinates
only for bindings generation
Definition MRCameraOrientationPlugin.h:8
setting for mesh loading from external format, and locations of optional output data
Definition MRMeshLoadSettings.h:14
Definition MRCtm.h:33
Definition MRMesh.h:23
Definition MRPointCloud.h:17
structure with settings and side output parameters for loading point cloud
Definition MRPointsLoadSettings.h:13
determines how to save points/lines/mesh
Definition MRSaveSettings.h:20