MeshLib C++ Docs
Loading...
Searching...
No Matches
MRVoxelsVolume.h
Go to the documentation of this file.
1#pragma once
2
3#include "MRVoxelsFwd.h"
4#include "MRFloatGrid.h"
5
6#include "MRMesh/MRVector3.h"
7#include "MRMesh/MRBox.h"
9#include "MRMesh/MRExpected.h"
10#include "MRMesh/MRVector.h"
11#include "MRMesh/MRBitSet.h"
12
13#include <limits>
14
15namespace MR
16{
17
18template <typename T>
20
21template <typename T>
23{
24 using ValueType = T;
25};
26
27template <>
29{
30 using ValueType = bool;
31};
32
33template <typename T>
34struct VoxelTraits<VoxelValueGetter<T>>
35{
36 using ValueType = T;
37};
38
39template <>
41{
42 using ValueType = float;
43};
44
46template <typename T>
48{
50
53 Vector3f voxelSize{ 1.f, 1.f, 1.f };
54
55 [[nodiscard]] size_t heapBytes() const { return MR::heapBytes( data ); }
56};
57
60template <typename T>
61struct VoxelsVolumeMinMax : VoxelsVolume<T>, MinMax<typename VoxelsVolume<T>::ValueType>
62{
63 using typename VoxelsVolume<T>::ValueType;
64 using VoxelsVolume<T>::data;
65 using VoxelsVolume<T>::dims;
68};
69
70
72MRVOXELS_API Expected<SimpleVolumeMinMax> functionVolumeToSimpleVolume( const FunctionVolume& volume, const ProgressCallback& callback = {} );
73
74} //namespace MR
#define MRVOXELS_API
Definition MRVoxelsFwd.h:14
Definition MRFloatGrid.h:21
std::vector<T>-like container that requires specific indexing type,
Definition MRVector.h:19
size_t heapBytes(const BitSet &bs)
returns the amount of memory given BitSet occupies on heap
Definition MRMesh/MRBitSet.h:298
Definition MRCameraOrientationPlugin.h:8
MRVOXELS_API Expected< SimpleVolumeMinMax > functionVolumeToSimpleVolume(const FunctionVolume &volume, const ProgressCallback &callback={})
converts function volume into simple volume
MRMESH_API double volume(const MeshTopology &topology, const VertCoords &points, const FaceBitSet *region=nullptr)
float ValueType
Definition MRVoxelsVolume.h:42
T ValueType
Definition MRVoxelsVolume.h:24
bool ValueType
Definition MRVoxelsVolume.h:30
T ValueType
Definition MRVoxelsVolume.h:36
Definition MRVoxelsVolume.h:19
Definition MRVoxelsVolume.h:62
represents a box in 3D space subdivided on voxels stored in T
Definition MRVoxelsVolume.h:48
Vector3f voxelSize
Definition MRVoxelsVolume.h:53
size_t heapBytes() const
Definition MRVoxelsVolume.h:55
T data
Definition MRVoxelsVolume.h:51
Vector3i dims
Definition MRVoxelsVolume.h:52
typename VoxelTraits< T >::ValueType ValueType
Definition MRVoxelsVolume.h:49