8 enum GraphType
{Distance
, Time
};
13 GraphPoint(qreal s
= NAN
, qreal t
= NAN
, qreal y
= NAN
)
14 : _s(s
), _t(t
), _y(y
) {}
16 qreal
s() const {return _s
;}
17 qreal
t() const {return _t
;}
18 qreal
y() const {return _y
;}
19 qreal
x(GraphType type
) const {return (type
== Distance
) ? _s
: _t
;}
21 void setS(qreal s
) {_s
= s
;}
22 void setT(qreal t
) {_t
= t
;}
23 void setY(qreal y
) {_y
= y
;}
31 Q_DECLARE_TYPEINFO(GraphPoint
, Q_PRIMITIVE_TYPE
);
32 QDebug
operator<<(QDebug dbg
, const GraphPoint
&point
);
35 class Graph
: public QVector
<GraphPoint
>
38 Graph() : QVector
<GraphPoint
>() {_time
= true;}
39 void append(const GraphPoint
&p
)
41 if (std::isnan(p
.t()))
43 QVector
<GraphPoint
>::append(p
);
46 bool hasTime() const {return _time
;}