#include <MRPointCloud.h>
Public Member Functions | |
size_t | calcNumValidPoints () const |
computes the total number of valid points in the cloud | |
bool | hasNormals () const |
returns true if there is a normal for each point | |
const VertBitSet & | getVertIds (const VertBitSet *region) const |
if region pointer is not null then converts it in reference, otherwise returns all valid points in the cloud | |
MRMESH_API const AABBTreePoints & | getAABBTree () const |
returns cached aabb-tree for this point cloud, creating it if it did not exist in a thread-safe manner | |
const AABBTreePoints * | getAABBTreeNotCreate () const |
returns cached aabb-tree for this point cloud, but does not create it if it did not exist | |
MRMESH_API Box3f | getBoundingBox () const |
returns the minimal bounding box containing all valid vertices (implemented via getAABBTree()) | |
MRMESH_API Box3f | computeBoundingBox (const AffineXf3f *toWorld=nullptr) const |
MRMESH_API Vector3f | findCenterFromPoints () const |
computes average position of all valid points | |
MRMESH_API Vector3f | findCenterFromBBox () const |
computes bounding box and returns its center | |
MRMESH_API std::vector< VertId > | getLexicographicalOrder () const |
returns all valid point ids sorted lexicographically by their coordinates (optimal for uniform sampling) | |
MRMESH_API void | addPartByMask (const PointCloud &from, const VertBitSet &fromVerts, const CloudPartMapping &outMap={}, const VertNormals *extNormals=nullptr) |
MRMESH_API VertId | addPoint (const Vector3f &point) |
appends a point and returns its VertId | |
MRMESH_API VertId | addPoint (const Vector3f &point, const Vector3f &normal) |
appends a point with normal and returns its VertId | |
MRMESH_API void | mirror (const Plane3f &plane) |
reflects the points from a given plane | |
MRMESH_API void | flipOrientation (const VertBitSet *region=nullptr) |
flip orientation (normals) of given points (or all valid points is nullptr) | |
MRMESH_API bool | pack (VertMap *outNew2Old=nullptr) |
MRMESH_API VertBMap | pack (Reorder reoder) |
void | invalidateCaches () |
Invalidates caches (e.g. aabb-tree) after a change in point cloud. | |
MRMESH_API size_t | heapBytes () const |
returns the amount of memory this object occupies on heap | |
Public Attributes | |
VertCoords | points |
coordinates of points | |
VertNormals | normals |
unit normal directions of points (can be empty if no normals are known) | |
VertBitSet | validPoints |
only points and normals corresponding to set bits here are valid | |
MRMESH_API void MR::PointCloud::addPartByMask | ( | const PointCloud & | from, |
const VertBitSet & | fromVerts, | ||
const CloudPartMapping & | outMap = {}, | ||
const VertNormals * | extNormals = nullptr ) |
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
extNormals | if given then they will be copied instead of from.normals |
MRMESH_API VertId MR::PointCloud::addPoint | ( | const Vector3f & | point | ) |
appends a point and returns its VertId
MRMESH_API VertId MR::PointCloud::addPoint | ( | const Vector3f & | point, |
const Vector3f & | normal ) |
appends a point with normal and returns its VertId
|
inlinenodiscard |
computes the total number of valid points in the cloud
|
nodiscard |
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
|
nodiscard |
computes bounding box and returns its center
|
nodiscard |
computes average position of all valid points
MRMESH_API void MR::PointCloud::flipOrientation | ( | const VertBitSet * | region = nullptr | ) |
flip orientation (normals) of given points (or all valid points is nullptr)
MRMESH_API const AABBTreePoints & MR::PointCloud::getAABBTree | ( | ) | const |
returns cached aabb-tree for this point cloud, creating it if it did not exist in a thread-safe manner
|
inlinenodiscard |
returns cached aabb-tree for this point cloud, but does not create it if it did not exist
|
nodiscard |
returns the minimal bounding box containing all valid vertices (implemented via getAABBTree())
|
nodiscard |
returns all valid point ids sorted lexicographically by their coordinates (optimal for uniform sampling)
|
inlinenodiscard |
if region pointer is not null then converts it in reference, otherwise returns all valid points in the cloud
|
inlinenodiscard |
returns true if there is a normal for each point
|
nodiscard |
returns the amount of memory this object occupies on heap
|
inline |
Invalidates caches (e.g. aabb-tree) after a change in point cloud.
MRMESH_API void MR::PointCloud::mirror | ( | const Plane3f & | plane | ) |
reflects the points from a given plane
MRMESH_API VertBMap MR::PointCloud::pack | ( | Reorder | reoder | ) |
tightly packs all arrays eliminating invalid points, reorders valid points according to given strategy;
MRMESH_API bool MR::PointCloud::pack | ( | VertMap * | outNew2Old = nullptr | ) |
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
VertNormals MR::PointCloud::normals |
unit normal directions of points (can be empty if no normals are known)
VertCoords MR::PointCloud::points |
coordinates of points
VertBitSet MR::PointCloud::validPoints |
only points and normals corresponding to set bits here are valid