MeshLib C++ Docs
Loading...
Searching...
No Matches
MRPointsToDistanceVolume.h
Go to the documentation of this file.
1#pragma once
2
3#include "MRVoxelsFwd.h"
4
6#include "MRMesh/MRExpected.h"
8
9#include <functional>
10
11namespace MR
12{
15
16
18{
21 float sigma = 1;
22
24 float minWeight = 1;
25
28 float invSigmaModifier = 0.5f;
29
32 bool sqrtAngleWeight{ false };
33
35 const VertNormals* ptNormals = nullptr;
36};
37
40
43
65
68{
69public:
71 using AddPartFunc = std::function<Expected<void>( const SimpleVolumeMinMax& volume, int zOffset )>;
72
75 AddPartFunc addPart, int layerOverlap ) const = 0;
76};
77
86
97
106[[nodiscard]] MRVOXELS_API Expected<VertColors> calcAvgColors( const PointCloud & cloud, const VertColors & colors,
107 const VertCoords & tgtPoints, const VertBitSet & tgtVerts, float sigma, const ProgressCallback & cb = {} );
108
109}
#define MRVOXELS_API
see explanation in MRMesh/MRMeshFwd.h
Definition MRVoxelsFwd.h:14
#define MRVOXELS_CLASS
Definition MRVoxelsFwd.h:18
Definition MRPointsToDistanceVolume.h:90
Definition MRPointsToDistanceVolume.h:81
complements IComputePointsToDistanceVolume with computation in z-slabs, which needs less memory
Definition MRPointsToDistanceVolume.h:68
std::function< bool(float)> ProgressCallback
Definition MRMeshFwd.h:790
virtual FunctionVolume computeFunctionVolume(const PointCloud &cloud, const PointsToDistanceVolumeParams &params) const =0
makes a volume evaluated on demand; it is valid as long as cloud and params are alive
double volume(const MeshTopology &topology, const VertCoords &points, const FaceBitSet *region=nullptr)
bool sqrtAngleWeight
Definition MRPointsToDistanceVolume.h:32
virtual bool canCompute(const PointCloud &cloud, const PointsToDistanceVolumeParams &params) const =0
whether this implementation can process given input, e.g. it fits in GPU memory
bool canCompute(const PointCloud &cloud, const PointsToDistanceVolumeParams &params) const override
see methods' descriptions in the interfaces above
float sigma
Definition MRPointsToDistanceVolume.h:21
std::function< Expected< void >(const SimpleVolumeMinMax &volume, int zOffset)> AddPartFunc
gets one z-slab of the volume, starting at z-layer zOffset
Definition MRPointsToDistanceVolume.h:71
virtual Expected< SimpleVolumeMinMax > compute(const PointCloud &cloud, const PointsToDistanceVolumeParams &params) const =0
Expected< VertColors > calcAvgColors(const PointCloud &cloud, const VertColors &colors, const VertCoords &tgtPoints, const VertBitSet &tgtVerts, float sigma, const ProgressCallback &cb={})
IComputePointsToDistanceVolume(IComputePointsToDistanceVolume &&) noexcept=default
Expected< SimpleVolumeMinMax > compute(const PointCloud &cloud, const PointsToDistanceVolumeParams &params) const override
const VertNormals * ptNormals
optional input: if this pointer is set then function will use these normals instead of ones present i...
Definition MRPointsToDistanceVolume.h:35
virtual Expected< void > computeByParts(const PointCloud &cloud, const PointsToDistanceVolumeParams &params, AddPartFunc addPart, int layerOverlap) const =0
makes the volume by z-slabs, passing each of them in addPart with layerOverlap layers shared by neigh...
IComputePointsToDistanceVolume()=default
explicitly define ctors to avoid warning C5267: definition of implicit copy constructor is deprecated...
tl::expected< T, E > Expected
Definition MRExpected.h:31
Expected< SimpleVolume > pointsToDistanceVolume(const PointCloud &cloud, const PointsToDistanceVolumeParams &params)
makes SimpleVolume filled with signed distances to points with normals
float minWeight
minimum sum of influence weights from surrounding points for a voxel to get a value,...
Definition MRPointsToDistanceVolume.h:24
FunctionVolume pointsToDistanceFunctionVolume(const PointCloud &cloud, const PointsToDistanceVolumeParams &params)
makes FunctionVolume representing signed distances to points with normals
float invSigmaModifier
Definition MRPointsToDistanceVolume.h:28
FunctionVolume computeFunctionVolume(const PointCloud &cloud, const PointsToDistanceVolumeParams &params) const override
makes a volume evaluated on demand; it is valid as long as cloud and params are alive
SimpleVolumeMinMax
Definition MRVoxelsFwd.h:35
FunctionVolume
Definition MRVoxelsFwd.h:46
IComputePointsToDistanceVolume(const IComputePointsToDistanceVolume &)=default
Only strictly necessary for the bindings (to make MR::MeshIntersectionResult a complete type).
Definition MRCameraOrientationPlugin.h:8
Definition MRDistanceVolumeParams.h:13
Definition MRPointCloud.h:17
Definition MRPointsToDistanceVolume.h:18