Results 1 to 2 of 2

Thread: number of visible points of a curve

  1. #1
    Join Date
    Jul 2015
    Posts
    87
    Thanks
    1
    Thanked 4 Times in 4 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default number of visible points of a curve

    Hi,

    does Qwt provide a function that returns the number of currently visible points of a curve (depending on the scale of x and y).
    I didn't find any in the documentation. What's the best way to get it?

    I would use QwtScaleDiv::lowerBound() and QwtScaleDiv::upperBound() for x and y and parse over all data of a curve
    and check if QwtScaleDiv::contains(double x-value) and QwtScaleDiv::contains(double y-value).

    Is there a better way?

    Regards
    Stefan

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

    Default Re: number of visible points of a curve

    Without having an extra spatial index ( f.e a quadtree ) and not knowing any specific characteristics of the data ( f.e ordered according x ) iterating over all points is all you can do.

    Uwe

Similar Threads

  1. Curve could not pass the points
    By momo in forum Qwt
    Replies: 4
    Last Post: 19th February 2014, 02:08
  2. Replies: 2
    Last Post: 4th September 2011, 22:50
  3. Replies: 1
    Last Post: 22nd January 2010, 15:34
  4. Get the points of a fitted curve
    By giusepped in forum Qwt
    Replies: 4
    Last Post: 25th December 2008, 08:42
  5. Replies: 5
    Last Post: 10th October 2008, 07:44

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.