Results 1 to 3 of 3

Thread: Best AntiAliasing?

  1. #1
    Join Date
    Sep 2009
    Posts
    6
    Qt products
    Qt4
    Platforms
    MacOS X Windows

    Default Best AntiAliasing?

    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:

    Qt Code:
    1. void CurveControl::addShapeRep(ACShapeRep *shape)
    2. {
    3. QVector<double> x;
    4. QVector<double> y;
    5. QwtPlotCurve * currentCurve = new QwtPlotCurve();
    6.  
    7. // Add the curve to the canvas
    8. QList<QPointF> * tempShapeRep = shape->getShapeRep();
    9.  
    10. // Adjust Axis with this new curve
    11. adjustAxis(shape);
    12.  
    13. for(int i = 0; i < tempShapeRep->count(); i++){
    14. x.append(tempShapeRep->at(i).x());
    15. y.append(tempShapeRep->at(i).y());
    16. }
    17.  
    18. myCurveFitter = new QwtSplineCurveFitter();
    19. myCurveFitter->setFitMode(QwtSplineCurveFitter::Spline);
    20.  
    21. currentCurve->setCurveAttribute(QwtPlotCurve::Fitted);
    22. currentCurve->setCurveFitter(myCurveFitter);
    23. currentCurve->setRenderHint(QwtPlotItem::RenderAntialiased, true);
    24. currentCurve->setData(x.data(),y.data(),x.size());
    25.  
    26. currentCurve->setPen(shape->getShapePen());
    27.  
    28. currentCurve->attach(plot);
    29.  
    30. listOfPlotCurve->append(currentCurve);
    31.  
    32. plot->replot();
    33. }
    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

  2. #2
    Join Date
    Feb 2006
    Location
    Munich, Germany
    Posts
    3,313
    Thanked 879 Times in 827 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Best AntiAliasing?

    Reduce the number of your points.

    Uwe

  3. #3
    Join Date
    Sep 2009
    Posts
    6
    Qt products
    Qt4
    Platforms
    MacOS X Windows

    Default Re: Best AntiAliasing?

    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

Similar Threads

  1. QSvgRenderer antialiasing
    By jonks in forum Qt Programming
    Replies: 4
    Last Post: 19th July 2013, 09:39
  2. No text antialiasing with OpenGL graphicsview
    By pherthyl in forum Qt Programming
    Replies: 3
    Last Post: 13th March 2009, 22:47
  3. QImage antialiasing
    By bunjee in forum Qt Programming
    Replies: 1
    Last Post: 5th June 2008, 19:37
  4. Font not Antialiasing
    By ChasW in forum Qt Programming
    Replies: 6
    Last Post: 21st January 2007, 18:12
  5. antialiasing a scene under QGLWidget
    By mickey in forum Newbie
    Replies: 0
    Last Post: 1st September 2006, 17:26

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.