DUNE: Uniform Navigational Environment
2019.02.0
|
"Quad-tree" structure used to index spatial data in two dimensions.
Classes | |
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 |
Simulators::Environment::QuadTree::QuadTree | ( | const Bounds & | bounds | ) |
Constructor.
Simulators::Environment::QuadTree::~QuadTree | ( | ) |
References clear().
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().