24 bool leaf()
const {
return !
l.valid(); }
28 void setLeafPointRange(
int first,
int last ) {
l = NodeId( -( first + 1 ) );
r = NodeId( -( last + 1 ) ); }
33 [[nodiscard]]
const Node&
operator[]( NodeId nid )
const {
return nodes_[nid]; }
34 [[nodiscard]]
static NodeId
rootNodeId() {
return NodeId{0}; }
43 [[nodiscard]]
const std::vector<Point>&
orderedPoints()
const {
return orderedPoints_; }
75 MRMESH_API void refit( const VertCoords & newCoords, const VertBitSet & changedVerts );
78 std::vector<
Point> orderedPoints_;
#define MRMESH_API
Definition MRMesh/MRMeshFwd.h:79
bounding volume hierarchy for point cloud structure
Definition MRAABBTreePoints.h:16
MRMESH_API void getLeafOrderAndReset(VertBMap &vertMap)
const Node & operator[](NodeId nid) const
Definition MRAABBTreePoints.h:33
MRMESH_API size_t heapBytes() const
returns the amount of memory this object occupies on heap
const std::vector< Point > & orderedPoints() const
Definition MRAABBTreePoints.h:43
AABBTreePoints(AABBTreePoints &&) noexcept=default
const NodeVec & nodes() const
Definition MRAABBTreePoints.h:32
static constexpr int MaxNumPointsInLeaf
maximum number of points in leaf node of tree (all of leafs should have this number of points except ...
Definition MRAABBTreePoints.h:55
Box3f getBoundingBox() const
returns the root node bounding box
Definition MRAABBTreePoints.h:36
MRMESH_API AABBTreePoints(const VertCoords &points, const VertBitSet *validPoints=nullptr)
creates tree from given valid points
MRMESH_API AABBTreePoints(const Mesh &mesh)
creates tree for vertices of given mesh
MRMESH_API void refit(const VertCoords &newCoords, const VertBitSet &changedVerts)
static NodeId rootNodeId()
Definition MRAABBTreePoints.h:34
MRMESH_API void getLeafOrder(VertBMap &vertMap) const
MRMESH_API AABBTreePoints(const PointCloud &pointCloud)
creates tree for given point cloud
AABBTreePoints(const VertCoords &points, const VertBitSet &validPoints)
creates tree from given valid points
Definition MRAABBTreePoints.h:52
Definition MRSharedThreadSafeOwner.h:19
container of bits representing specific indices (faces, verts or edges)
Definition MRMesh/MRBitSet.h:127
Definition MRUniqueThreadSafeOwner.h:18
bool empty() const
Definition MRMesh/MRVector.h:40
Definition MRAABBTreePoints.h:19
void setLeafPointRange(int first, int last)
sets [first,last) to this node (leaf)
Definition MRAABBTreePoints.h:28
Box3f box
bounding box of whole subtree
Definition MRAABBTreePoints.h:20
std::pair< int, int > getLeafPointRange() const
returns [first,last) indices of leaf points
Definition MRAABBTreePoints.h:26
bool leaf() const
returns true if node represent real points, false if it has child nodes
Definition MRAABBTreePoints.h:24
NodeId r
Definition MRAABBTreePoints.h:22
NodeId l
left child node for an inner node, or -(l+1) is the index of the first point in a leaf node
Definition MRAABBTreePoints.h:21
Definition MRAABBTreePoints.h:39
Vector3f coord
Definition MRAABBTreePoints.h:40
VertId id
Definition MRAABBTreePoints.h:41
Definition MRMesh/MRMesh.h:22
Definition MRMesh/MRPointCloud.h:16