Visual Computing Library  devel
Loading...
Searching...
No Matches
vcl::StaticGrid< GridType, ValueType > Class Template Reference
Inheritance diagram for vcl::StaticGrid< GridType, ValueType >:

Public Types

using ConstIterator = ConstStaticGridIterator< KeyType, ValueType, GridType >
 
using IntersectsCellFunction = AbsGrid::IntersectsCellFunction
 
using Iterator = StaticGridIterator< KeyType, ValueType, GridType >
 
using KeyType = AbsGrid::KeyType
 
- Public Types inherited from vcl::AbstractGrid< GridType, ValueType, StaticGrid< GridType, ValueType > >
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
 
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.
 
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.
 

Public Member Functions

Iterator begin ()
 
ConstIterator begin () const
 
void build ()
 
bool cellEmpty (const KeyType &k) const
 
std::size_t countInCell (const KeyType &k) const
 
bool empty () const
 
Iterator end ()
 
ConstIterator end () const
 
std::set< KeyType > nonEmptyCells () const
 
 StaticGrid (const GridType &g)
 
template<typename ObjIterator >
 StaticGrid (ObjIterator begin, ObjIterator end, const IntersectsCellFunction &intersects=nullptr)
 
template<Range Rng>
 StaticGrid (Rng &&r, const IntersectsCellFunction &intersects=nullptr)
 
std::pair< Iterator, IteratorvaluesInCell (const KeyType &k)
 
std::pair< ConstIterator, ConstIteratorvaluesInCell (const KeyType &k) const
 
- Public Member Functions inherited from vcl::AbstractGrid< GridType, ValueType, StaticGrid< GridType, ValueType > >
bool cellEmpty (const KeyType &k) const
 
auto closestValue (const QueryValueType &qv) const
 
auto closestValue (const QueryValueType &qv, QueryBoundedDistFunction< QueryValueType > distFunction, typename GridType::ScalarType &dist) const
 
auto closestValue (const QueryValueType &qv, QueryDistFunction< QueryValueType > distFunction) const
 
auto closestValue (const QueryValueType &qv, QueryDistFunction< QueryValueType > distFunction, typename GridType::ScalarType &dist) const
 
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.
 
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.
 
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.
 
auto kClosestValues (const QueryValueType &qv, uint n) const
 
auto kClosestValues (const QueryValueType &qv, uint n, QueryDistFunction< QueryValueType > distFunction) const
 
auto valuesInSphere (const Sphere< typename GridType::ScalarType > &s) const
 

Private Types

using AbsGrid = AbstractGrid< GridType, ValueType, StaticGrid< GridType, ValueType > >
 
using PairComparator = FirstElementPairComparator< PairType >
 
using PairType = std::pair< uint, ValueType >
 

Private Member Functions

bool eraseInCell (const KeyType &, const ValueType &)
 
bool insertInCell (const KeyType &cell, const ValueType &v)
 

Private Attributes

friend AbsGrid
 
PairComparator mComparator = PairComparator()
 
std::vector< uint > mGrid
 
std::vector< PairType > mValues
 

Additional Inherited Members

- Protected Member Functions inherited from vcl::AbstractGrid< GridType, ValueType, StaticGrid< GridType, ValueType > >
 AbstractGrid ()
 Empty constructor, creates an usable AbstractGrid, since the Grid is not initialized.
 
 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.
 
 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.
 
 AbstractGrid (ObjIterator begin, ObjIterator end, IntersectsCellFunction intersects=nullptr)
 Creates an AbstractGrid having a proper Grid to store the elements.
 
 AbstractGrid (Rng &&r, IntersectsCellFunction intersects=nullptr)
 Creates an AbstractGrid having a proper Grid to store the elements.
 
- Protected Attributes inherited from vcl::AbstractGrid< GridType, ValueType, StaticGrid< GridType, ValueType > >
IntersectsCellFunction mIntersectsFun
 

The documentation for this class was generated from the following file: