00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00024
00025 #include <qvdefines.h>
00026 #include <QHash>
00027 #define ABS(X) (((X)>0)?(X):(-(X)))
00028 std::ostream& operator << ( std::ostream &os, const QPointF &point )
00029 {
00030 os << "QPointF (" << point.x() << ", " << point.y() << ")";
00031 return os;
00032 }
00033
00034 std::ostream& operator << ( std::ostream &os, const QPoint &point )
00035 {
00036 os << "QPoint (" << point.x() << ", " << point.y() << ")";
00037 return os;
00038 }
00039
00040 std::ostream& operator << ( std::ostream &os, const QPointFMatching &matching )
00041 {
00042 os << "QPointFMatching [" << matching.first << "\t<->\t" << matching.second << "]";
00043 return os;
00044 }
00045
00046 uint qHash(const double &value)
00047 {
00048 const uint *i = (uint *) &value;
00049 const uchar *c = (uchar *) &value;
00050
00051 return i[0] + i[1] + c[0] + c[1] + c[2] + c[3] + c[4] + c[5] + c[6] + c[7];
00052 }
00053
00054 uint qHash(const QPointF &point)
00055 {
00056 return qHash(point.x() + point.y());
00057 }
00058
00059 uint qHash(const QPoint &point)
00060 {
00061 return qHash(point.x() + point.y());
00062 }
00063