LBIBCell
 All Classes Functions Variables Friends Pages
UtilLib::geometry::QuadTree< Node > Class Template Reference

The class representing a quadtree The template parameter Node needs to provide the methods getXPos() and getYPos() to access the postion of the node. More...

#include <QuadTree.hpp>

Public Member Functions

 QuadTree (const Rectangle &rect, int maxItems=1)
 QuadTree A Quad tree on the area defined by the rectangle. More...
 
 ~QuadTree ()
 ~QuadTree Destructor of this tree. At the moment no inheritance is wanted.
 
bool put (std::shared_ptr< Node > pt)
 put Adds a point into the tree. This method runs in log(n) More...
 
std::vector< std::shared_ptr
< Node > > 
get (const Rectangle &rect)
 get Get all points in the provided rectange. This method runs in log(n) More...
 
void clear ()
 clear Delete all nodes inside this quadTree
 

Detailed Description

template<class Node>
class UtilLib::geometry::QuadTree< Node >

The class representing a quadtree The template parameter Node needs to provide the methods getXPos() and getYPos() to access the postion of the node.

Definition at line 31 of file QuadTree.hpp.

Constructor & Destructor Documentation

template<class Node >
UtilLib::geometry::QuadTree< Node >::QuadTree ( const Rectangle rect,
int  maxItems = 1 
)
explicit

QuadTree A Quad tree on the area defined by the rectangle.

Parameters
rectThe boarders of this quad tree
maxItemsThe maximum number of items stored per Node

Definition at line 75 of file QuadTree.hpp.

Member Function Documentation

template<class Node >
std::vector< std::shared_ptr< Node > > UtilLib::geometry::QuadTree< Node >::get ( const Rectangle rect)

get Get all points in the provided rectange. This method runs in log(n)

Parameters
rectThe rectange
Returns
All points inside rect

Definition at line 93 of file QuadTree.hpp.

template<class Node >
bool UtilLib::geometry::QuadTree< Node >::put ( std::shared_ptr< Node >  pt)

put Adds a point into the tree. This method runs in log(n)

Parameters
ptThe Point added
Returns
true if successfull

Definition at line 88 of file QuadTree.hpp.


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