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

Go to the source code of this file.

Classes

struct  MR_ObjVertId
 Generated from class MR::ObjVertId. More...
 

Typedefs

typedef struct MR_AffineXf3f MR_AffineXf3f
 
typedef struct MR_MeshPart MR_MeshPart
 
typedef struct MR_PointCloudPart MR_PointCloudPart
 
typedef struct MR_Vector_MR_ModelPointsData_MR_ObjId MR_Vector_MR_ModelPointsData_MR_ObjId
 
typedef struct MR_VertBitSet MR_VertBitSet
 
typedef struct MR_VertCoords MR_VertCoords
 
typedef struct MR_std_function_bool_from_float MR_std_function_bool_from_float
 
typedef struct MR_std_optional_MR_VertBitSet MR_std_optional_MR_VertBitSet
 
typedef struct MR_std_optional_std_vector_MR_ObjVertId MR_std_optional_std_vector_MR_ObjVertId
 
typedef struct MR_ModelPointsData MR_ModelPointsData
 
typedef struct MR_ObjVertId MR_ObjVertId
 Generated from class MR::ObjVertId.
 

Functions

MRC_API MR_std_optional_MR_VertBitSetMR_verticesGridSampling (const MR_MeshPart *mp, float voxelSize, const MR_std_function_bool_from_float *cb)
 
MRC_API MR_std_optional_MR_VertBitSetMR_pointGridSampling (const MR_PointCloudPart *pcp, float voxelSize, const MR_std_function_bool_from_float *cb)
 
MRC_API const MR_VertCoords *const * MR_ModelPointsData_Get_points (const MR_ModelPointsData *_this)
 
MRC_API void MR_ModelPointsData_Set_points (MR_ModelPointsData *_this, const MR_VertCoords *value)
 
MRC_API const MR_VertCoords ** MR_ModelPointsData_GetMutable_points (MR_ModelPointsData *_this)
 
MRC_API const MR_VertBitSet *const * MR_ModelPointsData_Get_validPoints (const MR_ModelPointsData *_this)
 
MRC_API void MR_ModelPointsData_Set_validPoints (MR_ModelPointsData *_this, const MR_VertBitSet *value)
 
MRC_API const MR_VertBitSet ** MR_ModelPointsData_GetMutable_validPoints (MR_ModelPointsData *_this)
 
MRC_API const MR_AffineXf3f *const * MR_ModelPointsData_Get_xf (const MR_ModelPointsData *_this)
 
MRC_API void MR_ModelPointsData_Set_xf (MR_ModelPointsData *_this, const MR_AffineXf3f *value)
 
MRC_API const MR_AffineXf3f ** MR_ModelPointsData_GetMutable_xf (MR_ModelPointsData *_this)
 
MRC_API const MR_ObjIdMR_ModelPointsData_Get_fakeObjId (const MR_ModelPointsData *_this)
 
MRC_API void MR_ModelPointsData_Set_fakeObjId (MR_ModelPointsData *_this, MR_ObjId value)
 
MRC_API MR_ObjIdMR_ModelPointsData_GetMutable_fakeObjId (MR_ModelPointsData *_this)
 
MRC_API MR_ModelPointsDataMR_ModelPointsData_DefaultConstruct (void)
 
MRC_API MR_ModelPointsDataMR_ModelPointsData_DefaultConstructArray (size_t num_elems)
 
MRC_API MR_ModelPointsDataMR_ModelPointsData_ConstructFrom (const MR_VertCoords *points, const MR_VertBitSet *validPoints, const MR_AffineXf3f *xf, MR_ObjId fakeObjId)
 
MRC_API const MR_ModelPointsDataMR_ModelPointsData_OffsetPtr (const MR_ModelPointsData *ptr, ptrdiff_t i)
 
MRC_API MR_ModelPointsDataMR_ModelPointsData_OffsetMutablePtr (MR_ModelPointsData *ptr, ptrdiff_t i)
 
MRC_API MR_ModelPointsDataMR_ModelPointsData_ConstructFromAnother (const MR_ModelPointsData *_other)
 
MRC_API void MR_ModelPointsData_Destroy (const MR_ModelPointsData *_this)
 Destroys a heap-allocated instance of MR_ModelPointsData. Does nothing if the pointer is null.
 
MRC_API void MR_ModelPointsData_DestroyArray (const MR_ModelPointsData *_this)
 Destroys a heap-allocated array of MR_ModelPointsData. Does nothing if the pointer is null.
 
MRC_API MR_ModelPointsDataMR_ModelPointsData_AssignFromAnother (MR_ModelPointsData *_this, const MR_ModelPointsData *_other)
 
MRC_API MR_ObjVertId MR_ObjVertId_DefaultConstruct (void)
 Constructs an empty (default-constructed) instance.
 
MRC_API MR_ObjVertIdMR_ObjVertId_DefaultConstructArray (size_t num_elems)
 
MRC_API bool MR_equal_MR_ObjVertId (const MR_ObjVertId *_1, const MR_ObjVertId *_2)
 
MRC_API MR_std_optional_std_vector_MR_ObjVertIdMR_multiModelGridSampling (const MR_Vector_MR_ModelPointsData_MR_ObjId *models, float voxelSize, const MR_std_function_bool_from_float *cb)
 

Typedef Documentation

◆ MR_AffineXf3f

typedef struct MR_AffineXf3f MR_AffineXf3f

◆ MR_MeshPart

typedef struct MR_MeshPart MR_MeshPart

◆ MR_ModelPointsData

structure to contain pointers to model data Generated from class MR::ModelPointsData. 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_ObjVertId

typedef struct MR_ObjVertId MR_ObjVertId

Generated from class MR::ObjVertId.

◆ MR_PointCloudPart

◆ MR_std_function_bool_from_float

◆ MR_std_optional_MR_VertBitSet

◆ MR_std_optional_std_vector_MR_ObjVertId

◆ MR_Vector_MR_ModelPointsData_MR_ObjId

◆ MR_VertBitSet

typedef struct MR_VertBitSet MR_VertBitSet

◆ MR_VertCoords

typedef struct MR_VertCoords MR_VertCoords

Function Documentation

◆ MR_equal_MR_ObjVertId()

MRC_API bool MR_equal_MR_ObjVertId ( const MR_ObjVertId * _1,
const MR_ObjVertId * _2 )

Generated from function MR::operator==. Parameter _1 can not be null. It is a single object. Parameter _2 can not be null. It is a single object.

◆ MR_ModelPointsData_AssignFromAnother()

MRC_API MR_ModelPointsData * MR_ModelPointsData_AssignFromAnother ( MR_ModelPointsData * _this,
const MR_ModelPointsData * _other )

Generated from method MR::ModelPointsData::operator=. Parameter _this can not be null. It is a single object. Parameter _other 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_ModelPointsData_ConstructFrom()

MRC_API MR_ModelPointsData * MR_ModelPointsData_ConstructFrom ( const MR_VertCoords * points,
const MR_VertBitSet * validPoints,
const MR_AffineXf3f * xf,
MR_ObjId fakeObjId )

Constructs MR::ModelPointsData elementwise. The reference to the parameter points might be preserved in the constructed object. The reference to the parameter validPoints might be preserved in the constructed object. The reference to the parameter xf might be preserved in the constructed object. The reference to the parameter fakeObjId might be preserved in the constructed object. Never returns null. Returns an instance allocated on the heap! Must call MR_ModelPointsData_Destroy() to free it when you're done using it. When this function is called, this object will drop any object references it had previously.

◆ MR_ModelPointsData_ConstructFromAnother()

MRC_API MR_ModelPointsData * MR_ModelPointsData_ConstructFromAnother ( const MR_ModelPointsData * _other)

Generated from constructor MR::ModelPointsData::ModelPointsData. Parameter _other 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 the constructed object. Never returns null. Returns an instance allocated on the heap! Must call MR_ModelPointsData_Destroy() to free it when you're done using it.

◆ MR_ModelPointsData_DefaultConstruct()

MRC_API MR_ModelPointsData * MR_ModelPointsData_DefaultConstruct ( void )

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

◆ MR_ModelPointsData_DefaultConstructArray()

MRC_API MR_ModelPointsData * MR_ModelPointsData_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_ModelPointsData_DestroyArray(). Use MR_ModelPointsData_OffsetMutablePtr() and MR_ModelPointsData_OffsetPtr() to access the array elements.

◆ MR_ModelPointsData_Destroy()

MRC_API void MR_ModelPointsData_Destroy ( const MR_ModelPointsData * _this)

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

◆ MR_ModelPointsData_DestroyArray()

MRC_API void MR_ModelPointsData_DestroyArray ( const MR_ModelPointsData * _this)

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

◆ MR_ModelPointsData_Get_fakeObjId()

MRC_API const MR_ObjId * MR_ModelPointsData_Get_fakeObjId ( const MR_ModelPointsData * _this)

if present this value will override ObjId in result ObjVertId Returns a pointer to a member variable of class MR::ModelPointsData named fakeObjId. 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_ModelPointsData_Get_points()

MRC_API const MR_VertCoords *const * MR_ModelPointsData_Get_points ( const MR_ModelPointsData * _this)

all points of model Returns a pointer to a member variable of class MR::ModelPointsData named points. 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_ModelPointsData_Get_validPoints()

MRC_API const MR_VertBitSet *const * MR_ModelPointsData_Get_validPoints ( const MR_ModelPointsData * _this)

bitset of valid points Returns a pointer to a member variable of class MR::ModelPointsData named validPoints. 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_ModelPointsData_Get_xf()

MRC_API const MR_AffineXf3f *const * MR_ModelPointsData_Get_xf ( const MR_ModelPointsData * _this)

model world xf Returns a pointer to a member variable of class MR::ModelPointsData named xf. 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_ModelPointsData_GetMutable_fakeObjId()

MRC_API MR_ObjId * MR_ModelPointsData_GetMutable_fakeObjId ( MR_ModelPointsData * _this)

if present this value will override ObjId in result ObjVertId Returns a mutable pointer to a member variable of class MR::ModelPointsData named fakeObjId. 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_ModelPointsData_GetMutable_points()

MRC_API const MR_VertCoords ** MR_ModelPointsData_GetMutable_points ( MR_ModelPointsData * _this)

all points of model Returns a mutable pointer to a member variable of class MR::ModelPointsData named points. 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_ModelPointsData_GetMutable_validPoints()

MRC_API const MR_VertBitSet ** MR_ModelPointsData_GetMutable_validPoints ( MR_ModelPointsData * _this)

bitset of valid points Returns a mutable pointer to a member variable of class MR::ModelPointsData named validPoints. 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_ModelPointsData_GetMutable_xf()

MRC_API const MR_AffineXf3f ** MR_ModelPointsData_GetMutable_xf ( MR_ModelPointsData * _this)

model world xf Returns a mutable pointer to a member variable of class MR::ModelPointsData named xf. 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_ModelPointsData_OffsetMutablePtr()

MRC_API MR_ModelPointsData * MR_ModelPointsData_OffsetMutablePtr ( MR_ModelPointsData * 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_ModelPointsData_OffsetPtr()

MRC_API const MR_ModelPointsData * MR_ModelPointsData_OffsetPtr ( const MR_ModelPointsData * 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_ModelPointsData_Set_fakeObjId()

MRC_API void MR_ModelPointsData_Set_fakeObjId ( MR_ModelPointsData * _this,
MR_ObjId value )

if present this value will override ObjId in result ObjVertId Modifies a member variable of class MR::ModelPointsData named fakeObjId. Parameter _this can not be null. It is a single object. The reference to the parameter value might be preserved in this object in element fakeObjId. When this function is called, this object will drop object references it had previously in fakeObjId.

◆ MR_ModelPointsData_Set_points()

MRC_API void MR_ModelPointsData_Set_points ( MR_ModelPointsData * _this,
const MR_VertCoords * value )

all points of model Modifies a member variable of class MR::ModelPointsData named points. Parameter _this can not be null. It is a single object. The reference to the parameter value might be preserved in this object in element points. When this function is called, this object will drop object references it had previously in points.

◆ MR_ModelPointsData_Set_validPoints()

MRC_API void MR_ModelPointsData_Set_validPoints ( MR_ModelPointsData * _this,
const MR_VertBitSet * value )

bitset of valid points Modifies a member variable of class MR::ModelPointsData named validPoints. Parameter _this can not be null. It is a single object. The reference to the parameter value might be preserved in this object in element validPoints. When this function is called, this object will drop object references it had previously in validPoints.

◆ MR_ModelPointsData_Set_xf()

MRC_API void MR_ModelPointsData_Set_xf ( MR_ModelPointsData * _this,
const MR_AffineXf3f * value )

model world xf Modifies a member variable of class MR::ModelPointsData named xf. Parameter _this can not be null. It is a single object. The reference to the parameter value might be preserved in this object in element xf. When this function is called, this object will drop object references it had previously in xf.

◆ MR_multiModelGridSampling()

MRC_API MR_std_optional_std_vector_MR_ObjVertId * MR_multiModelGridSampling ( const MR_Vector_MR_ModelPointsData_MR_ObjId * models,
float voxelSize,
const MR_std_function_bool_from_float * cb )

performs sampling of several models respecting their world transformations subdivides models bounding box on voxels of approximately given size and returns at most one point per voxel; if voxelSize<=0 then returns all points from all models as samples; returns std::nullopt if it was terminated by the callback Generated from function MR::multiModelGridSampling. Parameter models can not be null. It is a single object. Parameter cb is a single object. Parameter cb has a default argument: {}, pass a null pointer to use it. Never returns null. Returns an instance allocated on the heap! Must call MR_std_optional_std_vector_MR_ObjVertId_Destroy() to free it when you're done using it.

◆ MR_ObjVertId_DefaultConstruct()

MRC_API MR_ObjVertId MR_ObjVertId_DefaultConstruct ( void )

Constructs an empty (default-constructed) instance.

◆ MR_ObjVertId_DefaultConstructArray()

MRC_API MR_ObjVertId * MR_ObjVertId_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_FreeArray(). Use MR_ObjVertId_OffsetMutablePtr() and MR_ObjVertId_OffsetPtr() to access the array elements.

◆ MR_pointGridSampling()

MRC_API MR_std_optional_MR_VertBitSet * MR_pointGridSampling ( const MR_PointCloudPart * pcp,
float voxelSize,
const MR_std_function_bool_from_float * cb )

performs sampling of cloud points; subdivides point cloud bounding box on voxels of approximately given size and returns at most one point per voxel; if voxelSize<=0 then returns all valid points as samples; returns std::nullopt if it was terminated by the callback Generated from function MR::pointGridSampling. Parameter pcp can not be null. It is a single object. Parameter cb is a single object. Parameter cb has a default argument: {}, pass a null pointer to use it. Never returns null. Returns an instance allocated on the heap! Must call MR_std_optional_MR_VertBitSet_Destroy() to free it when you're done using it.

◆ MR_verticesGridSampling()

MRC_API MR_std_optional_MR_VertBitSet * MR_verticesGridSampling ( const MR_MeshPart * mp,
float voxelSize,
const MR_std_function_bool_from_float * cb )

performs sampling of mesh vertices; subdivides mesh bounding box on voxels of approximately given size and returns at most one vertex per voxel; if voxelSize<=0 then returns all region vertices as samples; returns std::nullopt if it was terminated by the callback Generated from function MR::verticesGridSampling. Parameter mp can not be null. It is a single object. Parameter cb is a single object. Parameter cb has a default argument: {}, pass a null pointer to use it. Never returns null. Returns an instance allocated on the heap! Must call MR_std_optional_MR_VertBitSet_Destroy() to free it when you're done using it.