dlr::computerVision::QuadMapComparator< Type > Class Template Reference

This class template is used by the QuadMap class template to interact with the data points to be stored in the map. More...

#include <quadMap.h>

List of all members.

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.


Detailed Description

template<class Type>
class dlr::computerVision::QuadMapComparator< Type >

This class template is used by the QuadMap class template to interact with the data points to be stored in the map.

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.


Constructor & Destructor Documentation

template<class Type >
dlr::computerVision::QuadMapComparator< Type >::QuadMapComparator (  )  [inline]

Constructor.

Definition at line 57 of file quadMap.h.

template<class Type >
virtual dlr::computerVision::QuadMapComparator< Type >::~QuadMapComparator (  )  [inline, virtual]

Destructor.

Definition at line 64 of file quadMap.h.


Member Function Documentation

template<class Type >
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.

Parameters:
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.
Returns:
The return value is 0 for the first quadrant, 1 for the second, 2 for the third, or 3 for the fourth.

Definition at line 88 of file quadMap.h.

template<class Type >
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.

Parameters:
arg0 This argument is the first of the two Type instances.
arg1 This argument is the second of the two Type instances.
Returns:
The return value is the Euclidean distance between arg0 and arg1.

Definition at line 125 of file quadMap.h.

template<class Type >
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.

Parameters:
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.
Returns:
The return value is the minimum distance between arg0 and the separating hyperplane.

Definition at line 147 of file quadMap.h.

template<class Type >
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.

Parameters:
arg0 This argument is the first Type instance to be compared.
arg1 This argument is the second Type instance to be compared.
Returns:
The return value is true if the two arguments represent the same point, false otherwise.

Definition at line 174 of file quadMap.h.


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

Generated on Wed Nov 25 12:15:09 2009 for dlrComputerVision Utility Library by  doxygen 1.5.8