mdds
|
Classes | |
class | data_not_found |
class | node_access |
struct | point |
class | search_results |
Public Types | |
typedef _Key | key_type |
typedef _Value | value_type |
typedef size_t | size_type |
typedef ::std::vector< value_type > | data_array_type |
Public Member Functions | |
point_quad_tree (const point_quad_tree &r) | |
void | insert (key_type x, key_type y, value_type data) |
void | search_region (key_type x1, key_type y1, key_type x2, key_type y2, data_array_type &result) const |
search_results | search_region (key_type x1, key_type y1, key_type x2, key_type y2) const |
value_type | find (key_type x, key_type y) const |
void | remove (key_type x, key_type y) |
void | swap (point_quad_tree &r) |
void | clear () |
bool | empty () const |
size_t | size () const |
node_access | get_node_access () const |
point_quad_tree & | operator= (const point_quad_tree &r) |
bool | operator== (const point_quad_tree &r) const |
bool | operator!= (const point_quad_tree &r) const |
void mdds::point_quad_tree< _Key, _Value >::clear | ( | ) |
Remove all stored data.
bool mdds::point_quad_tree< _Key, _Value >::empty | ( | ) | const |
Check whether or not the container is empty.
point_quad_tree< _Key, _Value >::value_type mdds::point_quad_tree< _Key, _Value >::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.
x | x coordinate |
y | y coordinate |
point_quad_tree< _Key, _Value >::node_access mdds::point_quad_tree< _Key, _Value >::get_node_access | ( | ) | const |
Get read-only access to the internal quad node tree.
void mdds::point_quad_tree< _Key, _Value >::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.
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< _Key, _Value >::remove | ( | key_type | x, |
key_type | y | ||
) |
Remove data from specified coordinates. This method does nothing if no data exists at the specified coordinates.
x | x coordinate |
y | y coordinate |
void mdds::point_quad_tree< _Key, _Value >::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.
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< _Key, _Value >::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.
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 |
size_t mdds::point_quad_tree< _Key, _Value >::size | ( | ) | const |
Get the number of stored data.
void mdds::point_quad_tree< _Key, _Value >::swap | ( | point_quad_tree< _Key, _Value > & | r | ) |
Swap the internal state with another instance.
r | another instance to swap internals with. |