Engauge Digitizer  2
 All Classes Files Functions Variables Enumerations Enumerator Friends Pages
PointMatchTriplet.cpp
1 #include "PointMatchTriplet.h"
2 
4  int y,
5  double correlation) :
6  m_x (x),
7  m_y (y),
8  m_correlation (correlation)
9 {
10 }
11 
13 {
14  return m_correlation;
15 }
16 
18 {
19  // qSort wants to sort by ascending correlation, but we want to sort by descending correlation. We
20  // compensate by comparing correlations numerically and flipping the result
21 
22  bool isLess = false;
23 
24  if (m_correlation == other.correlation ()) {
25 
26  // To reduce jumping around, we prefer points on the left when the correlations are equal
27  isLess = (m_x < other.x());
28 
29  } else {
30 
31  isLess = !(m_correlation < other.correlation ());
32 
33  }
34 
35  return isLess;
36 }
37 
39 {
40  return QPoint (m_x,
41  m_y);
42 }
43 
45 {
46  return m_x;
47 }
48 
50 {
51  return m_y;
52 }
PointMatchTriplet(int x, int y, double correlation)
Single constructor.
int x() const
Get method for x coordinate.
double correlation() const
Get method for correlation.
QPoint point() const
Return (x,y) coordinates as a point.
Representation of one matched point as produced from the point match algorithm.
int y() const
Get method for y coordinate.
bool operator<(const PointMatchTriplet &other) const
Comparison operator for sorting lists of this class using qSort.