I build an application which draw curve with Qwt.
I obtain this picture:
Picture 10.png
On this picture there are still some "stairs" in curve like when you didn't activate Anti-Aliasing but anti Aliasing are activate.
The function which attach curve to the plot:
void CurveControl::addShapeRep(ACShapeRep *shape)
{
QVector<double> x;
QVector<double> y;
// Add the curve to the canvas
QList<QPointF> * tempShapeRep = shape->getShapeRep();
// Adjust Axis with this new curve
adjustAxis(shape);
for(int i = 0; i < tempShapeRep->count(); i++){
x.append(tempShapeRep->at(i).x());
y.append(tempShapeRep->at(i).y());
}
currentCurve->setCurveFitter(myCurveFitter);
currentCurve
->setRenderHint
(QwtPlotItem::RenderAntialiased,
true);
currentCurve->setData(x.data(),y.data(),x.size());
currentCurve->setPen(shape->getShapePen());
currentCurve->attach(plot);
listOfPlotCurve->append(currentCurve);
plot->replot();
}
void CurveControl::addShapeRep(ACShapeRep *shape)
{
QVector<double> x;
QVector<double> y;
QwtPlotCurve * currentCurve = new QwtPlotCurve();
// Add the curve to the canvas
QList<QPointF> * tempShapeRep = shape->getShapeRep();
// Adjust Axis with this new curve
adjustAxis(shape);
for(int i = 0; i < tempShapeRep->count(); i++){
x.append(tempShapeRep->at(i).x());
y.append(tempShapeRep->at(i).y());
}
myCurveFitter = new QwtSplineCurveFitter();
myCurveFitter->setFitMode(QwtSplineCurveFitter::Spline);
currentCurve->setCurveAttribute(QwtPlotCurve::Fitted);
currentCurve->setCurveFitter(myCurveFitter);
currentCurve->setRenderHint(QwtPlotItem::RenderAntialiased, true);
currentCurve->setData(x.data(),y.data(),x.size());
currentCurve->setPen(shape->getShapePen());
currentCurve->attach(plot);
listOfPlotCurve->append(currentCurve);
plot->replot();
}
To copy to clipboard, switch view to plain text mode
Is it possible to obtain a better anti-aliasing with Qwt?
Thank you for your answer.
bye
Bookmarks