MeshLib C++ Docs
Loading...
Searching...
No Matches
MRVoxels/MRFloatGrid.h
Go to the documentation of this file.
1#pragma once
2#include "MRVoxelsFwd.h"
3
4// this is a lightweight header unlike MRVDBFloatGrid.h
5
7
8namespace MR
9{
10
18
21{
22public:
24 MRVOXELS_API FloatGrid( std::shared_ptr<OpenVdbFloatGrid> ptr );
25
26 MRVOXELS_API void reset() noexcept;
27 MRVOXELS_API void swap( FloatGrid& other ) noexcept;
28
29 MRVOXELS_API OpenVdbFloatGrid* get() const noexcept;
30 MRVOXELS_API OpenVdbFloatGrid& operator *() const noexcept;
31 MRVOXELS_API OpenVdbFloatGrid* operator ->() const noexcept;
32
33 MRVOXELS_API explicit operator bool() const noexcept;
34
35 MRVOXELS_API std::shared_ptr<OpenVdbFloatGrid> toVdb() const noexcept;
36
37private:
38 std::shared_ptr<OpenVdbFloatGrid> ptr_;
39};
40
42[[nodiscard]] MRVOXELS_API size_t heapBytes( const FloatGrid& grid );
43
45MRVOXELS_API FloatGrid resampled( const FloatGrid& grid, float voxelScale, ProgressCallback cb = {} );
46
48MRVOXELS_API FloatGrid resampled( const FloatGrid& grid, const Vector3f& voxelScale, ProgressCallback cb = {} );
49
51MRVOXELS_API FloatGrid cropped( const FloatGrid& grid, const Box3i& box, ProgressCallback cb = {} );
52
54MRVOXELS_API void gaussianFilter( FloatGrid& grid, int width, int iters, ProgressCallback cb = {} );
55MRVOXELS_API FloatGrid gaussianFiltered( const FloatGrid& grid, int width, int iters, ProgressCallback cb = {} );
56
58[[nodiscard]] MRVOXELS_API float getValue( const FloatGrid & grid, const Vector3i & p );
59
62MRVOXELS_API void setValue( FloatGrid& grid, const Vector3i& p, float value );
63
66MRVOXELS_API void setValue( FloatGrid & grid, const VoxelBitSet& region, float value );
67
69MRVOXELS_API void setLevelSetType( FloatGrid & grid );
70
71// union operation on volumetric representation of two meshes
73
74// difference operation on volumetric representation of two meshes
76
77// intersection operation on volumetric representation of two meshes
79
81
82}
constexpr A & operator*=(A &a, B b)
Definition MRImGuiVectorOperators.h:114
constexpr A & operator-=(A &a, B b)
Definition MRImGuiVectorOperators.h:113
constexpr A & operator+=(A &a, B b)
Definition MRImGuiVectorOperators.h:112
#define MRVOXELS_API
Definition MRVoxels/MRVoxelsFwd.h:13
#define MRVOXELS_CLASS
Definition MRVoxels/MRVoxelsFwd.h:14
wrapper class that helps mrbind to avoid excess MRVDBFloatGrid.h includes
Definition MRVoxels/MRFloatGrid.h:21
MRVOXELS_API void reset() noexcept
MRVOXELS_API FloatGrid(std::shared_ptr< OpenVdbFloatGrid > ptr)
MRVOXELS_API FloatGrid()
std::function< bool(float)> ProgressCallback
Definition MRMesh/MRMeshFwd.h:728
Definition MRCameraOrientationPlugin.h:8
this class just hides very complex type of typedef openvdb::FloatGrid
Definition MRVDBFloatGrid.h:22