Rasterfarm-SDK
Loading...
Searching...
No Matches
Tree::AABoxTree Class Reference

#include <aaboxtree.h>

Classes

class  Branch
 
class  Leaf
 
class  Node
 

Public Member Functions

 AABoxTree (const Primitive2D::AABoundingBox &cube)
 
 AABoxTree (const HeapArray< Primitive2D::AABoundingBox > &cube)
 
 AABoxTree (const AABoxTree &)=delete
 
virtual ~AABoxTree ()
 
void operator= (const AABoxTree &)=delete
 
 operator Branch & () const
 
 operator Branch * () const
 
 operator HeapArray< Leaf * > ()
 
HeapArray< Leaf * > getLeaves () const
 
Leafoperator[] (Handle index) const
 
Handle operator[] (const Primitive2D::AABoundingBox &box) const
 
size_t size () const
 
Leafinsert (const Primitive2D::AABoundingBox &cube)
 
HeapArray< Leaf * > insert (const HeapArray< Primitive2D::AABoundingBox > &box)
 
HeapArray< Leaf * > intersect (const Primitive2D::AABoundingBox &box)
 
Leafnearest (const Vertex2f &vertex)
 
HeapArray< Leaf * > inside (const Vertex2f &v, float precision=0.0f)
 
HeapArray< Leaf * > inside (const Primitive2D::AABoundingBox &box, float precision=0.0f)
 
HeapArray< Leaf * > within (const Primitive2D::AABoundingBox &box, float precision=0.0f)
 
void erase (Leaf *pLeaf)
 
void erase (Handle index)
 

Static Public Member Functions

static bool larger (const Primitive2D::AABoundingBox &leftCube, const Primitive2D::AABoundingBox &rightCube)
 

Detailed Description

This tree sorts axis-aligned bounding boxes and their spatial relationships. Each box typically represents the bounds of some geometry or point-cloud. By sorting these boxes based-upon the spatial relationship to it's parent the number of collision tests can be greatly reduced.

Constructor & Destructor Documentation

◆ AABoxTree() [1/3]

Tree::AABoxTree::AABoxTree ( const Primitive2D::AABoundingBox & cube)
Parameters
Anaxis-aligned 3d bounding-cube

◆ AABoxTree() [2/3]

Tree::AABoxTree::AABoxTree ( const HeapArray< Primitive2D::AABoundingBox > & cube)
Parameters
Aunique-set of axis-aligned 3d bounding-cube

◆ AABoxTree() [3/3]

Tree::AABoxTree::AABoxTree ( const AABoxTree & )
delete

Copying an AABoxTree is not currently supported;

◆ ~AABoxTree()

virtual Tree::AABoxTree::~AABoxTree ( )
virtual

Member Function Documentation

◆ erase() [1/2]

void Tree::AABoxTree::erase ( Handle index)
inline

Removes and deletes this leaf.

Parameters
Pointerof the leaf to remove;

◆ erase() [2/2]

void Tree::AABoxTree::erase ( Leaf * pLeaf)

Removes and deletes this leaf.

Parameters
Pointerof the leaf to remove;

◆ getLeaves()

HeapArray< Leaf * > Tree::AABoxTree::getLeaves ( ) const

◆ insert() [1/2]

HeapArray< Leaf * > Tree::AABoxTree::insert ( const HeapArray< Primitive2D::AABoundingBox > & box)

◆ insert() [2/2]

Leaf * Tree::AABoxTree::insert ( const Primitive2D::AABoundingBox & cube)

◆ inside() [1/2]

HeapArray< Leaf * > Tree::AABoxTree::inside ( const Primitive2D::AABoundingBox & box,
float precision = 0.0f )

◆ inside() [2/2]

HeapArray< Leaf * > Tree::AABoxTree::inside ( const Vertex2f & v,
float precision = 0.0f )

◆ intersect()

HeapArray< Leaf * > Tree::AABoxTree::intersect ( const Primitive2D::AABoundingBox & box)

◆ larger()

static bool Tree::AABoxTree::larger ( const Primitive2D::AABoundingBox & leftCube,
const Primitive2D::AABoundingBox & rightCube )
static
Returns
True if the left cube is larger in volue that the right.

◆ nearest()

Leaf * Tree::AABoxTree::nearest ( const Vertex2f & vertex)
Parameters
Thevertex to search the tree.
Returns
The closest Leaf in the tree to the vertex passed.

◆ operator Branch &()

Tree::AABoxTree::operator Branch & ( ) const
inline

◆ operator Branch *()

Tree::AABoxTree::operator Branch * ( ) const
inline

◆ operator HeapArray< Leaf * >()

Tree::AABoxTree::operator HeapArray< Leaf * > ( )
inline
Returns
An array of Leaf pointers inserted by iteration of the tree. NOTE: There are no duplicate Leaves.

◆ operator=()

void Tree::AABoxTree::operator= ( const AABoxTree & )
delete

Copying an AABoxTree is not currently supported;

◆ operator[]() [1/2]

Handle Tree::AABoxTree::operator[] ( const Primitive2D::AABoundingBox & box) const
Returns
The base index of the vertex within pLeaf.

◆ operator[]() [2/2]

Leaf & Tree::AABoxTree::operator[] ( Handle index) const
Returns
Reference to the Vertex at the given index.

◆ size()

size_t Tree::AABoxTree::size ( ) const
inline
Returns
The number of vertices stored in this tree. NOTE: The Array pLeaf may hold duplicate pointer references.

◆ within()

HeapArray< Leaf * > Tree::AABoxTree::within ( const Primitive2D::AABoundingBox & box,
float precision = 0.0f )

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