MeshLib C Docs
Loading...
Searching...
No Matches
MRPointCloud.h File Reference
#include <MRCMesh/MRBox.h>
#include <MRCMesh/MRId.h>
#include <MRCMesh/MRMeshFwd.h>
#include <MRCMesh/MRVector3.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_AABBTreePoints MR_AABBTreePoints
 
typedef struct MR_AffineXf3f MR_AffineXf3f
 
typedef struct MR_CloudPartMapping MR_CloudPartMapping
 
typedef struct MR_Plane3f MR_Plane3f
 
typedef struct MR_VertBMap MR_VertBMap
 
typedef struct MR_VertBitSet MR_VertBitSet
 
typedef struct MR_VertCoords MR_VertCoords
 
typedef struct MR_VertMap MR_VertMap
 
typedef struct MR_std_vector_MR_VertId MR_std_vector_MR_VertId
 
typedef struct MR_PointCloud MR_PointCloud
 Generated from class MR::PointCloud.
 

Functions

MRC_API const MR_VertCoordsMR_PointCloud_Get_points (const MR_PointCloud *_this)
 
MRC_API void MR_PointCloud_Set_points (MR_PointCloud *_this, MR_PassBy value_pass_by, MR_VertCoords *value)
 
MRC_API MR_VertCoordsMR_PointCloud_GetMutable_points (MR_PointCloud *_this)
 
MRC_API const MR_VertCoordsMR_PointCloud_Get_normals (const MR_PointCloud *_this)
 
MRC_API void MR_PointCloud_Set_normals (MR_PointCloud *_this, MR_PassBy value_pass_by, MR_VertCoords *value)
 
MRC_API MR_VertCoordsMR_PointCloud_GetMutable_normals (MR_PointCloud *_this)
 
MRC_API const MR_VertBitSetMR_PointCloud_Get_validPoints (const MR_PointCloud *_this)
 
MRC_API void MR_PointCloud_Set_validPoints (MR_PointCloud *_this, MR_PassBy value_pass_by, MR_VertBitSet *value)
 
MRC_API MR_VertBitSetMR_PointCloud_GetMutable_validPoints (MR_PointCloud *_this)
 
MRC_API MR_PointCloudMR_PointCloud_DefaultConstruct (void)
 
MRC_API MR_PointCloudMR_PointCloud_DefaultConstructArray (size_t num_elems)
 
MRC_API const MR_PointCloudMR_PointCloud_OffsetPtr (const MR_PointCloud *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.
 
MRC_API MR_PointCloudMR_PointCloud_OffsetMutablePtr (MR_PointCloud *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.
 
MRC_API MR_PointCloudMR_PointCloud_ConstructFromAnother (MR_PassBy _other_pass_by, MR_PointCloud *_other)
 
MRC_API void MR_PointCloud_Destroy (const MR_PointCloud *_this)
 Destroys a heap-allocated instance of MR_PointCloud. Does nothing if the pointer is null.
 
MRC_API void MR_PointCloud_DestroyArray (const MR_PointCloud *_this)
 Destroys a heap-allocated array of MR_PointCloud. Does nothing if the pointer is null.
 
MRC_API MR_PointCloudMR_PointCloud_AssignFromAnother (MR_PointCloud *_this, MR_PassBy _other_pass_by, MR_PointCloud *_other)
 
MRC_API MR_uint64_t MR_PointCloud_calcNumValidPoints (const MR_PointCloud *_this)
 
MRC_API bool MR_PointCloud_hasNormals (const MR_PointCloud *_this)
 
MRC_API const MR_VertBitSetMR_PointCloud_getVertIds (const MR_PointCloud *_this, const MR_VertBitSet *region)
 
MRC_API const MR_AABBTreePointsMR_PointCloud_getAABBTree (const MR_PointCloud *_this)
 
MRC_API const MR_AABBTreePointsMR_PointCloud_getAABBTreeNotCreate (const MR_PointCloud *_this)
 
MRC_API MR_Box3f MR_PointCloud_getBoundingBox (const MR_PointCloud *_this)
 
MRC_API MR_Box3f MR_PointCloud_computeBoundingBox_1 (const MR_PointCloud *_this, const MR_AffineXf3f *toWorld)
 
MRC_API MR_Box3f MR_PointCloud_computeBoundingBox_2 (const MR_PointCloud *_this, const MR_VertBitSet *region, const MR_AffineXf3f *toWorld)
 
MRC_API MR_Vector3f MR_PointCloud_findCenterFromPoints (const MR_PointCloud *_this)
 
MRC_API MR_Vector3f MR_PointCloud_findCenterFromBBox (const MR_PointCloud *_this)
 
MRC_API MR_std_vector_MR_VertIdMR_PointCloud_getLexicographicalOrder (const MR_PointCloud *_this)
 
MRC_API void MR_PointCloud_addPartByMask (MR_PointCloud *_this, const MR_PointCloud *from, const MR_VertBitSet *fromVerts, const MR_CloudPartMapping *outMap, const MR_VertCoords *extNormals)
 
MRC_API MR_VertId MR_PointCloud_addPoint_1 (MR_PointCloud *_this, const MR_Vector3f *point)
 
MRC_API MR_VertId MR_PointCloud_addPoint_2 (MR_PointCloud *_this, const MR_Vector3f *point, const MR_Vector3f *normal)
 
MRC_API void MR_PointCloud_mirror (MR_PointCloud *_this, const MR_Plane3f *plane)
 
MRC_API void MR_PointCloud_flipOrientation (MR_PointCloud *_this, const MR_VertBitSet *region)
 
MRC_API bool MR_PointCloud_pack_MR_VertMap_ptr (MR_PointCloud *_this, MR_VertMap *outNew2Old)
 
MRC_API MR_VertBMapMR_PointCloud_pack_MR_Reorder (MR_PointCloud *_this, MR_Reorder reoder)
 
MRC_API void MR_PointCloud_invalidateCaches (MR_PointCloud *_this)
 
MRC_API MR_uint64_t MR_PointCloud_heapBytes (const MR_PointCloud *_this)
 

Typedef Documentation

◆ MR_AABBTreePoints

◆ MR_AffineXf3f

typedef struct MR_AffineXf3f MR_AffineXf3f

◆ MR_CloudPartMapping

◆ MR_Plane3f

typedef struct MR_Plane3f MR_Plane3f

◆ MR_PointCloud

typedef struct MR_PointCloud MR_PointCloud

Generated from class MR::PointCloud.

◆ MR_std_vector_MR_VertId

◆ MR_VertBitSet

typedef struct MR_VertBitSet MR_VertBitSet

◆ MR_VertBMap

typedef struct MR_VertBMap MR_VertBMap

◆ MR_VertCoords

typedef struct MR_VertCoords MR_VertCoords

◆ MR_VertMap

typedef struct MR_VertMap MR_VertMap

Function Documentation

◆ MR_PointCloud_addPartByMask()

MRC_API void MR_PointCloud_addPartByMask ( MR_PointCloud * _this,
const MR_PointCloud * from,
const MR_VertBitSet * fromVerts,
const MR_CloudPartMapping * outMap,
const MR_VertCoords * extNormals )

appends points (and normals if it possible) (from) in addition to this points if this obj have normals and from obj has not it then don't do anything

Parameters
extNormalsif given then they will be copied instead of from.normals Generated from a method of class MR::PointCloud named addPartByMask. Parameter _this can not be null. It is a single object. Parameter from can not be null. It is a single object. Parameter fromVerts can not be null. It is a single object. Parameter outMap is a single object. Parameter outMap has a default argument: {}, pass a null pointer to use it. Parameter extNormals defaults to a null pointer in C++.

◆ MR_PointCloud_addPoint_1()

MRC_API MR_VertId MR_PointCloud_addPoint_1 ( MR_PointCloud * _this,
const MR_Vector3f * point )

appends a point and returns its VertId Generated from a method of class MR::PointCloud named addPoint. Parameter _this can not be null. It is a single object. Parameter point can not be null. It is a single object.

◆ MR_PointCloud_addPoint_2()

MRC_API MR_VertId MR_PointCloud_addPoint_2 ( MR_PointCloud * _this,
const MR_Vector3f * point,
const MR_Vector3f * normal )

appends a point with normal and returns its VertId Generated from a method of class MR::PointCloud named addPoint. Parameter _this can not be null. It is a single object. Parameter point can not be null. It is a single object. Parameter normal can not be null. It is a single object.

◆ MR_PointCloud_AssignFromAnother()

MRC_API MR_PointCloud * MR_PointCloud_AssignFromAnother ( MR_PointCloud * _this,
MR_PassBy _other_pass_by,
MR_PointCloud * _other )

Generated from a method of class MR::PointCloud named 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_PointCloud_calcNumValidPoints()

MRC_API MR_uint64_t MR_PointCloud_calcNumValidPoints ( const MR_PointCloud * _this)

computes the total number of valid points in the cloud Generated from a method of class MR::PointCloud named calcNumValidPoints. Parameter _this can not be null. It is a single object.

◆ MR_PointCloud_computeBoundingBox_1()

MRC_API MR_Box3f MR_PointCloud_computeBoundingBox_1 ( const MR_PointCloud * _this,
const MR_AffineXf3f * toWorld )

passes through all valid points and finds the minimal bounding box containing all of them; if toWorld transformation is given then returns minimal bounding box in world space Generated from a method of class MR::PointCloud named computeBoundingBox. Parameter _this can not be null. It is a single object. Parameter toWorld defaults to a null pointer in C++.

◆ MR_PointCloud_computeBoundingBox_2()

MRC_API MR_Box3f MR_PointCloud_computeBoundingBox_2 ( const MR_PointCloud * _this,
const MR_VertBitSet * region,
const MR_AffineXf3f * toWorld )

passes through all given vertices (or all valid vertices if region == null) and finds the minimal bounding box containing all of them if toWorld transformation is given then returns minimal bounding box in world space Generated from a method of class MR::PointCloud named computeBoundingBox. Parameter _this can not be null. It is a single object. Parameter toWorld defaults to a null pointer in C++.

◆ MR_PointCloud_ConstructFromAnother()

MRC_API MR_PointCloud * MR_PointCloud_ConstructFromAnother ( MR_PassBy _other_pass_by,
MR_PointCloud * _other )

Generated from a constructor of class MR::PointCloud. Never returns null. Returns an instance allocated on the heap! Must call MR_PointCloud_Destroy() to free it when you're done using it.

◆ MR_PointCloud_DefaultConstruct()

MRC_API MR_PointCloud * MR_PointCloud_DefaultConstruct ( void )

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

◆ MR_PointCloud_DefaultConstructArray()

MRC_API MR_PointCloud * MR_PointCloud_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_PointCloud_DestroyArray(). Use MR_PointCloud_OffsetMutablePtr() and MR_PointCloud_OffsetPtr() to access the array elements.

◆ MR_PointCloud_Destroy()

MRC_API void MR_PointCloud_Destroy ( const MR_PointCloud * _this)

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

◆ MR_PointCloud_DestroyArray()

MRC_API void MR_PointCloud_DestroyArray ( const MR_PointCloud * _this)

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

◆ MR_PointCloud_findCenterFromBBox()

MRC_API MR_Vector3f MR_PointCloud_findCenterFromBBox ( const MR_PointCloud * _this)

computes bounding box and returns its center Generated from a method of class MR::PointCloud named findCenterFromBBox. Parameter _this can not be null. It is a single object.

◆ MR_PointCloud_findCenterFromPoints()

MRC_API MR_Vector3f MR_PointCloud_findCenterFromPoints ( const MR_PointCloud * _this)

computes average position of all valid points Generated from a method of class MR::PointCloud named findCenterFromPoints. Parameter _this can not be null. It is a single object.

◆ MR_PointCloud_flipOrientation()

MRC_API void MR_PointCloud_flipOrientation ( MR_PointCloud * _this,
const MR_VertBitSet * region )

flip orientation (normals) of given points (or all valid points is nullptr) Generated from a method of class MR::PointCloud named flipOrientation. Parameter _this can not be null. It is a single object. Parameter region defaults to a null pointer in C++.

◆ MR_PointCloud_Get_normals()

MRC_API const MR_VertCoords * MR_PointCloud_Get_normals ( const MR_PointCloud * _this)

unit normal directions of points (can be empty if no normals are known) Returns a pointer to a member variable of class MR::PointCloud named normals. 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_PointCloud_Get_points()

MRC_API const MR_VertCoords * MR_PointCloud_Get_points ( const MR_PointCloud * _this)

coordinates of points Returns a pointer to a member variable of class MR::PointCloud 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_PointCloud_Get_validPoints()

MRC_API const MR_VertBitSet * MR_PointCloud_Get_validPoints ( const MR_PointCloud * _this)

only points and normals corresponding to set bits here are valid Returns a pointer to a member variable of class MR::PointCloud 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_PointCloud_getAABBTree()

MRC_API const MR_AABBTreePoints * MR_PointCloud_getAABBTree ( const MR_PointCloud * _this)

returns cached aabb-tree for this point cloud, creating it if it did not exist in a thread-safe manner Generated from a method of class MR::PointCloud named getAABBTree. 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_PointCloud_getAABBTreeNotCreate()

MRC_API const MR_AABBTreePoints * MR_PointCloud_getAABBTreeNotCreate ( const MR_PointCloud * _this)

returns cached aabb-tree for this point cloud, but does not create it if it did not exist Generated from a method of class MR::PointCloud named getAABBTreeNotCreate. Parameter _this can not be null. It is a single object.

◆ MR_PointCloud_getBoundingBox()

MRC_API MR_Box3f MR_PointCloud_getBoundingBox ( const MR_PointCloud * _this)

returns the minimal bounding box containing all valid vertices (implemented via getAABBTree()) Generated from a method of class MR::PointCloud named getBoundingBox. Parameter _this can not be null. It is a single object.

◆ MR_PointCloud_getLexicographicalOrder()

MRC_API MR_std_vector_MR_VertId * MR_PointCloud_getLexicographicalOrder ( const MR_PointCloud * _this)

returns all valid point ids sorted lexicographically by their coordinates (optimal for uniform sampling) Generated from a method of class MR::PointCloud named getLexicographicalOrder. 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_vector_MR_VertId_Destroy() to free it when you're done using it.

◆ MR_PointCloud_GetMutable_normals()

MRC_API MR_VertCoords * MR_PointCloud_GetMutable_normals ( MR_PointCloud * _this)

unit normal directions of points (can be empty if no normals are known) Returns a mutable pointer to a member variable of class MR::PointCloud named normals. 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_PointCloud_GetMutable_points()

MRC_API MR_VertCoords * MR_PointCloud_GetMutable_points ( MR_PointCloud * _this)

coordinates of points Returns a mutable pointer to a member variable of class MR::PointCloud 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_PointCloud_GetMutable_validPoints()

MRC_API MR_VertBitSet * MR_PointCloud_GetMutable_validPoints ( MR_PointCloud * _this)

only points and normals corresponding to set bits here are valid Returns a mutable pointer to a member variable of class MR::PointCloud 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_PointCloud_getVertIds()

MRC_API const MR_VertBitSet * MR_PointCloud_getVertIds ( const MR_PointCloud * _this,
const MR_VertBitSet * region )

if region pointer is not null then converts it in reference, otherwise returns all valid points in the cloud Generated from a method of class MR::PointCloud named getVertIds. 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_PointCloud_hasNormals()

MRC_API bool MR_PointCloud_hasNormals ( const MR_PointCloud * _this)

returns true if there is a normal for each point Generated from a method of class MR::PointCloud named hasNormals. Parameter _this can not be null. It is a single object.

◆ MR_PointCloud_heapBytes()

MRC_API MR_uint64_t MR_PointCloud_heapBytes ( const MR_PointCloud * _this)

returns the amount of memory this object occupies on heap Generated from a method of class MR::PointCloud named heapBytes. Parameter _this can not be null. It is a single object.

◆ MR_PointCloud_invalidateCaches()

MRC_API void MR_PointCloud_invalidateCaches ( MR_PointCloud * _this)

Invalidates caches (e.g. aabb-tree) after a change in point cloud Generated from a method of class MR::PointCloud named invalidateCaches. Parameter _this can not be null. It is a single object.

◆ MR_PointCloud_mirror()

MRC_API void MR_PointCloud_mirror ( MR_PointCloud * _this,
const MR_Plane3f * plane )

reflects the points from a given plane Generated from a method of class MR::PointCloud named mirror. Parameter _this can not be null. It is a single object. Parameter plane can not be null. It is a single object.

◆ MR_PointCloud_OffsetMutablePtr()

MRC_API MR_PointCloud * MR_PointCloud_OffsetMutablePtr ( MR_PointCloud * 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.

◆ MR_PointCloud_OffsetPtr()

MRC_API const MR_PointCloud * MR_PointCloud_OffsetPtr ( const MR_PointCloud * 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.

◆ MR_PointCloud_pack_MR_Reorder()

MRC_API MR_VertBMap * MR_PointCloud_pack_MR_Reorder ( MR_PointCloud * _this,
MR_Reorder reoder )

tightly packs all arrays eliminating invalid points, reorders valid points according to given strategy;

Returns
points mapping: old -> new Generated from a method of class MR::PointCloud named pack. Parameter _this can not be null. It is a single object. Never returns null. Returns an instance allocated on the heap! Must call MR_VertBMap_Destroy() to free it when you're done using it.

◆ MR_PointCloud_pack_MR_VertMap_ptr()

MRC_API bool MR_PointCloud_pack_MR_VertMap_ptr ( MR_PointCloud * _this,
MR_VertMap * outNew2Old )

tightly packs all arrays eliminating invalid points, but relative order of valid points is preserved; returns false if the cloud was packed before the call and nothing has been changed; if pack is done optionally returns mappings: new.id -> old.id Generated from a method of class MR::PointCloud named pack. Parameter _this can not be null. It is a single object. Parameter outNew2Old defaults to a null pointer in C++.

◆ MR_PointCloud_Set_normals()

MRC_API void MR_PointCloud_Set_normals ( MR_PointCloud * _this,
MR_PassBy value_pass_by,
MR_VertCoords * value )

unit normal directions of points (can be empty if no normals are known) Modifies a member variable of class MR::PointCloud named normals. Parameter _this can not be null. It is a single object.

◆ MR_PointCloud_Set_points()

MRC_API void MR_PointCloud_Set_points ( MR_PointCloud * _this,
MR_PassBy value_pass_by,
MR_VertCoords * value )

coordinates of points Modifies a member variable of class MR::PointCloud named points. Parameter _this can not be null. It is a single object.

◆ MR_PointCloud_Set_validPoints()

MRC_API void MR_PointCloud_Set_validPoints ( MR_PointCloud * _this,
MR_PassBy value_pass_by,
MR_VertBitSet * value )

only points and normals corresponding to set bits here are valid Modifies a member variable of class MR::PointCloud named validPoints. Parameter _this can not be null. It is a single object.