MeshLib Documentation
Loading...
Searching...
No Matches
MR::AABBTreePoints Class Reference

bounding volume hierarchy for point cloud structure More...

#include <MRAABBTreePoints.h>

Classes

struct  Node
 
struct  Point
 

Public Types

using NodeVec = Vector<Node, NodeId>
 
using NodeBitSet = TaggedBitSet<NodeTag>
 

Public Member Functions

const NodeVecnodes () const
 
const Nodeoperator[] (NodeId nid) const
 
Box3f getBoundingBox () const
 returns the root node bounding box
 
const std::vector< Point > & orderedPoints () const
 
MRMESH_API AABBTreePoints (const PointCloud &pointCloud)
 creates tree for given point cloud
 
MRMESH_API AABBTreePoints (const Mesh &mesh)
 creates tree for vertices of given mesh
 
MRMESH_API AABBTreePoints (const VertCoords &points, const VertBitSet *validPoints=nullptr)
 creates tree from given valid points
 
 AABBTreePoints (const VertCoords &points, const VertBitSet &validPoints)
 creates tree from given valid points
 
 AABBTreePoints (AABBTreePoints &&) noexcept=default
 
AABBTreePointsoperator= (AABBTreePoints &&) noexcept=default
 
MRMESH_API void getLeafOrder (VertBMap &vertMap) const
 
MRMESH_API void getLeafOrderAndReset (VertBMap &vertMap)
 
MRMESH_API size_t heapBytes () const
 returns the amount of memory this object occupies on heap
 
MRMESH_API void refit (const VertCoords &newCoords, const VertBitSet &changedVerts)
 

Static Public Member Functions

static NodeId rootNodeId ()
 

Static Public Attributes

static constexpr int MaxNumPointsInLeaf = 16
 maximum number of points in leaf node of tree (all of leafs should have this number of points except last one)
 

Friends

class UniqueThreadSafeOwner< AABBTreePoints >
 

Detailed Description

bounding volume hierarchy for point cloud structure

Member Typedef Documentation

◆ NodeBitSet

◆ NodeVec

Constructor & Destructor Documentation

◆ AABBTreePoints() [1/5]

MRMESH_API MR::AABBTreePoints::AABBTreePoints ( const PointCloud & pointCloud)

creates tree for given point cloud

◆ AABBTreePoints() [2/5]

MRMESH_API MR::AABBTreePoints::AABBTreePoints ( const Mesh & mesh)

creates tree for vertices of given mesh

◆ AABBTreePoints() [3/5]

MRMESH_API MR::AABBTreePoints::AABBTreePoints ( const VertCoords & points,
const VertBitSet * validPoints = nullptr )

creates tree from given valid points

◆ AABBTreePoints() [4/5]

MR::AABBTreePoints::AABBTreePoints ( const VertCoords & points,
const VertBitSet & validPoints )
inline

creates tree from given valid points

◆ AABBTreePoints() [5/5]

MR::AABBTreePoints::AABBTreePoints ( AABBTreePoints && )
defaultnoexcept

Member Function Documentation

◆ getBoundingBox()

Box3f MR::AABBTreePoints::getBoundingBox ( ) const
inlinenodiscard

returns the root node bounding box

◆ getLeafOrder()

MRMESH_API void MR::AABBTreePoints::getLeafOrder ( VertBMap & vertMap) const

returns the mapping original VertId to new id following the points order in the tree; buffer in vertMap must be resized before the call, and caller is responsible for filling missing vertex elements

◆ getLeafOrderAndReset()

MRMESH_API void MR::AABBTreePoints::getLeafOrderAndReset ( VertBMap & vertMap)

returns the mapping original VertId to new id following the points order in the tree; then resets leaf order as if the points were renumberd following the mapping; buffer in vertMap must be resized before the call, and caller is responsible for filling missing vertex elements

◆ heapBytes()

MRMESH_API size_t MR::AABBTreePoints::heapBytes ( ) const
nodiscard

returns the amount of memory this object occupies on heap

◆ nodes()

const NodeVec & MR::AABBTreePoints::nodes ( ) const
inlinenodiscard

◆ operator=()

AABBTreePoints & MR::AABBTreePoints::operator= ( AABBTreePoints && )
defaultnoexcept

◆ operator[]()

const Node & MR::AABBTreePoints::operator[] ( NodeId nid) const
inlinenodiscard

◆ orderedPoints()

const std::vector< Point > & MR::AABBTreePoints::orderedPoints ( ) const
inlinenodiscard

◆ refit()

MRMESH_API void MR::AABBTreePoints::refit ( const VertCoords & newCoords,
const VertBitSet & changedVerts )

updates bounding boxes of the nodes containing changed vertices; this is a faster alternative to full tree rebuild (but the tree after refit might be less efficient)

Parameters
newCoordscoordinates of all vertices including changed ones;
changedVertsvertex ids with modified coordinates (since tree construction or last refit)

◆ rootNodeId()

static NodeId MR::AABBTreePoints::rootNodeId ( )
inlinestaticnodiscard

Friends And Related Symbol Documentation

◆ UniqueThreadSafeOwner< AABBTreePoints >

friend class UniqueThreadSafeOwner< AABBTreePoints >
friend

Member Data Documentation

◆ MaxNumPointsInLeaf

int MR::AABBTreePoints::MaxNumPointsInLeaf = 16
staticconstexpr

maximum number of points in leaf node of tree (all of leafs should have this number of points except last one)


The documentation for this class was generated from the following file: