DUNE: Uniform Navigational Environment
2020.01.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.
Referenced by Simulators::Environment::QuadTree::Iteration::~Iteration().
Simulators::Environment::QuadTree::~QuadTree | ( | ) |
References clear().
Referenced by Simulators::Environment::QuadTree::Iteration::~Iteration().
void Simulators::Environment::QuadTree::clear | ( | void | ) |
Clear entire tree.
Referenced by remove(), Simulators::Environment::QuadTree::Iteration::~Iteration(), 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().
Referenced by Simulators::Environment::QuadTree::Iteration::~Iteration().
void Simulators::Environment::QuadTree::iterate | ( | Iteration & | iteration | ) | const |
Iterate tree.
Referenced by Simulators::Environment::operator<<(), size(), and Simulators::Environment::QuadTree::Iteration::~Iteration().
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.
Referenced by Simulators::Environment::Task::depthAt(), and Simulators::Environment::QuadTree::Iteration::~Iteration().
uint32_t Simulators::Environment::QuadTree::size | ( | const Bounds & | area | ) | const |
Get number of elements in a given area.
References iterate().
Referenced by Simulators::Environment::QuadTree::Iteration::~Iteration().