|
using | ConstIterator = std::unordered_multimap< KeyType, ValueType >::const_iterator |
|
using | IntersectsCellFunction = AbsGrid::IntersectsCellFunction |
|
using | Iterator = std::unordered_multimap< KeyType, ValueType >::iterator |
|
using | KeyType = AbsGrid::KeyType |
|
using | IntersectsCellFunction = std::function< bool(const typename GridType::BBoxType &, const RemoveCVRefAndPointer< ValueType > &)> |
| The IntersectsCellFunction type is a std::function that takes as input a bounding box and a value, and returns true if the value intersects the bounding box.
|
|
using | KeyType = GridType::CellPos |
|
template<typename QueryValueType > |
using | QueryBoundedDistFunction = std::function< typename GridType::ScalarType(const QueryValueType &, const RemoveCVRefAndPointer< ValueType > &, typename GridType::ScalarType)> |
| The QueryBoundedDistFunction type is a std::function that takes as input a query value, a value stored in the grid, and a maximum distance between the two values, and returns the distance between the two values. If the distance is greater than the maximum distance, the function must return a value greater than the maximum distance.
|
|
template<typename QueryValueType > |
using | QueryDistFunction = std::function< typename GridType::ScalarType(const QueryValueType &, const RemoveCVRefAndPointer< ValueType > &)> |
| The QueryDistFunction type is a std::function that takes as input a query value and a value stored in the grid, and returns the distance between the two values.
|
|
|
Iterator | begin () |
|
ConstIterator | begin () const |
|
bool | cellEmpty (const KeyType &k) const |
| Returns true if the given cell position does not contain elements in it.
|
|
void | clear () |
|
std::size_t | countInCell (const KeyType &k) const |
| Returns the number of elements contained in the given cell.
|
|
bool | empty () const |
| Returns true if the HashTableGrid is empty (no elements in it).
|
|
Iterator | end () |
|
ConstIterator | end () const |
|
bool | eraseAllInCell (const KeyType &k) |
|
void | eraseInSphere (const Sphere< typename GridType::ScalarType > &s) |
|
| HashTableGrid (const GridType &g) |
|
template<typename ObjIterator > |
| HashTableGrid (ObjIterator begin, ObjIterator end, const IntersectsCellFunction &intersects=nullptr) |
| Creates an HashTableGrid that contains all the elements that can be iterated from begin to end .
|
|
template<Range Rng> |
| HashTableGrid (Rng &&r, const IntersectsCellFunction &intersects=nullptr) |
|
std::set< KeyType > | nonEmptyCells () const |
| Returns an std::set containing the cell positions of all the cells that contain at least one element.
|
|
std::pair< Iterator, Iterator > | valuesInCell (const KeyType &k) |
|
std::pair< ConstIterator, ConstIterator > | valuesInCell (const KeyType &k) const |
|
bool | cellEmpty (const KeyType &k) const |
|
template<typename QueryValueType > |
auto | closestValue (const QueryValueType &qv) const |
|
template<typename QueryValueType > |
auto | closestValue (const QueryValueType &qv, QueryBoundedDistFunction< QueryValueType > distFunction, typename GridType::ScalarType &dist) const |
|
template<typename QueryValueType > |
auto | closestValue (const QueryValueType &qv, QueryDistFunction< QueryValueType > distFunction) const |
|
template<typename QueryValueType > |
auto | closestValue (const QueryValueType &qv, QueryDistFunction< QueryValueType > distFunction, typename GridType::ScalarType &dist) const |
|
template<typename QueryValueType > |
auto | closestValue (const QueryValueType &qv, typename GridType::ScalarType &dist) const |
|
std::size_t | countInCell (const KeyType &k) const |
|
uint | countInSphere (const Sphere< typename GridType::ScalarType > &s) const |
|
bool | erase (const ValueType &v) |
|
bool | eraseAllInCell (const KeyType &k) |
|
void | eraseInSphere (const Sphere< typename GridType::ScalarType > &s) |
|
bool | insert (const ValueType &v) |
| Inserts the given element in the AbstractGrid.
|
|
template<typename ObjIterator > |
uint | insert (ObjIterator begin, ObjIterator end) |
| Inserts all the elements from begin to end . The type referenced by the iterator must be the ValueType of the AbstractGrid.
|
|
template<Range Rng> |
uint | insert (Rng &&r) |
| Inserts all the elements contained in the input range r, from begin to end . The type referenced by the iterator must be the ValueType of the AbstractGrid.
|
|
template<typename QueryValueType > |
auto | kClosestValues (const QueryValueType &qv, uint n) const |
|
template<typename QueryValueType > |
auto | kClosestValues (const QueryValueType &qv, uint n, QueryDistFunction< QueryValueType > distFunction) const |
|
auto | valuesInSphere (const Sphere< typename GridType::ScalarType > &s) const |
|
|
| AbstractGrid () |
| Empty constructor, creates an usable AbstractGrid, since the Grid is not initialized.
|
|
template<typename BoxType > |
| AbstractGrid (const BoxType &bbox, const KeyType &sizes, IntersectsCellFunction intersects=nullptr) |
| Creates a AbstractGrid that allows to store ValueType values on a Grid bounded by bbox , and having the number of cells per dimension given by sizes .
|
|
| AbstractGrid (const GridType &grid, IntersectsCellFunction intersects=nullptr) |
| Creates a AbstractGrid that allows to store ValueType values on the given grid.
|
|
template<PointConcept PointType> |
| AbstractGrid (const PointType &min, const PointType &max, const KeyType &sizes, IntersectsCellFunction intersects=nullptr) |
| Creates a AbstractGrid that allows to store ValueType values on a Grid having min as minimum coordinte of the Grid, max as maximum coordinate of the grid, and the number of cells per dimension given by sizes .
|
|
template<typename ObjIterator > |
| AbstractGrid (ObjIterator begin, ObjIterator end, IntersectsCellFunction intersects=nullptr) |
| Creates an AbstractGrid having a proper Grid to store the elements.
|
|
template<Range Rng> |
| AbstractGrid (Rng &&r, IntersectsCellFunction intersects=nullptr) |
| Creates an AbstractGrid having a proper Grid to store the elements.
|
|
IntersectsCellFunction | mIntersectsFun |
|
template<
typename GridType,
typename ValueType,
bool AllowDuplicates = true>
class vcl::HashTableGrid< GridType, ValueType, AllowDuplicates >
The HashTableGrid class stores N-Dimensional spatial elements (that could be anything on which it can be computed a N-dimensional bounding box) in a regular grid, using a Hash Table having the Cell Grid position as key type.
This Grid allows to perform insertion, deletions and queries in a time that depends only on the number of elements contained in the involved cell(s) during the operation. The total overhead of managing this data structure is the same of managing an std::unordered_multimap. The user can allow or disallow the insertion of duplicate values by setting the boolean AllowDuplicates template parameter, that is defaulted to true
.