MeshLib
 
Loading...
Searching...
No Matches
MRMesh/MRPointsSave.h
Go to the documentation of this file.
1#pragma once
2
3#include "MRMeshFwd.h"
4#include "MRExpected.h"
5#include "MRPointCloud.h"
6#include "MRIOFilters.h"
7#include "MRSaveSettings.h"
8#include <filesystem>
9#include <ostream>
10
11namespace MR
12{
13
14namespace PointsSave
15{
16
20
21MRMESH_API extern const IOFilters Filters;
22
24MRMESH_API VoidOrErrStr toAsc( const PointCloud& points, const std::filesystem::path& file, const SaveSettings& settings = {} );
25MRMESH_API VoidOrErrStr toAsc( const PointCloud& points, std::ostream& out, const SaveSettings& settings = {} );
26
28MRMESH_API VoidOrErrStr toPly( const PointCloud& points, const std::filesystem::path& file, const SaveSettings& settings = {} );
29MRMESH_API VoidOrErrStr toPly( const PointCloud& points, std::ostream& out, const SaveSettings& settings = {} );
30
32{
36 const char* comment = "MeshInspector Points";
37};
38
39#ifndef MRMESH_NO_OPENCTM
41MRMESH_API VoidOrErrStr toCtm( const PointCloud& points, const std::filesystem::path& file, const CtmSavePointsOptions& options = {} );
42MRMESH_API VoidOrErrStr toCtm( const PointCloud& points, std::ostream& out, const CtmSavePointsOptions& options = {} );
43#endif
44
46MRMESH_API VoidOrErrStr toAnySupportedFormat( const PointCloud& points, const std::filesystem::path& file, const SaveSettings& settings = {} );
48MRMESH_API VoidOrErrStr toAnySupportedFormat( const PointCloud& points, std::ostream& out, const std::string& extension, const SaveSettings& settings = {} );
49
51
52} // namespace PointsSave
53
54} // namespace MR
#define MRMESH_API
Definition MRMesh/MRMeshFwd.h:46
std::vector< IOFilter > IOFilters
Definition MRIOFilters.h:23
MRMESH_API VoidOrErrStr toAsc(const PointCloud &points, const std::filesystem::path &file, const SaveSettings &settings={})
save valid points with normals in textual .asc file
MRMESH_API VoidOrErrStr toCtm(const PointCloud &points, const std::filesystem::path &file, const CtmSavePointsOptions &options={})
saves in .ctm file
MRMESH_API VoidOrErrStr toAnySupportedFormat(const PointCloud &points, const std::filesystem::path &file, const SaveSettings &settings={})
detects the format from file extension and save points to it
MRMESH_API VoidOrErrStr toPly(const PointCloud &points, const std::filesystem::path &file, const SaveSettings &settings={})
saves in .ply file
MRMESH_API const IOFilters Filters
Definition MRCameraOrientationPlugin.h:7
Expected< void > VoidOrErrStr
return type for a void function that can produce an error string
Definition MRExpected.h:60
Definition MRMesh/MRPointCloud.h:16
Definition MRMesh/MRPointsSave.h:32
const char * comment
comment saved in the file
Definition MRMesh/MRPointsSave.h:36
int compressionLevel
0 - minimal compression, but fast; 9 - maximal compression, but slow
Definition MRMesh/MRPointsSave.h:34
determines how to save points/lines/mesh
Definition MRSaveSettings.h:14