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

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

#include <QuadTreeNode.hpp>

Public Member Functions

 QuadTreeNode (const Rectangle &rect, int maximumItems)
 QuadTreeNode Constructs a new QuadTreeNode. More...
 
 ~QuadTreeNode ()
 
bool put (std::shared_ptr< Node > pt)
 put Inserts a point into the Node More...
 
std::vector< std::shared_ptr
< Node > > & 
get (const Rectangle &rect, std::vector< std::shared_ptr< Node > > &vector)
 get Get all Points in the defined rectangle More...
 

Detailed Description

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

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

Definition at line 34 of file QuadTreeNode.hpp.

Constructor & Destructor Documentation

template<class Node >
UtilLib::geometry::QuadTreeNode< Node >::QuadTreeNode ( const Rectangle rect,
int  maximumItems 
)
explicit

QuadTreeNode Constructs a new QuadTreeNode.

Parameters
rectThe boarders of this node
maximumItemsThe number of items stored in one leaf

Definition at line 120 of file QuadTreeNode.hpp.

template<class Node >
UtilLib::geometry::QuadTreeNode< Node >::~QuadTreeNode ( )

Destructor

Definition at line 132 of file QuadTreeNode.hpp.

Member Function Documentation

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

get Get all Points in the defined rectangle

Parameters
rectThe rectange
vectorA vector of all Points found so far
Returns
A vector of Pointer to the nodes in the defined area

Definition at line 223 of file QuadTreeNode.hpp.

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

put Inserts a point into the Node

Parameters
ptA Pointer to a point stored in the tree. However the quadTree does not take over the ownership
Returns
True if the method was successful

Definition at line 206 of file QuadTreeNode.hpp.


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