Results 1 to 2 of 2

Thread: Min Max Values of all Curves

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

    Default Min Max Values of all Curves

    Hi,

    i calculate the max, min values over all attached curves of a plot

    Qt Code:
    1. QwtPlotItemList curveList = plot()->itemList( QwtPlotItem::Rtti_PlotCurve );
    2.  
    3. for ( int i = 0; i < curveList.size(); i++ )
    4. {
    5. QwtPlotCurve *curve = static_cast<QwtPlotCurve *>( curveList[i] );
    6.  
    7. d_data->maxLimitX = qMax( d_data->maxLimitX, curve->maxXValue() );
    8. d_data->minLimitX = qMin( d_data->minLimitX, curve->minXValue() );
    9.  
    10. d_data->maxLimitY = qMax( d_data->maxLimitY, curve->maxYValue() );
    11. d_data->minLimitY = qMin( d_data->minLimitY, curve->minYValue() );
    12. }
    To copy to clipboard, switch view to plain text mode 

    Does QwtPlot provide an integrated function to get the same? I didn't found any.

    Thx
    Stefan

  2. #2
    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: Min Max Values of all Curves

    Better move your code into YourCurve::boundingRect() or even better: QwtSeriesData<QPointF>::boundingRect().

    The bounding rectangle is useful for certain operations ( f.e auto scaling ) and when it is possible to calculate it without having to iterate over all points you can speed up those operations.

    Uwe

Similar Threads

  1. Replies: 5
    Last Post: 27th November 2014, 10:15
  2. Curves in the plot ?
    By hassinoss in forum Qwt
    Replies: 1
    Last Post: 5th February 2014, 04:44
  3. How to convert string hex values to its real binary values?
    By AttilaPethe in forum Qt Programming
    Replies: 1
    Last Post: 20th February 2012, 22:47
  4. qwt several curves at a plot
    By freude3 in forum Qwt
    Replies: 4
    Last Post: 4th January 2011, 07:45
  5. qwt display curves
    By sergio486 in forum Qt Programming
    Replies: 0
    Last Post: 11th December 2010, 21:27

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.