1 #ifndef PATH_H
2 #define PATH_H
3 
4 #include <QVector>
5 #include <QRectF>
6 #include "common/coordinates.h"
7 #include "common/rectc.h"
8 
9 class PathPoint
10 {
11 public:
PathPoint()12 	PathPoint() :
13 	  _coordinates(Coordinates()), _distance(NAN) {}
PathPoint(const Coordinates & coordinates,qreal distance)14 	PathPoint(const Coordinates &coordinates, qreal distance)
15 	  : _coordinates(coordinates), _distance(distance) {}
16 
coordinates()17 	const Coordinates &coordinates() const {return _coordinates;}
distance()18 	qreal distance() const {return _distance;}
19 
20 private:
21 	Coordinates _coordinates;
22 	qreal _distance;
23 };
24 
25 Q_DECLARE_TYPEINFO(PathPoint, Q_PRIMITIVE_TYPE);
26 #ifndef QT_NO_DEBUG
27 QDebug operator<<(QDebug dbg, const PathPoint &point);
28 #endif // QT_NO_DEBUG
29 
30 typedef QVector<PathPoint> PathSegment;
31 
32 class Path : public QList<PathSegment>
33 {
34 public:
35 	bool isValid() const;
36 	RectC boundingRect() const;
37 };
38 
39 #endif // PATH_H
40