MeshLib Documentation
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};
26
27
35
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:13
std::function< bool(float)> ProgressCallback
Definition MRMesh/MRMeshFwd.h:576
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))
SlicePlane
Plane of slice in which to find path.
Definition MRVoxelPath.h:29
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
@ ZX
= 1 cause main axis is y - [1]
Definition MRVoxelPath.h:31
@ XY
= 2 cause main axis is z - [2]
Definition MRVoxelPath.h:32
@ YZ
= 0 cause main axis is x - [0]
Definition MRVoxelPath.h:30
@ None
special value not to limit path in one slice
Definition MRVoxelPath.h:33
Definition MRCameraOrientationPlugin.h:8
Parameters for building metric function.
Definition MRVoxelPath.h:38
float maxDistRatio
max distance ratio: if (dist^2(next,start) + dist^2(next,stop) > maxDistRatio^2*dist^2(start,...
Definition MRVoxelPath.h:41
QuarterBit quatersMask
quarter of building path, if plane is selected, it should be (LeftLeft | LeftRigth) or (RigthLeft | R...
Definition MRVoxelPath.h:43
SlicePlane plane
if not None - builds path in one slice of voxels (make sure start and stop has same main axis coordin...
Definition MRVoxelPath.h:42
size_t stop
stop voxel index
Definition MRVoxelPath.h:40
size_t start
start voxel index
Definition MRVoxelPath.h:39