#include <quadMap.h>
Public Member Functions | |
| QuadMapComparator () | |
| Constructor. | |
| virtual | ~QuadMapComparator () |
| Destructor. | |
| unsigned int | chooseChild (Type const &element, double border0, double border1) const |
| Given a map and an element, compute in which quadrant of the map the element belongs. | |
| double | computeDistanceSquared (Type const &arg0, Type const &arg1) const |
| This member function computes the square of the Euclidean distance between two Type instances. | |
| void | getLowerBoundSquaredDistances (Type const &element, double boundary0, double boundary1, double &minDistance0, double &minDistance1, double &minDistance01) const |
| This member function computes a lower bound on the squared distances between the specified Type instance and Type instances contained in other cells of the quadmap. | |
| bool | isEqual (Type const &arg0, Type const &arg1) const |
| This member function returns true if its two arguments represent the same point. | |
It provides functions for comparing points during a sort, for computing the distance between points, and for finding the lower bound on the distance between a particular point and the region of space represented by a particular cell of the map. Template argument Type specifies what kind of element is contained in the map. Logically, Type represents a point in 2D space. In order to work with this class template, Type must allow access to individual coordinates via Type::operator[](size_t), which will be called with arguments in the range [0, 1]. Also, operator==(Type const&, Type const&) must return true if the two arguments represent the same point.
If you need to build a QuadMap using a Type that doesn't support this interface, you can simply specialize QuadMapComparator (or specific member functions of QuadMapComparator) for your type. For an example of such a specialization, see the file dlrComputerVision/test/quadMapTest.cpp.
Definition at line 49 of file quadMap.h.
| dlr::computerVision::QuadMapComparator< Type >::QuadMapComparator | ( | ) | [inline] |
| virtual dlr::computerVision::QuadMapComparator< Type >::~QuadMapComparator | ( | ) | [inline, virtual] |
| unsigned int dlr::computerVision::QuadMapComparator< Type >::chooseChild | ( | Type const & | element, | |
| double | border0, | |||
| double | border1 | |||
| ) | const [inline] |
Given a map and an element, compute in which quadrant of the map the element belongs.
The first quadrant lies at (x, y) < (border0, border1); the second quadrant lies at x >= border0, y < border1; the third quadrant lies at x < border0, y >= border1; and the fourth quadrant lies at x >= border0, y >= border1.
| element | This argument is the element to be assigned to a quadrant. | |
| border0 | This argument specifies the division between quadrants along the first coordinate axis. | |
| border1 | This argument specifies the division between quadrants along the first coordinate axis. |
| double dlr::computerVision::QuadMapComparator< Type >::computeDistanceSquared | ( | Type const & | arg0, | |
| Type const & | arg1 | |||
| ) | const [inline] |
This member function computes the square of the Euclidean distance between two Type instances.
| arg0 | This argument is the first of the two Type instances. | |
| arg1 | This argument is the second of the two Type instances. |
| void dlr::computerVision::QuadMapComparator< Type >::getLowerBoundSquaredDistances | ( | Type const & | element, | |
| double | boundary0, | |||
| double | boundary1, | |||
| double & | minDistance0, | |||
| double & | minDistance1, | |||
| double & | minDistance01 | |||
| ) | const [inline] |
This member function computes a lower bound on the squared distances between the specified Type instance and Type instances contained in other cells of the quadmap.
| arg0 | This argument is the point for which to compute the lower bound squared distances. | |
| arg1 | This argument is the point through which the separating hyperplane passes. |
| bool dlr::computerVision::QuadMapComparator< Type >::isEqual | ( | Type const & | arg0, | |
| Type const & | arg1 | |||
| ) | const [inline] |
This member function returns true if its two arguments represent the same point.
| arg0 | This argument is the first Type instance to be compared. | |
| arg1 | This argument is the second Type instance to be compared. |
1.5.8