MeshLib
 
Loading...
Searching...
No Matches
MRRegularMapMesher.h
Go to the documentation of this file.
1#pragma once
2#include "MRMeshFwd.h"
3#include "MRMesh.h"
4#include "MRPointCloud.h"
5#include "MRExpected.h"
6#include <filesystem>
7
8namespace MR
9{
10
20{
21public:
23 [[deprecated( "load and set a point cloud explicitly" )]]
24 MRMESH_API VoidOrErrStr loadSurfacePC( const std::filesystem::path& path );
26 MRMESH_API void setSurfacePC( const std::shared_ptr<PointCloud>& surfacePC );
28 [[deprecated( "load and set a point cloud explicitly" )]]
29 MRMESH_API VoidOrErrStr loadDirectionsPC( const std::filesystem::path& path );
31 MRMESH_API void setDirectionsPC( const std::shared_ptr<PointCloud>& directionsPC );
33 MRMESH_API VoidOrErrStr loadDistances( int width, int height, const std::filesystem::path& path );
35 MRMESH_API void setDistances( int width, int height, const std::vector<float>& distances );
36
39
40private:
41 int width_{0};
42 int height_{0};
43
44 std::shared_ptr<PointCloud> surfacePC_;
45 std::shared_ptr<PointCloud> directionsPC_;
46 std::vector<float> distances_;
47};
48}
#define MRMESH_API
Definition MRMesh/MRMeshFwd.h:46
Class for making mesh from regular distance map.
Definition MRRegularMapMesher.h:20
MRMESH_API VoidOrErrStr loadDirectionsPC(const std::filesystem::path &path)
Loads directions Point Cloud from file.
MRMESH_API void setDistances(int width, int height, const std::vector< float > &distances)
Sets distances.
MRMESH_API VoidOrErrStr loadSurfacePC(const std::filesystem::path &path)
Loads surface Point Cloud form file.
MRMESH_API void setDirectionsPC(const std::shared_ptr< PointCloud > &directionsPC)
Sets directions Point Cloud.
MRMESH_API void setSurfacePC(const std::shared_ptr< PointCloud > &surfacePC)
Sets surface Point Cloud.
MRMESH_API VoidOrErrStr loadDistances(int width, int height, const std::filesystem::path &path)
Loads distances form distances file (1/distance)
MRMESH_API Expected< Mesh > createMesh() const
Creates mesh if all components were successfully loaded.
auto width(const Box< V > &box)
returns size along x axis
Definition MRMesh/MRBox.h:230
auto height(const Box< V > &box)
returns size along y axis
Definition MRMesh/MRBox.h:237
Definition MRCameraOrientationPlugin.h:7
tl::expected< T, E > Expected
Definition MRExpected.h:49
Expected< void > VoidOrErrStr
return type for a void function that can produce an error string
Definition MRExpected.h:60