Results 1 to 9 of 9

Thread: Need guidelines to handle the duo curve legend selection

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #7
    Join Date
    Feb 2006
    Location
    Munich, Germany
    Posts
    3,312
    Thanked 879 Times in 827 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Need guidelines to handle the duo curve legend selection

    In case your points are sorted in x or y direction you can find much more efficient implementations - like in CurveTracker::curveLineAt in the curvetracker example.
    Implementations like QwtPlotCurve::closestPoint - or your adaption - are slow as they are iterating over all points and you often find better solutions using the characteristics of the data or by introducing extra data structures like an R-Tree ( https://www.boost.org/doc/libs/1_63_...roduction.html ).

    Not sure, why you are using floats ( QVector2D instead of QLineF ) - but finding the distance between a point and a line is basic school maths and absolutely no reason to violate the GPL by copying trivialities into the source code of your commercial project !

    Uwe
    Last edited by Uwe; 1st July 2019 at 05:39.

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

    embeddedmz (3rd July 2019)

Similar Threads

  1. Replies: 11
    Last Post: 11th September 2013, 07:59
  2. Replies: 2
    Last Post: 23rd June 2012, 18:12
  3. connect 1 legend item and 2 curve
    By ruzik in forum Qwt
    Replies: 1
    Last Post: 13th September 2011, 11:21
  4. Replies: 5
    Last Post: 7th February 2011, 08:38
  5. Drawing curve legend
    By lni in forum Qt Programming
    Replies: 1
    Last Post: 16th February 2010, 03: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.