1.11.2 split up of xml helper functions. started to work on attributes
9 QString qpointToString (const QPoint &p)
11 return "(" + QString("%1").arg(p.x()) +","+ QString ("%1").arg (p.y()) +")";
14 QString qpointfToString (const QPointF &p)
16 return "(" + QString("%1").arg(p.x()) +","+ QString ("%1").arg (p.y()) +")";
19 ostream &operator<< (ostream &stream, QPoint const &p)
21 stream << "("<<p.x()<<","<<p.y()<<")";
25 ostream &operator<< (ostream &stream, QPointF const &p)
27 stream << "("<<p.x()<<","<<p.y()<<")";
31 qreal getAngle(const QPointF &p)
33 // Calculate angle of vector to y-axis
43 return (qreal)(M_PI - atan ( (qreal)(p.x()) / (qreal)(p.y()) ) );
46 return (qreal)( 2*M_PI - atan ( (qreal)(p.x()) / (qreal)(p.y()) ) );
48 return (qreal)( - atan ( (qreal)(p.x()) / (qreal)(p.y()) ) );
52 QPointF normalise(const QPointF &p)
54 // Calculate normalised position (fixed length)
82 return QPoint ((int) (x),(int) (y));
86 qreal max(qreal a, qreal b)