2 #include "qwt_painter.h"
3 #include"qwt_scale_map.h"
17 const QwtScaleMap &xMap,
18 const QwtScaleMap &yMap,
20 int from,
int to)
const
36 const QwtSeriesData<QxrdPoint4D> *series = data();
38 for (
int i=from; i<=to; i++) {
41 double x0 = xMap.transform(sample.
x());
42 double y0 = yMap.transform(sample.
y());
43 double x1 = xMap.transform(sample.
x()+sample.
z()*50.0);
44 double y1 = yMap.transform(sample.
y()+sample.
t()*50.0);
46 double th = atan2(y1-y0, x1-x0);
49 double xp = x1 - 5.0*cos(thp);
50 double yp = y1 - 5.0*sin(thp);
52 double xm = x1 - 5.0*cos(thm);
53 double ym = y1 - 5.0*sin(thm);
55 QwtPainter::drawLine(painter, x0, y0, x1, y1);
56 QwtPainter::drawLine(painter, x1, y1, xp, yp);
57 QwtPainter::drawLine(painter, x1, y1, xm, ym);
65 const QwtSeriesData<QxrdPoint4D> *series = data();
68 return series->boundingRect();
76 const QwtSeriesData<QxrdPoint4D> *series = data();
79 return series->boundingRect();
87 setItemAttribute( QwtPlotItem::AutoScale,
true );
88 setItemAttribute( QwtPlotItem::Legend,
false );
QxrdPlotVectorFieldCurve()
void setSamples(QxrdPlotVectorFieldData *data)
void drawSeries(QPainter *painter, const QwtScaleMap &xMap, const QwtScaleMap &yMap, const QRectF &canvasRect, int from, int to) const
QRectF boundingRect() const