MeshLib C# Docs
Loading...
Searching...
No Matches
MR.AABBTree Class Reference

bounding volume hierarchy of mesh triangles with up to 4 children per node and up to 4 triangles per leaf; the children of a node are stored contiguously, and every leaf keeps the vertices and the boxes of its triangles Generated from class MR.AABBTree. This is the non-const half of the class. More...

Inheritance diagram for MR.AABBTree:

Public Member Functions

unsafe AABBTree ()
 Constructs an empty (default-constructed) instance.
unsafe AABBTree (MR._ByValue_AABBTree _other)
 Generated from constructor MR.AABBTree.AABBTree.
unsafe AABBTree (MR.Const_MeshPart mp)
 creates tree for given mesh or its part Generated from constructor MR.AABBTree.AABBTree.
unsafe AABBTree (MR.Const_TriMesh tmesh, MR.Const_FaceBitSet? region=null)
 creates tree for the triangles of tmesh (all if region is nullptr), faster than from a mesh; it is the tree of a mesh with tmesh.points and mesh.topology.getTriVerts( f ) == tmesh.tris[f] for all its triangles Generated from constructor MR.AABBTree.AABBTree.
unsafe MR.AABBTree assign (MR._ByValue_AABBTree _other)
 Generated from method MR::AABBTree::operator=.
unsafe void renumber (MR.Const_FaceBMap faceMap, MR.Const_VertBMap vertMap)
 renumbers the triangles and their vertices after the mesh was packed with given maps from old to new ids Generated from method MR.AABBTree.renumber.
unsafe void flipOrientation (MR.Const_FaceBitSet? region=null)
 changes the order of the vertices of the triangles of given faces (all if nullptr) as MeshTopology.flipOrientation() does; shall be called after MeshTopology.flipOrientation() if this tree is kept Generated from method MR.AABBTree.flipOrientation.
unsafe void refit (MR.Const_Mesh mesh, MR.Const_VertBitSet? changedVerts)
 updates the boxes of the triangles with changed vertices and of their ancestors; this is a faster alternative to full tree rebuild (but the tree after refit might be less efficient)
unsafe void addSplitFaces (MR.Const_Mesh mesh, MR.Phmap.Const_FlatHashMap_MRFaceId_MRFaceId_PhmapHashMRFaceId_PhmapEqualToMRFaceId_MRAllocatorStdPairConstMRFaceIdMRFaceId new2Old)
 adds to the tree the faces that appeared after splitting some of its faces into parts (e.g. by Mesh.splitFace or Mesh.splitEdge): the leaf of each split face gets a subtree with its old triangles and the new parts; this is a faster alternative to full tree rebuild (but the tree after the update might be less efficient)
Public Member Functions inherited from MR.Const_AABBTree
virtual void Dispose ()
unsafe Const_AABBTree ()
 Constructs an empty (default-constructed) instance.
unsafe Const_AABBTree (MR._ByValue_AABBTree _other)
 Generated from constructor MR.AABBTree.AABBTree.
unsafe Const_AABBTree (MR.Const_MeshPart mp)
 creates tree for given mesh or its part Generated from constructor MR.AABBTree.AABBTree.
unsafe Const_AABBTree (MR.Const_TriMesh tmesh, MR.Const_FaceBitSet? region=null)
 creates tree for the triangles of tmesh (all if region is nullptr), faster than from a mesh; it is the tree of a mesh with tmesh.points and mesh.topology.getTriVerts( f ) == tmesh.tris[f] for all its triangles Generated from constructor MR.AABBTree.AABBTree.
unsafe MR.Const_Vector_MRAABBTreeWideNode_MRNodeId nodes ()
 the root is the first node, if any Generated from method MR.AABBTree.nodes.
unsafe MR.Box3f getBoundingBox ()
 returns the bounding box of the whole tree (empty for an empty tree) Generated from method MR.AABBTree.getBoundingBox.
unsafe MR.Const_Vector_MRAABBTreeWideLeafTri leafTris ()
 triangles of all leaves, the triangles of each leaf are contiguous Generated from method MR.AABBTree.leafTris.
unsafe MR.Const_Vector_MRBox3f leafBoxes ()
 the bounding boxes of the triangles in the order of leafTris(), slightly expanded for robust searches Generated from method MR.AABBTree.leafBoxes.
unsafe nuint heapBytes ()
 returns the amount of memory this object occupies on heap Generated from method MR.AABBTree.heapBytes.
unsafe MR.Std.Vector_MRNodeId getSubtrees (int minNum)
 returns at least given number of top-level not-intersecting subtrees, union of which contain all tree leaves Generated from method MR.AABBTree.getSubtrees.
unsafe MR.FaceBitSet getSubtreeFaces (MR.NodeId subtreeRoot)
 returns all triangles in the subtree with given root Generated from method MR.AABBTree.getSubtreeFaces.
unsafe MR.NodeBitSet getNodesFromFaces (MR.Const_FaceBitSet faces)
 returns the nodes having at least one of given triangles in their subtrees Generated from method MR.AABBTree.getNodesFromFaces.
unsafe void getLeafOrder (MR.FaceBMap faceMap)
 fills map: FaceId -> its position in leafTris(); buffer in faceMap must be resized before the call, and caller is responsible for filling missing face elements Generated from method MR.AABBTree.getLeafOrder.

Additional Inherited Members

Protected Member Functions inherited from MR.Const_AABBTree
virtual unsafe void Dispose (bool disposing)
Static Protected Attributes inherited from MR.Const_AABBTree
static unsafe int * __ref_storage_MaxChildren
static unsafe int * __ref_storage_MaxLeafTris
static unsafe int * __ref_storage_MaxDepth
Properties inherited from MR.Const_AABBTree
static unsafe int MaxChildren [get]
static unsafe int MaxLeafTris [get]
static unsafe int MaxDepth [get]
 the deepest level of a node (the root is at 0): the stacks of the traversals are sized for it, and addSplitFaces rebuilds a deeper tree

Detailed Description

bounding volume hierarchy of mesh triangles with up to 4 children per node and up to 4 triangles per leaf; the children of a node are stored contiguously, and every leaf keeps the vertices and the boxes of its triangles Generated from class MR.AABBTree. This is the non-const half of the class.

Constructor & Destructor Documentation

◆ AABBTree() [1/4]

unsafe MR.AABBTree.AABBTree ( )
inline

Constructs an empty (default-constructed) instance.

◆ AABBTree() [2/4]

unsafe MR.AABBTree.AABBTree ( MR._ByValue_AABBTree _other)
inline

Generated from constructor MR.AABBTree.AABBTree.

◆ AABBTree() [3/4]

unsafe MR.AABBTree.AABBTree ( MR.Const_MeshPart mp)
inline

creates tree for given mesh or its part Generated from constructor MR.AABBTree.AABBTree.

◆ AABBTree() [4/4]

unsafe MR.AABBTree.AABBTree ( MR.Const_TriMesh tmesh,
MR.Const_FaceBitSet? region = null )
inline

creates tree for the triangles of tmesh (all if region is nullptr), faster than from a mesh; it is the tree of a mesh with tmesh.points and mesh.topology.getTriVerts( f ) == tmesh.tris[f] for all its triangles Generated from constructor MR.AABBTree.AABBTree.

Member Function Documentation

◆ addSplitFaces()

unsafe void MR.AABBTree.addSplitFaces ( MR.Const_Mesh mesh,
MR.Phmap.Const_FlatHashMap_MRFaceId_MRFaceId_PhmapHashMRFaceId_PhmapEqualToMRFaceId_MRAllocatorStdPairConstMRFaceIdMRFaceId new2Old )
inline

adds to the tree the faces that appeared after splitting some of its faces into parts (e.g. by Mesh.splitFace or Mesh.splitEdge): the leaf of each split face gets a subtree with its old triangles and the new parts; this is a faster alternative to full tree rebuild (but the tree after the update might be less efficient)

Parameters
meshsame mesh for which this tree was constructed, but after the splits
new2Oldmaps every new face (not present in the tree) to the face of this tree it was split from; it must contain only the splits made since the tree was built or last updated Generated from method MR.AABBTree.addSplitFaces.

◆ assign()

unsafe MR.AABBTree MR.AABBTree.assign ( MR._ByValue_AABBTree _other)
inline

Generated from method MR::AABBTree::operator=.

◆ flipOrientation()

unsafe void MR.AABBTree.flipOrientation ( MR.Const_FaceBitSet? region = null)
inline

changes the order of the vertices of the triangles of given faces (all if nullptr) as MeshTopology.flipOrientation() does; shall be called after MeshTopology.flipOrientation() if this tree is kept Generated from method MR.AABBTree.flipOrientation.

◆ refit()

unsafe void MR.AABBTree.refit ( MR.Const_Mesh mesh,
MR.Const_VertBitSet? changedVerts )
inline

updates the boxes of the triangles with changed vertices and of their ancestors; this is a faster alternative to full tree rebuild (but the tree after refit might be less efficient)

Parameters
meshsame mesh for which this tree was constructed but with updated coordinates;
changedVertsvertex ids with modified coordinates (since tree construction or last refit), nullptr means all vertices Generated from method MR.AABBTree.refit.

◆ renumber()

unsafe void MR.AABBTree.renumber ( MR.Const_FaceBMap faceMap,
MR.Const_VertBMap vertMap )
inline

renumbers the triangles and their vertices after the mesh was packed with given maps from old to new ids Generated from method MR.AABBTree.renumber.


The documentation for this class was generated from the following file: