MeshLib C Docs
Loading...
Searching...
No Matches
MRFloatGrid.h File Reference
#include <MRCMesh/MRBox.h>
#include <MRCMisc/common.h>
#include <MRCMisc/exports.h>
#include <stdbool.h>
#include <stddef.h>

Go to the source code of this file.

Typedefs

typedef struct MR_OpenVdbFloatGrid MR_OpenVdbFloatGrid
 
typedef struct MR_Vector3f MR_Vector3f
 
typedef struct MR_Vector3i MR_Vector3i
 
typedef struct MR_VoxelBitSet MR_VoxelBitSet
 
typedef struct MR_std_function_bool_from_float MR_std_function_bool_from_float
 
typedef struct MR_std_shared_ptr_MR_OpenVdbFloatGrid MR_std_shared_ptr_MR_OpenVdbFloatGrid
 
typedef struct MR_std_vector_float MR_std_vector_float
 
typedef struct MR_FloatGrid MR_FloatGrid
 

Functions

MRC_API MR_FloatGridMR_FloatGrid_DefaultConstruct (void)
 
MRC_API MR_FloatGridMR_FloatGrid_DefaultConstructArray (size_t num_elems)
 
MRC_API const MR_FloatGridMR_FloatGrid_OffsetPtr (const MR_FloatGrid *ptr, ptrdiff_t i)
 
MRC_API MR_FloatGridMR_FloatGrid_OffsetMutablePtr (MR_FloatGrid *ptr, ptrdiff_t i)
 
MRC_API MR_FloatGridMR_FloatGrid_ConstructFromAnother (MR_PassBy _other_pass_by, MR_FloatGrid *_other)
 
MRC_API MR_FloatGridMR_FloatGrid_Construct (MR_PassBy ptr_pass_by, MR_std_shared_ptr_MR_OpenVdbFloatGrid *ptr)
 
MRC_API void MR_FloatGrid_Destroy (const MR_FloatGrid *_this)
 Destroys a heap-allocated instance of MR_FloatGrid. Does nothing if the pointer is null.
 
MRC_API void MR_FloatGrid_DestroyArray (const MR_FloatGrid *_this)
 Destroys a heap-allocated array of MR_FloatGrid. Does nothing if the pointer is null.
 
MRC_API bool MR_FloatGrid_ConvertTo_bool (const MR_FloatGrid *_this)
 
MRC_API MR_FloatGridMR_FloatGrid_AssignFromAnother (MR_FloatGrid *_this, MR_PassBy _other_pass_by, MR_FloatGrid *_other)
 
MRC_API void MR_FloatGrid_reset (MR_FloatGrid *_this)
 
MRC_API void MR_FloatGrid_swap (MR_FloatGrid *_this, MR_FloatGrid *other)
 
MRC_API MR_FloatGridMR_FloatGrid_deepCopy (const MR_FloatGrid *other)
 
MRC_API MR_OpenVdbFloatGridMR_FloatGrid_get (const MR_FloatGrid *_this)
 
MRC_API MR_OpenVdbFloatGridMR_deref_MR_FloatGrid (const MR_FloatGrid *_this)
 
MRC_API MR_OpenVdbFloatGridMR_FloatGrid_arrow (const MR_FloatGrid *_this)
 
MRC_API MR_std_shared_ptr_MR_OpenVdbFloatGridMR_FloatGrid_toVdb (const MR_FloatGrid *_this)
 
MRC_API MR_uint64_t MR_heapBytes_MR_FloatGrid (const MR_FloatGrid *grid)
 
MRC_API MR_FloatGridMR_resampled_float (const MR_FloatGrid *grid, float voxelScale, MR_PassBy cb_pass_by, MR_std_function_bool_from_float *cb)
 
MRC_API MR_FloatGridMR_resampled_MR_Vector3f (const MR_FloatGrid *grid, const MR_Vector3f *voxelScale, MR_PassBy cb_pass_by, MR_std_function_bool_from_float *cb)
 
MRC_API MR_FloatGridMR_cropped (const MR_FloatGrid *grid, const MR_Box3i *box, MR_PassBy cb_pass_by, MR_std_function_bool_from_float *cb)
 
MRC_API MR_uint64_t MR_countVoxelsWithValuePred (const MR_FloatGrid *grid, const MR_std_function_bool_from_float *pred)
 
MRC_API MR_uint64_t MR_countVoxelsWithValueLess (const MR_FloatGrid *grid, float value)
 
MRC_API MR_uint64_t MR_countVoxelsWithValueGreater (const MR_FloatGrid *grid, float value)
 
MRC_API void MR_gaussianFilter (MR_FloatGrid *grid, int width, int iters, MR_PassBy cb_pass_by, MR_std_function_bool_from_float *cb)
 
MRC_API MR_FloatGridMR_gaussianFiltered (const MR_FloatGrid *grid, int width, int iters, MR_PassBy cb_pass_by, MR_std_function_bool_from_float *cb)
 
MRC_API float MR_getValue (const MR_FloatGrid *grid, const MR_Vector3i *p)
 
MRC_API void MR_setValue_MR_Vector3i (MR_FloatGrid *grid, const MR_Vector3i *p, float value)
 
MRC_API void MR_setValue_MR_VoxelBitSet (MR_FloatGrid *grid, const MR_VoxelBitSet *region, float value)
 
MRC_API MR_Box3i MR_findActiveBounds (const MR_FloatGrid *grid)
 
MRC_API void MR_setValues (MR_FloatGrid *grid, const MR_VoxelBitSet *region, const MR_std_vector_float *values)
 
MRC_API void MR_setLevelSetType (MR_FloatGrid *grid)
 
MRC_API MR_FloatGridMR_add_assign_MR_FloatGrid (MR_FloatGrid *a, MR_FloatGrid *b)
 
MRC_API MR_FloatGridMR_sub_assign_MR_FloatGrid (MR_FloatGrid *a, MR_FloatGrid *b)
 
MRC_API MR_FloatGridMR_mul_assign_MR_FloatGrid (MR_FloatGrid *a, MR_FloatGrid *b)
 
MRC_API MR_FloatGridMR_add_MR_FloatGrid (const MR_FloatGrid *a, const MR_FloatGrid *b)
 
MRC_API MR_FloatGridMR_sub_MR_FloatGrid (const MR_FloatGrid *a, const MR_FloatGrid *b)
 
MRC_API MR_FloatGridMR_mul_MR_FloatGrid (const MR_FloatGrid *a, const MR_FloatGrid *b)
 

Typedef Documentation

◆ MR_FloatGrid

typedef struct MR_FloatGrid MR_FloatGrid

wrapper class that helps mrbind to avoid excess MRVDBFloatGrid.h includes Generated from class MR::FloatGrid. Supported MR_PassBy modes: MR_PassBy_DefaultConstruct, MR_PassBy_Copy, MR_PassBy_Move (and MR_PassBy_DefaultArgument and MR_PassBy_NoObject if supported by the callee).

◆ MR_OpenVdbFloatGrid

◆ MR_std_function_bool_from_float

◆ MR_std_shared_ptr_MR_OpenVdbFloatGrid

◆ MR_std_vector_float

◆ MR_Vector3f

typedef struct MR_Vector3f MR_Vector3f

◆ MR_Vector3i

typedef struct MR_Vector3i MR_Vector3i

◆ MR_VoxelBitSet

Function Documentation

◆ MR_add_assign_MR_FloatGrid()

MRC_API MR_FloatGrid * MR_add_assign_MR_FloatGrid ( MR_FloatGrid * a,
MR_FloatGrid * b )

union operation on two signed distance fields

Note
this operation consumes FloatGrid b Generated from function MR::operator+=. Parameter a can not be null. It is a single object. Parameter b can not be null. It is a single object. In C++ this parameter takes an rvalue reference: it might invalidate the passed object, but if your pointer is owning, you must still destroy it manually later. Never returns null. Returns an instance allocated on the heap! Must call MR_FloatGrid_Destroy() to free it when you're done using it.

◆ MR_add_MR_FloatGrid()

MRC_API MR_FloatGrid * MR_add_MR_FloatGrid ( const MR_FloatGrid * a,
const MR_FloatGrid * b )

union operation on two signed distance fields

Note
this operation returns new FloatGrid keeping a,b untouched Generated from function MR::operator+. Parameter a can not be null. It is a single object. Parameter b can not be null. It is a single object. Never returns null. Returns an instance allocated on the heap! Must call MR_FloatGrid_Destroy() to free it when you're done using it.

◆ MR_countVoxelsWithValueGreater()

MRC_API MR_uint64_t MR_countVoxelsWithValueGreater ( const MR_FloatGrid * grid,
float value )

returns number of voxels in the grid with value greater than given Generated from function MR::countVoxelsWithValueGreater. Parameter grid can not be null. It is a single object.

◆ MR_countVoxelsWithValueLess()

MRC_API MR_uint64_t MR_countVoxelsWithValueLess ( const MR_FloatGrid * grid,
float value )

returns number of voxels in the grid with value less than given Generated from function MR::countVoxelsWithValueLess. Parameter grid can not be null. It is a single object.

◆ MR_countVoxelsWithValuePred()

MRC_API MR_uint64_t MR_countVoxelsWithValuePred ( const MR_FloatGrid * grid,
const MR_std_function_bool_from_float * pred )

returns number of velxes in the grid with pred(value) == true Generated from function MR::countVoxelsWithValuePred. Parameter grid can not be null. It is a single object. Parameter pred can not be null. It is a single object.

◆ MR_cropped()

MRC_API MR_FloatGrid * MR_cropped ( const MR_FloatGrid * grid,
const MR_Box3i * box,
MR_PassBy cb_pass_by,
MR_std_function_bool_from_float * cb )

returns cropped grid Generated from function MR::cropped. Parameter grid can not be null. It is a single object. Parameter box can not be null. It is a single object. Parameter cb has a default argument: {}, pass MR_PassBy_DefaultArgument and a null pointer to use it. Never returns null. Returns an instance allocated on the heap! Must call MR_FloatGrid_Destroy() to free it when you're done using it.

◆ MR_deref_MR_FloatGrid()

MRC_API MR_OpenVdbFloatGrid * MR_deref_MR_FloatGrid ( const MR_FloatGrid * _this)

Generated from method MR::FloatGrid::operator*. Parameter _this can not be null. It is a single object. The returned pointer will never be null. It is non-owning, do NOT destroy it.

◆ MR_findActiveBounds()

MRC_API MR_Box3i MR_findActiveBounds ( const MR_FloatGrid * grid)

returns bounding box of active voxels in grid min: including max: excluding Generated from function MR::findActiveBounds. Parameter grid can not be null. It is a single object.

◆ MR_FloatGrid_arrow()

MRC_API MR_OpenVdbFloatGrid * MR_FloatGrid_arrow ( const MR_FloatGrid * _this)

Generated from method MR::FloatGrid::operator->. Parameter _this can not be null. It is a single object.

◆ MR_FloatGrid_AssignFromAnother()

MRC_API MR_FloatGrid * MR_FloatGrid_AssignFromAnother ( MR_FloatGrid * _this,
MR_PassBy _other_pass_by,
MR_FloatGrid * _other )

Generated from method MR::FloatGrid::operator=. Parameter _this can not be null. It is a single object. The reference to things referred to by the parameter _other (if any) might be preserved in this object. The returned pointer will never be null. It is non-owning, do NOT destroy it. When this function is called, this object will drop any object references it had previously.

◆ MR_FloatGrid_Construct()

MRC_API MR_FloatGrid * MR_FloatGrid_Construct ( MR_PassBy ptr_pass_by,
MR_std_shared_ptr_MR_OpenVdbFloatGrid * ptr )

Generated from constructor MR::FloatGrid::FloatGrid. The reference to the parameter ptr might be preserved in the constructed object. Never returns null. Returns an instance allocated on the heap! Must call MR_FloatGrid_Destroy() to free it when you're done using it.

◆ MR_FloatGrid_ConstructFromAnother()

MRC_API MR_FloatGrid * MR_FloatGrid_ConstructFromAnother ( MR_PassBy _other_pass_by,
MR_FloatGrid * _other )

Generated from constructor MR::FloatGrid::FloatGrid. The reference to things referred to by the parameter _other (if any) might be preserved in the constructed object. Never returns null. Returns an instance allocated on the heap! Must call MR_FloatGrid_Destroy() to free it when you're done using it.

◆ MR_FloatGrid_ConvertTo_bool()

MRC_API bool MR_FloatGrid_ConvertTo_bool ( const MR_FloatGrid * _this)

Generated from conversion operator MR::FloatGrid::operator bool. Parameter _this can not be null. It is a single object.

◆ MR_FloatGrid_deepCopy()

MRC_API MR_FloatGrid * MR_FloatGrid_deepCopy ( const MR_FloatGrid * other)

Generated from method MR::FloatGrid::deepCopy. Parameter other can not be null. It is a single object. Never returns null. Returns an instance allocated on the heap! Must call MR_FloatGrid_Destroy() to free it when you're done using it.

◆ MR_FloatGrid_DefaultConstruct()

MRC_API MR_FloatGrid * MR_FloatGrid_DefaultConstruct ( void )

Constructs an empty (default-constructed) instance. Never returns null. Returns an instance allocated on the heap! Must call MR_FloatGrid_Destroy() to free it when you're done using it.

◆ MR_FloatGrid_DefaultConstructArray()

MRC_API MR_FloatGrid * MR_FloatGrid_DefaultConstructArray ( size_t num_elems)

Constructs an array of empty (default-constructed) instances, of the specified size. Will never return null. The array must be destroyed using MR_FloatGrid_DestroyArray(). Use MR_FloatGrid_OffsetMutablePtr() and MR_FloatGrid_OffsetPtr() to access the array elements.

◆ MR_FloatGrid_Destroy()

MRC_API void MR_FloatGrid_Destroy ( const MR_FloatGrid * _this)

Destroys a heap-allocated instance of MR_FloatGrid. Does nothing if the pointer is null.

◆ MR_FloatGrid_DestroyArray()

MRC_API void MR_FloatGrid_DestroyArray ( const MR_FloatGrid * _this)

Destroys a heap-allocated array of MR_FloatGrid. Does nothing if the pointer is null.

◆ MR_FloatGrid_get()

MRC_API MR_OpenVdbFloatGrid * MR_FloatGrid_get ( const MR_FloatGrid * _this)

Generated from method MR::FloatGrid::get. Parameter _this can not be null. It is a single object.

◆ MR_FloatGrid_OffsetMutablePtr()

MRC_API MR_FloatGrid * MR_FloatGrid_OffsetMutablePtr ( MR_FloatGrid * ptr,
ptrdiff_t i )

Offsets a pointer to an array element by i positions (not bytes). Use only if you're certain that the pointer points to an array element. The reference to the parameter ptr might be preserved in the return value.

◆ MR_FloatGrid_OffsetPtr()

MRC_API const MR_FloatGrid * MR_FloatGrid_OffsetPtr ( const MR_FloatGrid * ptr,
ptrdiff_t i )

Offsets a pointer to an array element by i positions (not bytes). Use only if you're certain that the pointer points to an array element. The reference to the parameter ptr might be preserved in the return value.

◆ MR_FloatGrid_reset()

MRC_API void MR_FloatGrid_reset ( MR_FloatGrid * _this)

Generated from method MR::FloatGrid::reset. Parameter _this can not be null. It is a single object.

◆ MR_FloatGrid_swap()

MRC_API void MR_FloatGrid_swap ( MR_FloatGrid * _this,
MR_FloatGrid * other )

Generated from method MR::FloatGrid::swap. Parameter _this can not be null. It is a single object. Parameter other can not be null. It is a single object.

◆ MR_FloatGrid_toVdb()

MRC_API MR_std_shared_ptr_MR_OpenVdbFloatGrid * MR_FloatGrid_toVdb ( const MR_FloatGrid * _this)

Generated from method MR::FloatGrid::toVdb. Parameter _this can not be null. It is a single object. Never returns null. Returns an instance allocated on the heap! Must call MR_std_shared_ptr_MR_OpenVdbFloatGrid_Destroy() to free it when you're done using it.

◆ MR_gaussianFilter()

MRC_API void MR_gaussianFilter ( MR_FloatGrid * grid,
int width,
int iters,
MR_PassBy cb_pass_by,
MR_std_function_bool_from_float * cb )

returns grid with gaussian filter applied Generated from function MR::gaussianFilter. Parameter grid can not be null. It is a single object. Parameter cb has a default argument: {}, pass MR_PassBy_DefaultArgument and a null pointer to use it.

◆ MR_gaussianFiltered()

MRC_API MR_FloatGrid * MR_gaussianFiltered ( const MR_FloatGrid * grid,
int width,
int iters,
MR_PassBy cb_pass_by,
MR_std_function_bool_from_float * cb )

Generated from function MR::gaussianFiltered. Parameter grid can not be null. It is a single object. Parameter cb has a default argument: {}, pass MR_PassBy_DefaultArgument and a null pointer to use it. Never returns null. Returns an instance allocated on the heap! Must call MR_FloatGrid_Destroy() to free it when you're done using it.

◆ MR_getValue()

MRC_API float MR_getValue ( const MR_FloatGrid * grid,
const MR_Vector3i * p )

returns the value at given voxel Generated from function MR::getValue. Parameter grid can not be null. It is a single object. Parameter p can not be null. It is a single object.

◆ MR_heapBytes_MR_FloatGrid()

MRC_API MR_uint64_t MR_heapBytes_MR_FloatGrid ( const MR_FloatGrid * grid)

returns the amount of heap memory occupied by grid Generated from function MR::heapBytes. Parameter grid can not be null. It is a single object.

◆ MR_mul_assign_MR_FloatGrid()

MRC_API MR_FloatGrid * MR_mul_assign_MR_FloatGrid ( MR_FloatGrid * a,
MR_FloatGrid * b )

intersection operation on two signed distance fields

Note
this operation consumes FloatGrid b Generated from function MR::operator*=. Parameter a can not be null. It is a single object. Parameter b can not be null. It is a single object. In C++ this parameter takes an rvalue reference: it might invalidate the passed object, but if your pointer is owning, you must still destroy it manually later. Never returns null. Returns an instance allocated on the heap! Must call MR_FloatGrid_Destroy() to free it when you're done using it.

◆ MR_mul_MR_FloatGrid()

MRC_API MR_FloatGrid * MR_mul_MR_FloatGrid ( const MR_FloatGrid * a,
const MR_FloatGrid * b )

intersection operation on two signed distance fields

Note
this operation returns new FloatGrid keeping a,b untouched Generated from function MR::operator*. Parameter a can not be null. It is a single object. Parameter b can not be null. It is a single object. Never returns null. Returns an instance allocated on the heap! Must call MR_FloatGrid_Destroy() to free it when you're done using it.

◆ MR_resampled_float()

MRC_API MR_FloatGrid * MR_resampled_float ( const MR_FloatGrid * grid,
float voxelScale,
MR_PassBy cb_pass_by,
MR_std_function_bool_from_float * cb )

resample this grid to fit voxelScale Generated from function MR::resampled. Parameter grid can not be null. It is a single object. Parameter cb has a default argument: {}, pass MR_PassBy_DefaultArgument and a null pointer to use it. Never returns null. Returns an instance allocated on the heap! Must call MR_FloatGrid_Destroy() to free it when you're done using it.

◆ MR_resampled_MR_Vector3f()

MRC_API MR_FloatGrid * MR_resampled_MR_Vector3f ( const MR_FloatGrid * grid,
const MR_Vector3f * voxelScale,
MR_PassBy cb_pass_by,
MR_std_function_bool_from_float * cb )

resample this grid to fit voxelScale Generated from function MR::resampled. Parameter grid can not be null. It is a single object. Parameter voxelScale can not be null. It is a single object. Parameter cb has a default argument: {}, pass MR_PassBy_DefaultArgument and a null pointer to use it. Never returns null. Returns an instance allocated on the heap! Must call MR_FloatGrid_Destroy() to free it when you're done using it.

◆ MR_setLevelSetType()

MRC_API void MR_setLevelSetType ( MR_FloatGrid * grid)

sets type of this grid as LEVEL SET (for normal flipping) Generated from function MR::setLevelSetType. Parameter grid can not be null. It is a single object.

◆ MR_setValue_MR_Vector3i()

MRC_API void MR_setValue_MR_Vector3i ( MR_FloatGrid * grid,
const MR_Vector3i * p,
float value )

sets given region voxels value

Note
region is in grid space (0 voxel id is minimum active voxel in grid) Generated from function MR::setValue. Parameter grid can not be null. It is a single object. Parameter p can not be null. It is a single object.

◆ MR_setValue_MR_VoxelBitSet()

MRC_API void MR_setValue_MR_VoxelBitSet ( MR_FloatGrid * grid,
const MR_VoxelBitSet * region,
float value )

sets given region voxels value

Note
region is in grid space (0 voxel id is minimum active voxel in grid) Generated from function MR::setValue. Parameter grid can not be null. It is a single object. Parameter region can not be null. It is a single object.

◆ MR_setValues()

MRC_API void MR_setValues ( MR_FloatGrid * grid,
const MR_VoxelBitSet * region,
const MR_std_vector_float * values )

sets given region voxels value one by one

Note
region is in grid space (0 voxel id is minimum active voxel in grid) Generated from function MR::setValues. Parameter grid can not be null. It is a single object. Parameter region can not be null. It is a single object. Parameter values can not be null. It is a single object.

◆ MR_sub_assign_MR_FloatGrid()

MRC_API MR_FloatGrid * MR_sub_assign_MR_FloatGrid ( MR_FloatGrid * a,
MR_FloatGrid * b )

difference operation on two signed distance fields

Note
this operation consumes FloatGrid b Generated from function MR::operator-=. Parameter a can not be null. It is a single object. Parameter b can not be null. It is a single object. In C++ this parameter takes an rvalue reference: it might invalidate the passed object, but if your pointer is owning, you must still destroy it manually later. Never returns null. Returns an instance allocated on the heap! Must call MR_FloatGrid_Destroy() to free it when you're done using it.

◆ MR_sub_MR_FloatGrid()

MRC_API MR_FloatGrid * MR_sub_MR_FloatGrid ( const MR_FloatGrid * a,
const MR_FloatGrid * b )

difference operation on two signed distance fields

Note
this operation returns new FloatGrid keeping a,b untouched Generated from function MR::operator-. Parameter a can not be null. It is a single object. Parameter b can not be null. It is a single object. Never returns null. Returns an instance allocated on the heap! Must call MR_FloatGrid_Destroy() to free it when you're done using it.