MeshLib
 
Loading...
Searching...
No Matches
MRMesh/MRPointsLoad.h
Go to the documentation of this file.
1#pragma once
2
3#include "MRMeshFwd.h"
4#include "MRIOFilters.h"
6#include "MRExpected.h"
7#include <filesystem>
8#include <istream>
9#include <string>
10
11namespace MR
12{
13
14// structure with settings and side output parameters for loading point cloud
16{
17 VertColors* colors = nullptr;
18 AffineXf3f* outXf = nullptr;
20};
21
22namespace PointsLoad
23{
24
28
29MRMESH_API extern const IOFilters Filters;
30
32MRMESH_API Expected<PointCloud> fromText( const std::filesystem::path& file, const PointsLoadSettings& settings );
33MRMESH_API Expected<PointCloud> fromText( std::istream& in, const PointsLoadSettings& settings );
34[[deprecated( "use fromText( ..., PointsLoadSettings ) instead" )]]
35MRMESH_API Expected<PointCloud> fromText( const std::filesystem::path& file, AffineXf3f* outXf = nullptr, ProgressCallback callback = {} );
36[[deprecated( "use fromText( ..., PointsLoadSettings ) instead" )]]
37MRMESH_API Expected<PointCloud> fromText( std::istream& in, AffineXf3f* outXf = nullptr, ProgressCallback callback = {} );
38
40MRMESH_API Expected<PointCloud> fromPts( const std::filesystem::path& file, VertColors* colors = nullptr, AffineXf3f* outXf = nullptr, ProgressCallback callback = {} );
41MRMESH_API Expected<PointCloud> fromPts( std::istream& in, VertColors* colors = nullptr, AffineXf3f* outXf = nullptr, ProgressCallback callback = {} );
42
43
44#ifndef MRMESH_NO_OPENCTM
46MRMESH_API Expected<PointCloud> fromCtm( const std::filesystem::path& file, VertColors* colors = nullptr,
47 ProgressCallback callback = {} );
48MRMESH_API Expected<PointCloud> fromCtm( std::istream& in, VertColors* colors = nullptr,
49 ProgressCallback callback = {} );
50#endif
51
53MRMESH_API Expected<PointCloud> fromPly( const std::filesystem::path& file, VertColors* colors = nullptr,
54 ProgressCallback callback = {} );
55MRMESH_API Expected<PointCloud> fromPly( std::istream& in, VertColors* colors = nullptr,
56 ProgressCallback callback = {} );
57
59MRMESH_API Expected<PointCloud> fromObj( const std::filesystem::path& file, ProgressCallback callback = {} );
60MRMESH_API Expected<PointCloud> fromObj( std::istream& in, ProgressCallback callback = {} );
61
62#if !defined( __EMSCRIPTEN__ ) && !defined( MRMESH_NO_E57 )
64MRMESH_API Expected<PointCloud> fromE57( const std::filesystem::path& file, VertColors* colors = nullptr,
65 AffineXf3f* outXf = nullptr, ProgressCallback callback = {} );
66// no support for reading e57 from arbitrary stream yet
67#endif
68
69#if !defined( MRMESH_NO_LAS )
71MRMESH_API Expected<PointCloud> fromLas( const std::filesystem::path& file, VertColors* colors = nullptr,
72 AffineXf3f* outXf = nullptr, ProgressCallback callback = {} );
73MRMESH_API Expected<PointCloud> fromLas( std::istream& in, VertColors* colors = nullptr,
74 AffineXf3f* outXf = nullptr, ProgressCallback callback = {} );
75#endif
76
77MRMESH_API Expected<PointCloud> fromDxf( const std::filesystem::path& file, ProgressCallback callback = {} );
78MRMESH_API Expected<PointCloud> fromDxf( std::istream& in, ProgressCallback callback = {} );
79
81MRMESH_API Expected<PointCloud> fromAnySupportedFormat( const std::filesystem::path& file,
82 VertColors* colors = nullptr, AffineXf3f* outXf = nullptr,
83 ProgressCallback callback = {} );
85MRMESH_API Expected<PointCloud> fromAnySupportedFormat( std::istream& in, const std::string& extension,
86 VertColors* colors = nullptr, AffineXf3f* outXf = nullptr,
87 ProgressCallback callback = {} );
88
90
91} // namespace PointsLoad
92
93} // namespace MR
#define MRMESH_API
Definition MRMesh/MRMeshFwd.h:46
std::function< bool(float)> ProgressCallback
Definition MRMesh/MRMeshFwd.h:589
std::vector< IOFilter > IOFilters
Definition MRIOFilters.h:23
MRMESH_API Expected< PointCloud > fromPly(const std::filesystem::path &file, VertColors *colors=nullptr, ProgressCallback callback={})
loads from .ply file
MRMESH_API Expected< PointCloud > fromPts(const std::filesystem::path &file, VertColors *colors=nullptr, AffineXf3f *outXf=nullptr, ProgressCallback callback={})
loads from Laser scan plain data format (.pts) file
MRMESH_API Expected< PointCloud > fromCtm(const std::filesystem::path &file, VertColors *colors=nullptr, ProgressCallback callback={})
loads from .ctm file
MRMESH_API Expected< PointCloud > fromDxf(const std::filesystem::path &file, ProgressCallback callback={})
MRMESH_API Expected< PointCloud > fromLas(const std::filesystem::path &file, VertColors *colors=nullptr, AffineXf3f *outXf=nullptr, ProgressCallback callback={})
loads from .las file
MRMESH_API const IOFilters Filters
MRMESH_API Expected< PointCloud > fromText(const std::filesystem::path &file, const PointsLoadSettings &settings)
loads from .csv, .asc, .xyz, .txt file
MRMESH_API Expected< PointCloud > fromE57(const std::filesystem::path &file, VertColors *colors=nullptr, AffineXf3f *outXf=nullptr, ProgressCallback callback={})
loads from .e57 file
MRMESH_API Expected< PointCloud > fromObj(const std::filesystem::path &file, ProgressCallback callback={})
loads from .obj file
MRMESH_API Expected< PointCloud > fromAnySupportedFormat(const std::filesystem::path &file, VertColors *colors=nullptr, AffineXf3f *outXf=nullptr, ProgressCallback callback={})
detects the format from file extension and loads points from it
Definition MRCameraOrientationPlugin.h:7
tl::expected< T, E > Expected
Definition MRExpected.h:49
Definition MRMesh/MRPointsLoad.h:16
VertColors * colors
points where to load point color map
Definition MRMesh/MRPointsLoad.h:17
AffineXf3f * outXf
transform for the loaded point cloud
Definition MRMesh/MRPointsLoad.h:18
ProgressCallback callback
callback for set progress and stop process
Definition MRMesh/MRPointsLoad.h:19