Results 1 to 6 of 6

Thread: finding collection of points index on a curve

  1. #1
    Join Date
    Nov 2015
    Posts
    128
    Thanks
    70
    Qt products
    Qt5
    Platforms
    Windows

    Default finding collection of points index on a curve

    Hi,
    I need to find index of all points that are into the area of a selected area by a picker. I could find index of an only one point index by this code:

    Qt Code:
    1. connect( picker, SIGNAL( selected( const QPolygon & ), SLOT(UpdVizir( const QPolygon & )));
    To copy to clipboard, switch view to plain text mode 

    Qt Code:
    1. void TrendTop::UpdVizir( const QPolygon &points )
    2. {
    3. if ( points.size() != 1 )
    4. return;
    5.  
    6. double dist;
    7. int index = curv1->closestPoint( points[0], &dist );
    8. }
    To copy to clipboard, switch view to plain text mode 

    How all points into a selected area can be obtained?

  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: finding collection of points index on a curve

    If you don't have an extra spatial index for our points you have to iterate over the points and use QRectF::contains().
    In case your points are ordered in x or y direction you could use qwtUpperSampleIndex() to speed up the operation.

    Uwe

  3. #3
    Join Date
    Nov 2015
    Posts
    128
    Thanks
    70
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: finding collection of points index on a curve

    Quote Originally Posted by Uwe View Post
    If you don't have an extra spatial index for our points you have to iterate over the points and use QRectF::contains().
    In case your points are ordered in x or y direction you could use qwtUpperSampleIndex() to speed up the operation.

    Uwe
    Thanks for answering, but I dont want to input any X or Y. I want Only to select an area and then the output be index of points into the area. please help me in this way

  4. #4
    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: finding collection of points index on a curve

    Quote Originally Posted by Alex22 View Post
    I want Only to select an area and then the output be index of points into the area. please help me in this way
    How is your clarification contrary to the given answer ?

    Uwe

  5. #5
    Join Date
    Nov 2015
    Posts
    128
    Thanks
    70
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: finding collection of points index on a curve

    Uwe,
    I can find nothing about "qwtUpperSampleIndex() " in the Doc. I am using multiaxes version.
    My purpose is removing some points (that are noise in my signal), by selecting an area that includes these noise points. And after selecting the area by a picker, i need to replot() and after reploting, these points (noise points) be removed.

  6. #6
    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: finding collection of points index on a curve

    I can find nothing about "qwtUpperSampleIndex() " in the Doc. I am using multiaxes version.
    It can be found in qwt_series_data.h.

    My purpose is removing some points (that are noise in my signal), by selecting an area that includes these noise points.
    Still don't get what additional answer you are waiting for. By iterating ( or using an spatial index ) you can identify all points inside the selected area and build a new buffer without them.
    If you don't want to create a second buffer and simply want to exclude points from being plotted you can implement your own type of QwtSeriesData bridge.

    Uwe

Similar Threads

  1. Curve could not pass the points
    By momo in forum Qwt
    Replies: 4
    Last Post: 19th February 2014, 01:08
  2. Replies: 0
    Last Post: 28th August 2013, 11:38
  3. Replies: 2
    Last Post: 4th September 2011, 21:50
  4. Deleting points from a curve dynamically
    By maneesh18187 in forum Qwt
    Replies: 2
    Last Post: 9th February 2010, 18:08
  5. Get the points of a fitted curve
    By giusepped in forum Qwt
    Replies: 4
    Last Post: 25th December 2008, 07:42

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.