tlp::QuadTreeNode< TYPE > Class Template Reference#include <QuadTree.h>
Collaboration diagram for tlp::QuadTreeNode< TYPE >:
[legend]List of all members.
Detailed Description
template<class TYPE>
class tlp::QuadTreeNode< TYPE >
QuadTree template class.
This class provide QuadTree system
Public Member Functions
Constructor & Destructor Documentation
|
Contructor, you have to put the global bounding box of the quadtree |
Member Function Documentation
template<class TYPE> |
void tlp::QuadTreeNode< TYPE >::getElements |
( |
std::vector< TYPE > & |
result |
) |
const [inline] |
|
|
Return all elements of the quadtree |
|
return all elements that could be in the given box (the function ensures that all elements inside the box are return. However some elements not inside the box can be returned. |
template<class TYPE> |
void tlp::QuadTreeNode< TYPE >::getElementsWithRatio |
( |
const tlp::Rectangle< float > & |
box, |
|
|
std::vector< TYPE > & |
result, |
|
|
float |
ratio = 1000. |
|
) |
const [inline] |
|
|
same as getElements, however if the size of the elements are to small compare to the size of the box (equivalent to have severeal item at the same position on the screen) only one elements is returned for the small cells. The ratio should fixed according to the number of pixels displayed. If we have a 1000*800 screen we can merge items of box into a single item if the size of box is max(1000,800) times smaller than the box given in parameter. so the ratio should be 1000.(merge elements that are 1000 times smaller |
|
Insert an element in the quadtree |
|