PDA

View Full Version : Best AntiAliasing?



beni46
29th January 2010, 16:11
I build an application which draw curve with Qwt.

I obtain this picture:

4219


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;
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();
}

Is it possible to obtain a better anti-aliasing with Qwt?

Thank you for your answer.

bye

Uwe
29th January 2010, 16:35
Reduce the number of your points.

Uwe

beni46
2nd February 2010, 13:28
When I have look the code, I see that developper use QPoint and not QPointF to draw curve. They do that to conserve compatibility with previous version of Qwt.

In the Qwt 6.0, it will be improved.
Thank you for your help.

Bye