#include <quadtree.h>
Implements and QuadTree node. No self-balancing is done.
◆ QuadTree() [1/3]
QuadTree with root branch bounding-box from vertex array; The center of the root branch will be that of the bounding-box of the vertex array.
- Parameters
-
◆ QuadTree() [2/3]
Tree::QuadTree::QuadTree |
( |
| ) |
|
◆ QuadTree() [3/3]
Tree::QuadTree::QuadTree |
( |
const QuadTree & | | ) |
|
◆ ~QuadTree()
virtual Tree::QuadTree::~QuadTree |
( |
| ) |
|
|
virtual |
◆ back()
const Leaf & Tree::QuadTree::back |
( |
| ) |
const |
|
inline |
◆ begin() [1/2]
HeapArray< Leaf * >::iterator Tree::QuadTree::begin |
( |
| ) |
|
|
inline |
◆ begin() [2/2]
HeapArray< Leaf * >::const_iterator Tree::QuadTree::begin |
( |
| ) |
const |
|
inline |
◆ clear()
void Tree::QuadTree::clear |
( |
| ) |
|
◆ end() [1/2]
HeapArray< Leaf * >::iterator Tree::QuadTree::end |
( |
| ) |
|
|
inline |
◆ end() [2/2]
HeapArray< Leaf * >::const_iterator Tree::QuadTree::end |
( |
| ) |
const |
|
inline |
◆ erase()
void Tree::QuadTree::erase |
( |
Leaf * | pLeaf | ) |
|
Removes and deletes this leaf.
- Parameters
-
Pointer | of the leaf to remove; |
◆ find()
Leaf * Tree::QuadTree::find |
( |
const Vertex2f & | vertex, |
|
|
float | precision = 0.0f ) const |
- Parameters
-
Vertex | to search the tree for. |
The | error-limit for vertex comparison. |
- Returns
- Null if not found, else a pointer to the Leaf.
◆ front()
const Leaf & Tree::QuadTree::front |
( |
| ) |
const |
|
inline |
◆ getLeaves()
HeapArray< Leaf * > Tree::QuadTree::getLeaves |
( |
| ) |
const |
◆ getVertices() [1/2]
Vector2fArray Tree::QuadTree::getVertices |
( |
bool | unique = false | ) |
const |
◆ getVertices() [2/2]
template<typename INDICES >
Vector2fArray Tree::QuadTree::getVertices |
( |
const INDICES & | c | ) |
const |
|
inline |
- Returns
- The container of vertices.
◆ hasDuplicates()
bool Tree::QuadTree::hasDuplicates |
( |
| ) |
|
◆ insert() [1/2]
HeapArray< Handle > Tree::QuadTree::insert |
( |
const Vector2fArray & | array | ) |
|
- Returns
- An array of indices for the given Leaf pointers containing the vertices;
◆ insert() [2/2]
Handle Tree::QuadTree::insert |
( |
const Vertex2f & | vertex | ) |
|
- Returns
- The index of the Leaf pointer containing the vertex;
◆ nearest()
- Parameters
-
The | vertex to search the tree. |
- Returns
- The closest Leaf in the tree to the vertex passed.
◆ operator const Branch &()
Tree::QuadTree::operator const Branch & |
( |
| ) |
const |
|
inline |
◆ operator const Branch *()
Tree::QuadTree::operator const Branch * |
( |
| ) |
const |
|
inline |
◆ operator HeapArray< Leaf * >()
Tree::QuadTree::operator HeapArray< Leaf * > |
( |
| ) |
|
|
inline |
- Returns
- An array of Leaf pointers inserted by iteration of the tree. NOTE: There are no duplicate Leaves.
◆ operator()()
bool Tree::QuadTree::operator() |
( |
const Vertex2f & | vA, |
|
|
const Vertex2f & | vB ) const |
◆ operator[]() [1/2]
Handle Tree::QuadTree::operator[] |
( |
const Vertex2f & | v | ) |
const |
- Returns
- The base index of the vertex within pLeaf.
◆ operator[]() [2/2]
Leaf & Tree::QuadTree::operator[] |
( |
Handle | index | ) |
const |
- Returns
- Reference to the Vertex at the given index.
◆ size()
size_t Tree::QuadTree::size |
( |
| ) |
const |
|
inline |
- Returns
- The number of vertices stored in this tree. NOTE: The Array pLeaf may hold duplicate pointer references.
◆ update()
void Tree::QuadTree::update |
( |
| ) |
|
Removes all branches and leaves, and reinserts all leaves given new bounding-box center. NOTE: This may break any bounding-box associations to objects. Any pointers held to prior Nodes(Branches, Leaves) will become garbage.
◆ pBase
◆ pLeaf
HeapArray< Leaf * > Tree::QuadTree::pLeaf |
This array preserves order of leaf insertion.
The documentation for this class was generated from the following file: