Point Quad Tree

API Reference

template <typename _Key, typename _Value>
class

Public Types

typedef
typedef
typedef
typedef

Public Functions

mdds::point_quad_tree::point_quad_tree()
mdds::point_quad_tree::point_quad_tree(const point_quad_tree &r)
mdds::point_quad_tree::~point_quad_tree()
void mdds::point_quad_tree::insert(key_type x, key_type y, value_type data)

Insert a new data at specified coordinates. It overwrites existing data in case one exists at the specified coordinates.

Parameters
  • x -

    x coordinate of new data position

  • y -

    y coordinate of new data position

  • data -

    data being inserted at the specified coordinates.

void mdds::point_quad_tree::search_region(key_type x1, key_type y1, key_type x2, key_type y2, data_array_type &result)
const

Perform region search (aka window search), that is, find all points that fall within specified rectangular region. The boundaries are inclusive.

Parameters
  • x1 -

    left coordinate of the search region

  • y1 -

    top coordinate of the search region

  • x2 -

    right coordinate of the search region

  • y2 -

    bottom coordinate of the search region

  • result -

    this array will contain all data found without specified region.

point_quad_tree<_Key, _Value>::search_results mdds::point_quad_tree::search_region(key_type x1, key_type y1, key_type x2, key_type y2)
const

Perform region search (aka window search), that is, find all points that fall within specified rectangular region. The boundaries are inclusive.

Return
search result object containing all data found within the specified region.
Parameters
  • x1 -

    left coordinate of the search region

  • y1 -

    top coordinate of the search region

  • x2 -

    right coordinate of the search region

  • y2 -

    bottom coordinate of the search region

point_quad_tree<_Key, _Value>::value_type mdds::point_quad_tree::find(key_type x, key_type y)
const

Find data at specified coordinates. If no data exists at the specified coordinates, this method throws a point_quad_tree::data_not_found exception.

Return
data found at the specified coordinates.
Parameters
  • x -

    x coordinate

  • y -

    y coordinate

void mdds::point_quad_tree::remove(key_type x, key_type y)

Remove data from specified coordinates. This method does nothing if no data exists at the specified coordinates.

Parameters
  • x -

    x coordinate

  • y -

    y coordinate

void mdds::point_quad_tree::swap(point_quad_tree &r)

Swap the internal state with another instance.

Parameters
  • r -

    another instance to swap internals with.

void mdds::point_quad_tree::clear()

Remove all stored data.

bool mdds::point_quad_tree::empty()
const

Check whether or not the container is empty.

Return
bool true if empty, false otherwise.

size_t mdds::point_quad_tree::size()
const

Get the number of stored data.

Return
the number of data currently stored in the container.

point_quad_tree<_Key, _Value>::node_access mdds::point_quad_tree::get_node_access()
const

Get read-only access to the internal quad node tree.

Return
root node

point_quad_tree<_Key, _Value> &mdds::point_quad_tree::operator=(const point_quad_tree &r)
bool mdds::point_quad_tree::operator==(const point_quad_tree &r)
const
bool mdds::point_quad_tree::operator!=(const point_quad_tree &r)
const
class

Node wrapper to allow read-only access to the internal quad node structure.

Public Functions

template<>
node_access mdds::point_quad_tree<_Key, _Value>::node_access::northeast()
const
template<>
node_access mdds::point_quad_tree<_Key, _Value>::node_access::northwest()
const
template<>
node_access mdds::point_quad_tree<_Key, _Value>::node_access::southeast()
const
template<>
node_access mdds::point_quad_tree<_Key, _Value>::node_access::southwest()
const
template<>
value_type mdds::point_quad_tree<_Key, _Value>::node_access::data()
const
template<>
key_type mdds::point_quad_tree<_Key, _Value>::node_access::x()
const
template<>
key_type mdds::point_quad_tree<_Key, _Value>::node_access::y()
const
template<>
mdds::point_quad_tree<_Key, _Value>::node_access::operator bool()
const
template<>
bool mdds::point_quad_tree<_Key, _Value>::node_access::operator==(const node_access &r)
const
template<>
node_access &mdds::point_quad_tree<_Key, _Value>::node_access::operator=(const node_access &r)
template<>
mdds::point_quad_tree<_Key, _Value>::node_access::node_access()
template<>
mdds::point_quad_tree<_Key, _Value>::node_access::node_access(const node_access &r)
template<>
mdds::point_quad_tree<_Key, _Value>::node_access::~node_access()
struct

Public Functions

template<>
mdds::point_quad_tree<_Key, _Value>::point::point(key_type _x, key_type _y)
template<>
mdds::point_quad_tree<_Key, _Value>::point::point()

Public Members

template<>
key_type mdds::point_quad_tree<_Key, _Value>::point::x
template<>
key_type mdds::point_quad_tree<_Key, _Value>::point::y
class

Public Functions

template<>
mdds::point_quad_tree<_Key, _Value>::search_results::search_results()
template<>
mdds::point_quad_tree<_Key, _Value>::search_results::search_results(const search_results &r)
template<>
search_results::const_iterator mdds::point_quad_tree<_Key, _Value>::search_results::begin()
template<>
search_results::const_iterator mdds::point_quad_tree<_Key, _Value>::search_results::end()
class

Public Types

typedef typedef std::pair<point, parent_value_type> mdds::point_quad_tree<_Key, _Value>::search_results::const_iterator::value_type
typedef typedef value_type *mdds::point_quad_tree<_Key, _Value>::search_results::const_iterator::pointer
typedef typedef value_type &mdds::point_quad_tree<_Key, _Value>::search_results::const_iterator::reference
typedef typedef ptrdiff_t mdds::point_quad_tree<_Key, _Value>::search_results::const_iterator::difference_type
typedef typedef std::bidirectional_iterator_tag mdds::point_quad_tree<_Key, _Value>::search_results::const_iterator::iterator_category

Public Functions

template<>
mdds::point_quad_tree<_Key, _Value>::search_results::const_iterator::const_iterator(res_nodes_ptr &ptr)
template<>
mdds::point_quad_tree<_Key, _Value>::search_results::const_iterator::const_iterator(const const_iterator &r)
template<>
const_iterator &mdds::point_quad_tree<_Key, _Value>::search_results::const_iterator::operator=(const const_iterator &r)
template<>
bool mdds::point_quad_tree<_Key, _Value>::search_results::const_iterator::operator==(const const_iterator &r)
const
template<>
bool mdds::point_quad_tree<_Key, _Value>::search_results::const_iterator::operator!=(const const_iterator &r)
const
template<>
const value_type &mdds::point_quad_tree<_Key, _Value>::search_results::const_iterator::operator*()
const
template<>
const value_type *mdds::point_quad_tree<_Key, _Value>::search_results::const_iterator::operator->()
const
template<>
const value_type *mdds::point_quad_tree<_Key, _Value>::search_results::const_iterator::operator++()
template<>
const value_type *mdds::point_quad_tree<_Key, _Value>::search_results::const_iterator::operator--()

Friends

friend mdds::point_quad_tree::point_quad_tree< _Key, _Value >::search_results