Results 1 to 2 of 2

Thread: Slow replot of fillCurve in QWT

  1. #1
    Join Date
    Jun 2016
    Posts
    5
    Qt products
    Qt5
    Platforms
    Unix/X11 Windows Android

    Default Slow replot of fillCurve in QWT

    Hello, everybody,
    I have a problem drawing curves with a filled area (QwtPlotCurve::fillCurve). The time needed to draw the drawing method (QwtPainter::drawPolygon) increases rapidly with the data points. Here is a measurement (time to draw; number of data points).

    _timer: 7 ms; size: 300
    _timer: 22 ms; size: 550
    _timer: 36 ms; size: 800
    _timer: 65 ms; size: 1050
    _timer: 91 ms; size: 1300
    _timer: 105 ms; size: 1450

    My plot is redrawn every 250 ms and should contain up to 60000 data points if possible.

    When I switch to the area plot, I set the following parameters (ADataPlot is derived from QwtPlotCurve, PC_DATA is the index of a curve).

    Qt Code:
    1. ADataCurve * curve = Curves.value(PC_DATA);
    2. if (curve)
    3. {
    4. QBrush brush;
    5. brush.setStyle(Qt::SolidPattern);
    6. curve->setBrush(brush);
    7. curve->setStyle(QwtPlotCurve::Sticks);
    8. curve->setOrientation(Qt::Vertical);
    9. }
    To copy to clipboard, switch view to plain text mode 

    Does anyone know how I can reduce the time I spend drawing? I am grateful for any help!

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

    Default Re: Slow replot of fillCurve in QWT

    When having 60000 points the QwtPlotCurve::FilterPointsAggressive ( Qwt >= SVN branch 6.2 ) flag will be quite effective. This will limit the number of points to a maximum of 4 * canvasWidth.
    There is also the option of using QwtWeedingCurveFitter, but this algo is pretty expensive and might not result in something better. But you can try with a small chunkSize ( ~10 ) and see what happens.

    Furthermore you could try to find a hardware accelerated backend. When being on X11 you only need to enable the X11 paintengine ( Qt4 or Qt5 >= 5.10 by "export QT_XCB_NATIVE_PAINTING=1" ).

    On other platforms you could try to get OpenGL running. For your situation ( expensive rendering + moderate update rates ) QwtPlotCanvas::OpenGLBuffer ( SVN trunk ). You could also try one of the OpenGL canvases - rendering will be the same as with QwtPlotCanvas::OpenGLBuffer, but the extra roundtrip for copying between graphics and main memory can be avoided.

    If you have the choice: going with X11 is the best option.

    Uwe

Similar Threads

  1. Slow replot of fillCurve in QWT
    By Odin07 in forum Qwt
    Replies: 0
    Last Post: 4th October 2018, 12:01
  2. Replies: 1
    Last Post: 14th May 2014, 07:57
  3. the replot of a qwtPlot is too slow
    By gaia86 in forum Qwt
    Replies: 3
    Last Post: 4th April 2012, 08:33
  4. the replot of a qwtPlot is too slow
    By gaia86 in forum Qwt
    Replies: 1
    Last Post: 3rd April 2012, 16:54
  5. the replot of a qwtPlot is too slow
    By gaia86 in forum Qwt
    Replies: 0
    Last Post: 3rd April 2012, 15:19

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.