MeshLib Documentation
Loading...
Searching...
No Matches
MRAABBTreeNode.h
Go to the documentation of this file.
1#pragma once
2
3#include "MRBox.h"
4#include "MRId.h"
5#include "MRVector2.h"
6#include "MRVector3.h"
7
8namespace MR
9{
10
13
14template<typename L, typename B>
16{
17 using LeafTag = L;
18 using LeafId = Id<L>;
19 using BoxT = B;
20};
21
23
24template<typename V>
28
29template<typename T>
31{
32 using LeafId = typename T::LeafId;
33 using BoxT = typename T::BoxT;
34
36 NodeId l, r;
38 bool leaf() const { return !r.valid(); }
40 LeafId leafId() const { assert( leaf() ); return LeafId( int( l ) ); }
41 void setLeafId( LeafId id ) { l = NodeId( int( id ) ); r = NodeId(); }
42};
43
44template<typename T>
46
48
49} // namespace MR
#define MRMESH_CLASS
Definition MRMesh/MRMeshFwd.h:50
Definition MRMesh/MRId.h:13
std::vector<T>-like container that requires specific indexing type,
Definition MRMesh/MRVector.h:20
Definition MRCameraOrientationPlugin.h:8
Definition MRAABBTreeNode.h:31
typename T::LeafId LeafId
Definition MRAABBTreeNode.h:32
NodeId r
Definition MRAABBTreeNode.h:36
NodeId l
Definition MRAABBTreeNode.h:36
bool leaf() const
returns true if this is a leaf node without children nodes but with a LeafId reference
Definition MRAABBTreeNode.h:38
BoxT box
bounding box of whole subtree
Definition MRAABBTreeNode.h:35
void setLeafId(LeafId id)
Definition MRAABBTreeNode.h:41
LeafId leafId() const
returns face (for the leaf node only)
Definition MRAABBTreeNode.h:40
typename T::BoxT BoxT
Definition MRAABBTreeNode.h:33
Definition MRAABBTreeNode.h:16
L LeafTag
Definition MRAABBTreeNode.h:17
B BoxT
Definition MRAABBTreeNode.h:19