FIFE 2008.0
|
#include <quadtree.h>
Public Member Functions | |
QuadTree (int x=0, int y=0, int starting_size=MinimumSize) | |
Node * | find_container (int x, int y, int w, int h) |
template<typename Visitor > | |
Visitor & | apply_visitor (Visitor &visitor) |
Dynamic QuadTree A space partitioning tree automatically expanding to adjust to any object size put into the data structure.
Definition at line 150 of file quadtree.h.
FIFE::QuadTree< DataType, MinimumSize >::QuadTree | ( | int | x = 0 , |
int | y = 0 , |
||
int | starting_size = MinimumSize |
||
) | [inline] |
Create a new QuadTree
x | The X position of the starting node. |
y | The Y position of the starting node. |
starting_size | The width and height of the starting node. |
Definition at line 159 of file quadtree.h.
Visitor& FIFE::QuadTree< DataType, MinimumSize >::apply_visitor | ( | Visitor & | visitor | ) | [inline] |
Apply a visitor recursively to the QuadTree
Definition at line 190 of file quadtree.h.
QuadNode< DataType, MinimumSize > * FIFE::QuadTree< DataType, MinimumSize >::find_container | ( | int | x, |
int | y, | ||
int | w, | ||
int | h | ||
) |
Find a container node for a given rectangle. This guarantees to return a Node with the following properties: 1.) The node contains the rectangle (as defined by the contains function). 2.) All subnodes can not contain the rectangle or it has the MinimumSize. This function will extend the tree automatically so that this guarantee can be fulfilled. This function is optimized for sequential access. This means accessing different rectangles that are 'near' to each other will be fast.
Definition at line 359 of file quadtree.h.
References FIFE::QuadNode< DataType, MinimumSize >::create_parent(), and FIFE::QuadNode< DataType, MinimumSize >::find_container().