25 [[nodiscard]]
bool leaf()
const {
return count < 0; }
64 [[nodiscard]] Box3f
getBoundingBox()
const {
return nodes_.empty() ? Box3f{} : nodes_.front().box; }
73 [[nodiscard]]
size_t heapBytes()
const {
return nodes_.heapBytes() + leafTris_.heapBytes() + leafBoxes_.heapBytes(); }
#define MRMESH_API
Definition MRMeshFwd.h:85
static constexpr int MaxChildren
Definition MRAABBTree.h:41
const Vector< LeafTri > & leafTris() const
triangles of all leaves, the triangles of each leaf are contiguous
Definition MRAABBTree.h:67
static constexpr int MaxDepth
the deepest level of a node (the root is at 0): the stacks of the traversals are sized for it,...
Definition MRAABBTree.h:44
NodeBitSet getNodesFromFaces(const FaceBitSet &faces) const
returns the nodes having at least one of given triangles in their subtrees
FaceBitSet getSubtreeFaces(NodeId subtreeRoot) const
returns all triangles in the subtree with given root
AABBTree(AABBTree &&) noexcept=default
Box3f getBoundingBox() const
returns the bounding box of the whole tree (empty for an empty tree)
Definition MRAABBTree.h:64
AABBTree(const TriMesh &tmesh, const FaceBitSet *region=nullptr)
AABBTreeWideNode Node
Definition MRAABBTree.h:46
AABBTree & operator=(AABBTree &&) noexcept=default
const Vector< Box3f > & leafBoxes() const
the bounding boxes of the triangles in the order of leafTris(), slightly expanded for robust searches
Definition MRAABBTree.h:70
std::vector< NodeId > getSubtrees(int minNum) const
returns at least given number of top-level not-intersecting subtrees, union of which contain all tree...
void flipOrientation(const FaceBitSet *region=nullptr)
const Vector< Node, NodeId > & nodes() const
the root is the first node, if any
Definition MRAABBTree.h:61
size_t heapBytes() const
returns the amount of memory this object occupies on heap
Definition MRAABBTree.h:73
AABBTree(const MeshPart &mp)
creates tree for given mesh or its part
static constexpr int MaxLeafTris
Definition MRAABBTree.h:42
void refit(const Mesh &mesh, const VertBitSet *changedVerts)
AABBTreeWideLeafTri LeafTri
Definition MRAABBTree.h:47
void addSplitFaces(const Mesh &mesh, const FaceHashMap &new2Old)
void renumber(const FaceBMap &faceMap, const VertBMap &vertMap)
renumbers the triangles and their vertices after the mesh was packed with given maps from old to new ...
void getLeafOrder(FaceBMap &faceMap) const
Definition MRSharedThreadSafeOwner.h:19
Definition MRUniqueThreadSafeOwner.h:18
Vector<T> is indexed by size_t.
Definition MRVector.h:24
HashMap< FaceId, FaceId > FaceHashMap
Definition MRMeshFwd.h:636
std::array< VertId, 3 > ThreeVertIds
three vertex ids describing a triangle with the corners in vertices given by their ids
Definition MRMeshFwd.h:540
Only strictly necessary for the bindings (to make MR::MeshIntersectionResult a complete type).
Definition MRCameraOrientationPlugin.h:8
triangle in a leaf of AABBTree
Definition MRAABBTree.h:31
ThreeVertIds verts
in the order of mesh.topology.getTriVerts( face )
Definition MRAABBTree.h:33
FaceId face
Definition MRAABBTree.h:32
node of AABBTree (outside of the class to be default-constructible in its members)
Definition MRAABBTree.h:21
int first
the first child node, or for a leaf, the first of its triangles in leafTris()
Definition MRAABBTree.h:23
Box3f box
bounding box of whole subtree
Definition MRAABBTree.h:22
int count
the number of children, or for a leaf, minus the number of its triangles
Definition MRAABBTree.h:24
bool leaf() const
Definition MRAABBTree.h:25
int numLeafTris() const
Definition MRAABBTree.h:26
Definition MRTriMesh.h:16