DUNE: Uniform Navigational Environment  2016.05.0
Simulators::Environment::QuadTree Class Reference

Detailed Description

"Quad-tree" structure used to index spatial data in two dimensions.


struct  Item
class  Iteration

Public Member Functions

 QuadTree (const Bounds &bounds)
 ~QuadTree ()
bool insert (const Item &item)
void iterate (Iteration &iteration) const
void iterate (Iteration &iteration, const Bounds &area) const
void clear (void)
void remove (const Bounds &area)
bool search (const Bounds &area, std::vector< Item > &items) const
uint32_t size (const Bounds &area) const

Constructor & Destructor Documentation

Simulators::Environment::QuadTree::QuadTree ( const Bounds bounds)


Simulators::Environment::QuadTree::~QuadTree ( )

References clear().

Member Function Documentation

void Simulators::Environment::QuadTree::clear ( void  )

Clear entire tree.

Referenced by remove(), and ~QuadTree().

bool Simulators::Environment::QuadTree::insert ( const Item item)

Insert an item.

Returns 'false' if item is out-of-bounds.

References Simulators::Environment::Bounds::contains(), and Simulators::Environment::Node::insert().

void Simulators::Environment::QuadTree::iterate ( Iteration iteration) const

Iterate tree.

Referenced by Simulators::Environment::operator<<(), and size().

void Simulators::Environment::QuadTree::iterate ( Iteration iteration,
const Bounds area 
) const

Iterate tree over a given area.

References Simulators::Environment::Node::iterate().

void Simulators::Environment::QuadTree::remove ( const Bounds area)

Remove items in a given area.

References clear(), and Simulators::Environment::Node::remove().

bool Simulators::Environment::QuadTree::search ( const Bounds area,
std::vector< Item > &  items 
) const

Search for items in a given area.

If any are found returns 'true' and adds results to 'item' vector.

References Simulators::Environment::Node::iterate().

Referenced by Simulators::Environment::Task::depthAt().

uint32_t Simulators::Environment::QuadTree::size ( const Bounds area) const

Get number of elements in a given area.

References iterate().

Collaboration diagram for Simulators::Environment::QuadTree:
Collaboration graph