26 #ifndef GRALE_POINTSORT_H
28 #define GRALE_POINTSORT_H
30 #include "graleconfig.h"
40 PointSort() { m_x = 0; m_y = 0; }
41 PointSort(Vector2D<T> p) { m_x = p.getX(); m_y = p.getY(); }
42 void calculateScore(Vector2D<T> refpoint) { T a = m_x - refpoint.getX(); T b = m_y - refpoint.getY(); T s2 = a*a + b*b; m_score = a*ABS(a)/s2; }
43 double getScore()
const {
return m_score; }
44 Vector2D<T> getVector2D()
const {
return Vector2D<T>(m_x, m_y); }
51 inline bool operator< (const PointSort<T> &p1,
const PointSort<T> &p2)
53 return (p1.getScore() > p2.getScore());
58 #endif // GRALE_POINTSORT_H