Overview     Modules     Class Hierarchy     Classes     Members  
tlp::QuadTreeNode< TYPE > Class Template Reference

QuadTree template class. More...

#include <QuadTree.h>

Collaboration diagram for tlp::QuadTreeNode< TYPE >:

List of all members.

Public Member Functions


Detailed Description

template<class TYPE>
class tlp::QuadTreeNode< TYPE >

QuadTree template class.

This class provide QuadTree system


Constructor & Destructor Documentation

template<class TYPE >
tlp::QuadTreeNode< TYPE >::QuadTreeNode ( const tlp::Rectangle< float > &  box) [inline]

Contructor, you have to put the global bounding box of the quadtree

template<class TYPE >
tlp::QuadTreeNode< TYPE >::~QuadTreeNode ( ) [inline]

Basic destructor


Member Function Documentation

template<class TYPE >
void tlp::QuadTreeNode< TYPE >::getElements ( const tlp::Rectangle< float > &  box,
std::vector< TYPE > &  result 
) const [inline]

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 >::getElements ( std::vector< TYPE > &  result) const [inline]

Return all elements of the quadtree

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

template<class TYPE >
void tlp::QuadTreeNode< TYPE >::insert ( const tlp::Rectangle< float > &  box,
const TYPE  id 
) [inline]

Insert an element in the quadtree



Tulip Software by LaBRI Visualization Team    2001 - 2012