Results 1 to 2 of 2

Thread: Curve name tooltip needs for QwtPlotCurve on Canvas

  1. #1
    Join Date
    Jan 2010
    Location
    Ankara - TURKEY
    Posts
    30
    Thanks
    13
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Windows

    Default Curve name tooltip needs for QwtPlotCurve on Canvas

    Hi All;

    I need something much special for me. I have lots of curves on my canvas so generally I can't locate target curve on the canvas, so I need tooltip for every curve when I placed my cursor as close as needed.

    At first grasp, I found following solution;

    -I will get the cursor's coordinate and dispatch this coordinate to each curve.

    -These curves will start to calculate closest grade by binary search and line equations of 2 points.

    -By kind of these calculations and finding operation I will get "closest rate" for each curve, then I will compare each rate and find most closest one.

    -Then I will compare this closest rate with my threshold which can elect out of defined range.

    -If threshold operation passes too, I can make decision that my curve is this most closest point's owner curve.

    As you can see this bulk of operations for each curve is too complex and can make my system slow down.

    So have you any much fast and reasonable way acvieve kind of this goal?

    Thanks in advance.
    Regards.

    Ãœmit Uzun

  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: Curve name tooltip needs for QwtPlotCurve on Canvas

    When you have too many points and identifying the closest point gets too slow for iterating over all points you need to introduce some sort of spatial index.

    The best implementation depends on the details of your plot, but I once used a quadtree for an application with a plot with curves with symbols and no lines. If you have to identify vectors ( f.e for curve lines ) you might have to use something like a R-Tree.

    But it's long ago since I left university - maybe there are other standard algorithms available today, better ask google.

    Uwe

  3. The following user says thank you to Uwe for this useful post:

    umituzun84 (27th April 2011)

Similar Threads

  1. Replies: 1
    Last Post: 2nd February 2011, 12:06
  2. QwtPlotCurve and QScrollArea
    By Fanwa in forum Qwt
    Replies: 1
    Last Post: 2nd December 2010, 07:49
  3. Replies: 4
    Last Post: 29th April 2010, 06:11
  4. Replies: 1
    Last Post: 22nd January 2010, 14:34
  5. Replies: 1
    Last Post: 9th December 2009, 17:14

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.