MeshLib C++ Docs
Loading...
Searching...
No Matches
MRVoxelPath.h
Go to the documentation of this file.
1#pragma once
2#include "MRVoxelsFwd.h"
3
6#include <functional>
7
8namespace MR
9{
10
14
15using VoxelsMetric = std::function<float( size_t from, size_t to )>;
16
17enum class QuarterBit : char
18{
19 LeftLeft = 0b1,
20 LeftRight = 0b10,
21 RightLeft = 0b100,
22 RightRight = 0b1000,
23 All = 0b1111
24};
25MR_MAKE_FLAG_OPERATORS( QuarterBit )
26
27
29{
30 YZ,
31 ZX,
32 XY,
33 None
34};
35
37struct VoxelMetricParameters
38{
39 size_t start;
40 size_t stop;
41 float maxDistRatio{1.5f};
42 SlicePlane plane{None};
43 QuarterBit quatersMask{QuarterBit::All};
44};
45
47[[nodiscard]] MRVOXELS_API VoxelsMetric voxelsExponentMetric( const VdbVolume& voxels, const VoxelMetricParameters& parameters,
48 float modifier = -1.0f );
49
51[[nodiscard]] MRVOXELS_API VoxelsMetric voxelsSumDiffsMetric( const VdbVolume& voxels, const VoxelMetricParameters& parameters );
52
54[[nodiscard]] MRVOXELS_API std::vector<size_t> buildSmallestMetricPath( const VdbVolume & voxels, const VoxelsMetric & metric,
55 size_t start, size_t finish, ProgressCallback cb = {} );
56
58
59}
#define MR_MAKE_FLAG_OPERATORS(T)
Definition MRFlagOperators.h:6
#define MRVOXELS_API
Definition MRVoxelsFwd.h:14
Definition MRVoxelPath.h:38
new unsafe ref ulong stop
new unsafe ref ulong start
new unsafe ref MR.SlicePlane plane
new unsafe ref float maxDistRatio
SlicePlane
MRMESH_API EdgePath buildSmallestMetricPath(const MeshTopology &topology, const EdgeMetric &metric, VertId start, VertId finish, float maxPathMetric=FLT_MAX)
builds shortest path in given metric from start to finish vertices; if no path can be found then empt...
MRVOXELS_API VoxelsMetric voxelsExponentMetric(const VdbVolume &voxels, const VoxelMetricParameters &parameters, float modifier=-1.0f)
e^(modifier*(dens1+dens2))
std::function< float(size_t from, size_t to)> VoxelsMetric
Definition MRVoxelPath.h:15
QuarterBit
Definition MRVoxelPath.h:18
MRVOXELS_API VoxelsMetric voxelsSumDiffsMetric(const VdbVolume &voxels, const VoxelMetricParameters &parameters)
sum of dense differences with start and stop voxels
Definition MRCameraOrientationPlugin.h:8