MeshLib C++ Docs
Loading...
Searching...
No Matches
MRAABBTreeMaker.h
Go to the documentation of this file.
1#pragma once
2
3#include "MRAABBTreeNode.h"
4#include "MRVector.h"
5#include "MRFunctional.h"
6
7namespace MR
8{
9
12
14inline int getNumNodes( int numLeaves )
15{
16 assert( numLeaves > 0 );
17 return numLeaves - 1;
18}
19
21using OnLeafCallback = FunctionRef<void( size_t leafIndex, size_t boxedLeafIndex )>;
22
25template<typename T>
27
29
30}
Definition MRFunctional.h:15
Vector<T> is indexed by size_t.
Definition MRVector.h:24
Vector< AABBTreeNode< T >, NodeId > AABBTreeNodeVec
Definition MRAABBTreeNode.h:63
int getNumNodes(int numLeaves)
returns the number of not-leaf nodes in the binary tree with given number of leaves
Definition MRAABBTreeMaker.h:14
AABBTreeNodeVec< T > makeAABBTreeNodeVec(const Vector< BoxedLeaf< T > > &boxedLeaves, OnLeafCallback onLeaf)
FunctionRef< void(size_t leafIndex, size_t boxedLeafIndex)> OnLeafCallback
called in parallel for every leaf with its index in the order of the tree and its index in the given ...
Definition MRAABBTreeMaker.h:21
Only strictly necessary for the bindings (to make MR::MeshIntersectionResult a complete type).
Definition MRCameraOrientationPlugin.h:8
a leaf of AABB-tree: the id of an object (e.g. face) with its bounding box
Definition MRAABBTreeNode.h:30