![]() |
University of Murcia ![]() |
QVVectorMap Class ReferenceFast nearest neigbour vector container.
More...
|
Public Member Functions | |
void | add (const QVVector &vector) |
Adds a vector to the container. | |
QVVectorMap (const QList< QVVector > &vectors=QList< QVVector >()) | |
Default constructor. | |
QVVector | getClosestVector (const QVVector &vector) const |
Get the closest vector to a given one from the container. | |
QList< QVVector > | getClosestVectors (const QVVector &vector, const int n) const |
Get the closest vectors to a given one from the container. | |
Static Public Member Functions | |
static QList< QVVector > | getClosestVectors (const QVVector actualVector, const QList< QVVector > &vectors, const int n) |
function for debug purposes |
Vector maps are created from a list of QVVector objects, or initialized manually, inserting the points with the add method:
QList<QVVector> vectors; QVVector v1, v2, ...; [...] points.append(v1); points.append(v2); [...] QVVectorMap vectorMap1(vectors), vectorMap2; vectorMap2.add(v4); vectorMap2.add(v5); [...]
The method getClosestVectors can be used to obtain the points registered in the container, which are closer to a given vector.
Definition at line 56 of file qvvectormap.h.
Default constructor.
vectors | Vectors to insert in the container. |
Definition at line 30 of file qvvectormap.cpp.
void QVVectorMap::add | ( | const QVVector & | vector | ) |
Adds a vector to the container.
point | Vector to add to the container. |
Definition at line 25 of file qvvectormap.cpp.
Get the closest vector to a given one from the container.
Definition at line 72 of file qvvectormap.h.
Get the closest vectors to a given one from the container.
Definition at line 44 of file qvvectormap.cpp.
Referenced by getClosestVector().