14template<
typename L,
typename B>
42 [[nodiscard]]
static bool isLeaf( NodeId child ) {
return int( child ) < 0; }
44 [[nodiscard]]
static size_t leafIndex( NodeId child ) { assert(
isLeaf( child ) );
return size_t( ~
int( child ) ); }
53 using BoxT =
typename T::BoxT;
#define MRMESH_CLASS
Definition MRMeshFwd.h:92
stores index of some element, it is made as template class to avoid mixing faces, edges and vertices
Definition MRId.h:20
Vector<T> is indexed by size_t.
Definition MRVector.h:24
Vector< AABBTreeNode< T >, NodeId > AABBTreeNodeVec
Definition MRAABBTreeNode.h:63
LineTreeTraits< Vector2f > LineTreeTraits2
Definition MRAABBTreeNode.h:24
AABBTreeTraits< UndirectedEdgeTag, Box< V > > LineTreeTraits
Definition MRAABBTreeNode.h:23
LineTreeTraits< Vector3f > LineTreeTraits3
Definition MRAABBTreeNode.h:25
constexpr NoInit noInit
Definition MRMeshFwd.h:103
Only strictly necessary for the bindings (to make MR::MeshIntersectionResult a complete type).
Definition MRCameraOrientationPlugin.h:8
the encoding of the children of AABB-tree nodes
Definition MRAABBTreeNode.h:40
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
typename Traits::LeafId LeafId
Definition MRAABBTreeNode.h:52
NodeId r
Definition MRAABBTreeNode.h:56
NodeId l
Definition MRAABBTreeNode.h:56
AABBTreeNode() noexcept=default
BoxT box
Definition MRAABBTreeNode.h:55
typename Traits::BoxT BoxT
Definition MRAABBTreeNode.h:53
Definition MRAABBTreeNode.h:16
L LeafTag
Definition MRAABBTreeNode.h:17
Id< L > LeafId
Definition MRAABBTreeNode.h:18
B BoxT
Definition MRAABBTreeNode.h:19
BoxedLeaf() noexcept=default
T::BoxT box
Definition MRAABBTreeNode.h:32
T::LeafId leafId
Definition MRAABBTreeNode.h:31
Definition MRMeshFwd.h:102
Definition MRAABBTreeNode.h:66
NodeId bNode
Definition MRAABBTreeNode.h:68
NodeId aNode
Definition MRAABBTreeNode.h:67