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

Public Types

using KeyType = AbsGrid::KeyType
 
using IntersectsCellFunction = AbsGrid::IntersectsCellFunction
 
using Iterator = StaticGridIterator< KeyType, ValueType, GridType >
 
using ConstIterator = ConstStaticGridIterator< KeyType, ValueType, GridType >
 
- 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::CellCoord
 
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.
 
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.
 

Public Member Functions

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

Private Types

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

Private Member Functions

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

Private Attributes

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

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 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 (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 (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: