24 using BoxT =
typename T::BoxT;
#define MRMESH_API
Definition MRMeshFwd.h:85
#define MRMESH_CLASS
Definition MRMeshFwd.h:92
base class for the AABB-trees of polylines and objects
Definition MRAABBTreeBase.h:15
Vector<T> is indexed by size_t.
Definition MRVector.h:24
NodeVec nodes_
Definition MRAABBTreeBase.h:87
NodeBitSet getNodesFromLeaves(const LeafBitSet &leaves) const
returns set of not-leaf nodes containing among direct or indirect children given leaves
void getLeafOrderAndReset(LeafBMap &leafMap)
Leaves leaves_
Definition MRAABBTreeBase.h:88
typename T::BoxT BoxT
Definition MRAABBTreeBase.h:24
size_t numLeaves() const
returns the number of leaves in whole tree
Definition MRAABBTreeBase.h:64
AABBTreeNode< Traits > Node
Definition MRAABBTreeBase.h:18
const NodeVec & nodes() const
const-access to all not-leaf nodes, a tree with N leaves has N-1 nodes
Definition MRAABBTreeBase.h:30
void getLeafOrder(LeafBMap &leafMap) const
T Traits
Definition MRAABBTreeBase.h:17
BMap< LeafId, LeafId > LeafBMap
Definition MRAABBTreeBase.h:23
Vector< Node, NodeId > NodeVec
Definition MRAABBTreeBase.h:19
typename T::LeafTag LeafTag
Definition MRAABBTreeBase.h:20
std::vector< NodeId > getSubtrees(int minNum) const
returns at least given number of top-level not-intersecting subtrees (some can be leaves),...
const Leaves & leaves() const
all leaves in the order of the tree right after its construction
Definition MRAABBTreeBase.h:36
BoxedLeaf< T > Leaf
Definition MRAABBTreeBase.h:25
Vector< Leaf > Leaves
Definition MRAABBTreeBase.h:26
void build_(Vector< BoxedLeaf< T > > leaves)
builds the tree from given leaves with their boxes
TaggedBitSet< LeafTag > LeafBitSet
Definition MRAABBTreeBase.h:22
LeafBitSet getSubtreeLeaves(NodeId subtreeRoot) const
returns all leaves in the subtree with given root (can be a leaf)
LeafId leafId(NodeId n) const
returns the id of the leaf encoded in given node id
Definition MRAABBTreeBase.h:45
BoxT getBoundingBox() const
returns the root node bounding box
Definition MRAABBTreeBase.h:58
const BoxT & box(NodeId n) const
returns the bounding box of given node or leaf
Definition MRAABBTreeBase.h:48
const Leaf & leaf(NodeId n) const
returns the leaf encoded in given node id
Definition MRAABBTreeBase.h:42
NodeId rootNodeId() const
Definition MRAABBTreeBase.h:55
const Node & operator[](NodeId nid) const
const-access to any not-leaf node
Definition MRAABBTreeBase.h:33
static bool isLeaf(NodeId n)
returns true if given node id is in fact a leaf (encoded as negative number)
Definition MRAABBTreeBase.h:39
bool empty() const
returns true if the tree has no leaves
Definition MRAABBTreeBase.h:51
size_t heapBytes() const
returns the amount of memory this object occupies on heap
Definition MRAABBTreeBase.h:61
typename T::LeafId LeafId
Definition MRAABBTreeBase.h:21
Only strictly necessary for the bindings (to make MR::MeshIntersectionResult a complete type).
Definition MRCameraOrientationPlugin.h:8
static size_t leafIndex(NodeId child)
returns the index in the vector of leaves of the leaf encoded in given child of a node
Definition MRAABBTreeNode.h:44
static NodeId leafChild(size_t leafIndex)
encodes given index in the vector of leaves as a child of a node
Definition MRAABBTreeNode.h:46
static bool isLeaf(NodeId child)
returns true if given child of a node is a leaf rather than another node
Definition MRAABBTreeNode.h:42
Definition MRAABBTreeNode.h:51
flat map: I -> T
Definition MRBuffer.h:148
a leaf of AABB-tree: the id of an object (e.g. face) with its bounding box
Definition MRAABBTreeNode.h:30