| qwt_counter.h | | qwt_counter.h | |
| | | | |
| skipping to change at line 20 | | skipping to change at line 20 | |
| #ifndef QWT_COUNTER_H | | #ifndef QWT_COUNTER_H | |
| #define QWT_COUNTER_H | | #define QWT_COUNTER_H | |
| | | | |
| #include "qwt_global.h" | | #include "qwt_global.h" | |
| #include "qwt_double_range.h" | | #include "qwt_double_range.h" | |
| #include <qwidget.h> | | #include <qwidget.h> | |
| | | | |
| /*! | | /*! | |
| \brief The Counter Widget | | \brief The Counter Widget | |
| | | | |
|
| A Counter consists of a label displaying a number and | | A Counter consists of a lineEdit displaying a number and | |
| one ore more (up to three) push buttons on each side | | one ore more (up to three) push buttons on each side | |
|
| of the label which can be used to increment or decrement | | of the lineEdit which can be used to increment or decrement | |
| the counter's value. | | the counter's value. | |
| | | | |
| A Counter has a range from a minimum value to a maximum value | | A Counter has a range from a minimum value to a maximum value | |
|
| and a step size. The range can be specified using | | and a step size. The range can be specified using setRange(). | |
| QwtDblRange::setRange(). | | | |
| The counter's value is an integer multiple of the step size. | | | |
| The number of steps by which a button increments or decrements | | The number of steps by which a button increments or decrements | |
|
| the value can be specified using QwtCounter::setIncSteps(). | | the value can be specified using setIncSteps(). | |
| The number of buttons can be changed with | | The number of buttons can be changed with setNumButtons(). | |
| QwtCounter::setNumButtons(). | | | |
| | | | |
| Holding the space bar down with focus on a button is the | | | |
| fastest method to step through the counter values. | | | |
| When the counter underflows/overflows, the focus is set | | | |
| to the smallest up/down button and counting is disabled. | | | |
| Counting is re-enabled on a button release event (mouse or | | | |
| space bar). | | | |
| | | | |
| Example: | | Example: | |
| \code | | \code | |
|
| #include "../include/qwt_counter.h> | | #include <qwt_counter.h> | |
| | | | |
|
| QwtCounter *cnt; | | QwtCounter *counter = new QwtCounter(parent); | |
| | | | |
|
| cnt = new QwtCounter(parent, name); | | counter->setRange(0.0, 100.0, 1.0); // From 0.0 to 100, step 1. | |
| | | 0 | |
| | | counter->setNumButtons(2); // Two buttons each side | |
| | | counter->setIncSteps(QwtCounter::Button1, 1); // Button 1 increments 1 st | |
| | | ep | |
| | | counter->setIncSteps(QwtCounter::Button2, 20); // Button 2 increments 20 s | |
| | | teps | |
| | | | |
|
| cnt->setRange(0.0, 100.0, 1.0); // From 0.0 to 100, step 1.0 | | connect(counter, SIGNAL(valueChanged(double)), my_class, SLOT(newValue(doub | |
| cnt->setNumButtons(2); // Two buttons each side | | le))); | |
| cnt->setIncSteps(QwtCounter::Button1, 1); // Button 1 increments 1 step | | | |
| cnt->setIncSteps(QwtCounter::Button2, 20); // Button 2 increments 20 steps | | | |
| | | | |
| connect(cnt, SIGNAL(valueChanged(double)), my_class, SLOT(newValue(double)) | | | |
| ); | | | |
| \endcode | | \endcode | |
| */ | | */ | |
| | | | |
| class QWT_EXPORT QwtCounter : public QWidget, public QwtDoubleRange | | class QWT_EXPORT QwtCounter : public QWidget, public QwtDoubleRange | |
| { | | { | |
| Q_OBJECT | | Q_OBJECT | |
| | | | |
| Q_PROPERTY( int numButtons READ numButtons WRITE setNumButtons ) | | Q_PROPERTY( int numButtons READ numButtons WRITE setNumButtons ) | |
| Q_PROPERTY( double basicstep READ step WRITE setStep ) | | Q_PROPERTY( double basicstep READ step WRITE setStep ) | |
| Q_PROPERTY( double minValue READ minValue WRITE setMinValue ) | | Q_PROPERTY( double minValue READ minValue WRITE setMinValue ) | |
| | | | |
End of changes. 8 change blocks. |
| 25 lines changed or deleted | | 16 lines changed or added | |
|
| qwt_global.h | | qwt_global.h | |
| | | | |
| skipping to change at line 17 | | skipping to change at line 17 | |
| * modify it under the terms of the Qwt License, Version 1.0 | | * modify it under the terms of the Qwt License, Version 1.0 | |
| **************************************************************************
***/ | | **************************************************************************
***/ | |
| | | | |
| #ifndef QWT_GLOBAL_H | | #ifndef QWT_GLOBAL_H | |
| #define QWT_GLOBAL_H | | #define QWT_GLOBAL_H | |
| | | | |
| #include <qglobal.h> | | #include <qglobal.h> | |
| | | | |
| // QWT_VERSION is (major << 16) + (minor << 8) + patch. | | // QWT_VERSION is (major << 16) + (minor << 8) + patch. | |
| | | | |
|
| #define QWT_VERSION 0x060001 | | #define QWT_VERSION 0x060002 | |
| #define QWT_VERSION_STR "6.0.1" | | #define QWT_VERSION_STR "6.0.2" | |
| | | | |
| #if defined(Q_WS_WIN) || defined(Q_WS_S60) | | | |
| | | | |
| #if defined(_MSC_VER) /* MSVC Compiler */ | | #if defined(_MSC_VER) /* MSVC Compiler */ | |
| /* template-class specialization 'identifier' is already instantiated */ | | /* template-class specialization 'identifier' is already instantiated */ | |
| #pragma warning(disable: 4660) | | #pragma warning(disable: 4660) | |
| #endif // _MSC_VER | | #endif // _MSC_VER | |
| | | | |
| #ifdef QWT_DLL | | #ifdef QWT_DLL | |
| | | | |
| #if defined(QWT_MAKEDLL) // create a Qwt DLL library | | #if defined(QWT_MAKEDLL) // create a Qwt DLL library | |
|
| #define QWT_EXPORT __declspec(dllexport) | | #define QWT_EXPORT Q_DECL_EXPORT | |
| #define QWT_TEMPLATEDLL | | | |
| #else // use a Qwt DLL library | | #else // use a Qwt DLL library | |
|
| #define QWT_EXPORT __declspec(dllimport) | | #define QWT_EXPORT Q_DECL_IMPORT | |
| #endif | | #endif | |
| | | | |
| #endif // QWT_DLL | | #endif // QWT_DLL | |
| | | | |
|
| #endif // Q_WS_WIN || Q_WS_S60 | | | |
| | | | |
| #ifndef QWT_EXPORT | | #ifndef QWT_EXPORT | |
| #define QWT_EXPORT | | #define QWT_EXPORT | |
| #endif | | #endif | |
| | | | |
| // #define QWT_NO_COMPAT 1 // disable withdrawn functionality | | // #define QWT_NO_COMPAT 1 // disable withdrawn functionality | |
| | | | |
| #endif | | #endif | |
| | | | |
End of changes. 4 change blocks. |
| 9 lines changed or deleted | | 4 lines changed or added | |
|
| qwt_interval.h | | qwt_interval.h | |
| | | | |
| skipping to change at line 202 | | skipping to change at line 202 | |
| return d_minValue; | | return d_minValue; | |
| } | | } | |
| | | | |
| //! \return Upper limit of the interval | | //! \return Upper limit of the interval | |
| inline double QwtInterval::maxValue() const | | inline double QwtInterval::maxValue() const | |
| { | | { | |
| return d_maxValue; | | return d_maxValue; | |
| } | | } | |
| | | | |
| /*! | | /*! | |
|
| | | A interval is valid when minValue() <= maxValue(). | |
| | | In case of QwtInterval::ExcludeBorders it is true | |
| | | when minValue() < maxValue() | |
| | | */ | |
| | | inline bool QwtInterval::isValid() const | |
| | | { | |
| | | if ( ( d_borderFlags & ExcludeBorders ) == 0 ) | |
| | | return d_minValue <= d_maxValue; | |
| | | else | |
| | | return d_minValue < d_maxValue; | |
| | | } | |
| | | | |
| | | /*! | |
| Return the width of an interval | | Return the width of an interval | |
| The width of invalid intervals is 0.0, otherwise the result is | | The width of invalid intervals is 0.0, otherwise the result is | |
| maxValue() - minValue(). | | maxValue() - minValue(). | |
| | | | |
| \sa isValid() | | \sa isValid() | |
| */ | | */ | |
| inline double QwtInterval::width() const | | inline double QwtInterval::width() const | |
| { | | { | |
| return isValid() ? ( d_maxValue - d_minValue ) : 0.0; | | return isValid() ? ( d_maxValue - d_minValue ) : 0.0; | |
| } | | } | |
| | | | |
| skipping to change at line 266 | | skipping to change at line 279 | |
| return extend( value ); | | return extend( value ); | |
| } | | } | |
| | | | |
| //! \return true, if isValid() && (minValue() >= maxValue()) | | //! \return true, if isValid() && (minValue() >= maxValue()) | |
| inline bool QwtInterval::isNull() const | | inline bool QwtInterval::isNull() const | |
| { | | { | |
| return isValid() && d_minValue >= d_maxValue; | | return isValid() && d_minValue >= d_maxValue; | |
| } | | } | |
| | | | |
| /*! | | /*! | |
|
| A interval is valid when minValue() <= maxValue(). | | | |
| In case of QwtInterval::ExcludeBorders it is true | | | |
| when minValue() < maxValue() | | | |
| */ | | | |
| inline bool QwtInterval::isValid() const | | | |
| { | | | |
| if ( ( d_borderFlags & ExcludeBorders ) == 0 ) | | | |
| return d_minValue <= d_maxValue; | | | |
| else | | | |
| return d_minValue < d_maxValue; | | | |
| } | | | |
| | | | |
| /*! | | | |
| Invalidate the interval | | Invalidate the interval | |
| | | | |
| The limits are set to interval [0.0, -1.0] | | The limits are set to interval [0.0, -1.0] | |
| \sa isValid() | | \sa isValid() | |
| */ | | */ | |
| inline void QwtInterval::invalidate() | | inline void QwtInterval::invalidate() | |
| { | | { | |
| d_minValue = 0.0; | | d_minValue = 0.0; | |
| d_maxValue = -1.0; | | d_maxValue = -1.0; | |
| } | | } | |
| | | | |
End of changes. 2 change blocks. |
| 13 lines changed or deleted | | 13 lines changed or added | |
|
| qwt_mathml_text_engine.h | | qwt_mathml_text_engine.h | |
| | | | |
| skipping to change at line 38 | | skipping to change at line 38 | |
| \sa QwtTextEngine, QwtText::setTextEngine | | \sa QwtTextEngine, QwtText::setTextEngine | |
| \warning Unfortunately the MathML renderer doesn't support rotating of te
xts. | | \warning Unfortunately the MathML renderer doesn't support rotating of te
xts. | |
| */ | | */ | |
| | | | |
| class QWT_EXPORT QwtMathMLTextEngine: public QwtTextEngine | | class QWT_EXPORT QwtMathMLTextEngine: public QwtTextEngine | |
| { | | { | |
| public: | | public: | |
| QwtMathMLTextEngine(); | | QwtMathMLTextEngine(); | |
| virtual ~QwtMathMLTextEngine(); | | virtual ~QwtMathMLTextEngine(); | |
| | | | |
|
| virtual double heightForWidth(const QFont &font, int flags, | | virtual double heightForWidth( const QFont &font, int flags, | |
| const QString &text, double width) const; | | const QString &text, double width ) const; | |
| | | | |
|
| virtual QSizeF textSize(const QFont &font, int flags, | | virtual QSizeF textSize( const QFont &font, int flags, | |
| const QString &text) const; | | const QString &text ) const; | |
| | | | |
|
| virtual void draw(QPainter *painter, const QRectF &rect, | | virtual void draw( QPainter *painter, const QRectF &rect, | |
| int flags, const QString &text) const; | | int flags, const QString &text ) const; | |
| | | | |
|
| virtual bool mightRender(const QString &) const; | | virtual bool mightRender( const QString & ) const; | |
| | | | |
|
| virtual void textMargins(const QFont &, const QString &, | | virtual void textMargins( const QFont &, const QString &, | |
| double &left, double &right, double &top, double &bottom) const; | | double &left, double &right, double &top, double &bottom ) const; | |
| }; | | }; | |
| | | | |
| #endif | | #endif | |
| | | | |
End of changes. 5 change blocks. |
| 9 lines changed or deleted | | 9 lines changed or added | |
|
| qwt_plot_canvas.h | | qwt_plot_canvas.h | |
| | | | |
| skipping to change at line 24 | | skipping to change at line 24 | |
| #include <qframe.h> | | #include <qframe.h> | |
| #include <qpen.h> | | #include <qpen.h> | |
| #include <qpainterpath.h> | | #include <qpainterpath.h> | |
| #include <qbitmap.h> | | #include <qbitmap.h> | |
| | | | |
| class QwtPlot; | | class QwtPlot; | |
| class QPixmap; | | class QPixmap; | |
| | | | |
| /*! | | /*! | |
| \brief Canvas of a QwtPlot. | | \brief Canvas of a QwtPlot. | |
|
| | | | |
| | | Canvas is the widget where all plot items are displayed | |
| | | | |
| \sa QwtPlot | | \sa QwtPlot | |
| */ | | */ | |
| class QWT_EXPORT QwtPlotCanvas : public QFrame | | class QWT_EXPORT QwtPlotCanvas : public QFrame | |
| { | | { | |
| Q_OBJECT | | Q_OBJECT | |
| | | | |
| public: | | public: | |
| | | | |
| /*! | | /*! | |
| \brief Paint attributes | | \brief Paint attributes | |
| | | | |
| skipping to change at line 102 | | skipping to change at line 105 | |
| \sa replot(), QWidget::repaint(), QWidget::update() | | \sa replot(), QWidget::repaint(), QWidget::update() | |
| */ | | */ | |
| ImmediatePaint = 8 | | ImmediatePaint = 8 | |
| }; | | }; | |
| | | | |
| //! Paint attributes | | //! Paint attributes | |
| typedef QFlags<PaintAttribute> PaintAttributes; | | typedef QFlags<PaintAttribute> PaintAttributes; | |
| | | | |
| /*! | | /*! | |
| \brief Focus indicator | | \brief Focus indicator | |
|
| | | The default setting is NoFocusIndicator | |
| - NoFocusIndicator\n | | | |
| Don't paint a focus indicator | | | |
| | | | |
| - CanvasFocusIndicator\n | | | |
| The focus is related to the complete canvas. | | | |
| Paint the focus indicator using paintFocus() | | | |
| | | | |
| - ItemFocusIndicator\n | | | |
| The focus is related to an item (curve, point, ...) on | | | |
| the canvas. It is up to the application to display a | | | |
| focus indication using f.e. highlighting. | | | |
| | | | |
| \sa setFocusIndicator(), focusIndicator(), paintFocus() | | \sa setFocusIndicator(), focusIndicator(), paintFocus() | |
| */ | | */ | |
| | | | |
| enum FocusIndicator | | enum FocusIndicator | |
| { | | { | |
|
| | | //! Don't paint a focus indicator | |
| NoFocusIndicator, | | NoFocusIndicator, | |
|
| | | | |
| | | /*! | |
| | | The focus is related to the complete canvas. | |
| | | Paint the focus indicator using paintFocus() | |
| | | */ | |
| CanvasFocusIndicator, | | CanvasFocusIndicator, | |
|
| | | | |
| | | /*! | |
| | | The focus is related to an item (curve, point, ...) on | |
| | | the canvas. It is up to the application to display a | |
| | | focus indication using f.e. highlighting. | |
| | | */ | |
| ItemFocusIndicator | | ItemFocusIndicator | |
| }; | | }; | |
| | | | |
| explicit QwtPlotCanvas( QwtPlot * ); | | explicit QwtPlotCanvas( QwtPlot * ); | |
| virtual ~QwtPlotCanvas(); | | virtual ~QwtPlotCanvas(); | |
| | | | |
| QwtPlot *plot(); | | QwtPlot *plot(); | |
| const QwtPlot *plot() const; | | const QwtPlot *plot() const; | |
| | | | |
| void setFocusIndicator( FocusIndicator ); | | void setFocusIndicator( FocusIndicator ); | |
| | | | |
End of changes. 5 change blocks. |
| 13 lines changed or deleted | | 16 lines changed or added | |
|
| qwt_plot_curve.h | | qwt_plot_curve.h | |
| | | | |
| skipping to change at line 255 | | skipping to change at line 255 | |
| const QwtScaleMap &xMap, const QwtScaleMap &yMap, | | const QwtScaleMap &xMap, const QwtScaleMap &yMap, | |
| const QRectF &canvasRect, int from, int to ) const; | | const QRectF &canvasRect, int from, int to ) const; | |
| | | | |
| virtual void updateLegend( QwtLegend * ) const; | | virtual void updateLegend( QwtLegend * ) const; | |
| virtual void drawLegendIdentifier( QPainter *, const QRectF & ) const; | | virtual void drawLegendIdentifier( QPainter *, const QRectF & ) const; | |
| | | | |
| protected: | | protected: | |
| | | | |
| void init(); | | void init(); | |
| | | | |
|
| virtual void drawCurve( QPainter *p, int style, | | virtual void drawCurve( QPainter *, int style, | |
| const QwtScaleMap &xMap, const QwtScaleMap &yMap, | | const QwtScaleMap &xMap, const QwtScaleMap &yMap, | |
| const QRectF &canvasRect, int from, int to ) const; | | const QRectF &canvasRect, int from, int to ) const; | |
| | | | |
|
| virtual void drawSymbols( QPainter *p, const QwtSymbol &, | | virtual void drawSymbols( QPainter *, const QwtSymbol &, | |
| const QwtScaleMap &xMap, const QwtScaleMap &yMap, | | const QwtScaleMap &xMap, const QwtScaleMap &yMap, | |
| const QRectF &canvasRect, int from, int to ) const; | | const QRectF &canvasRect, int from, int to ) const; | |
| | | | |
|
| void drawLines( QPainter *p, | | void drawLines( QPainter *, | |
| const QwtScaleMap &xMap, const QwtScaleMap &yMap, | | const QwtScaleMap &xMap, const QwtScaleMap &yMap, | |
| const QRectF &canvasRect, int from, int to ) const; | | const QRectF &canvasRect, int from, int to ) const; | |
| | | | |
|
| void drawSticks( QPainter *p, | | void drawSticks( QPainter *, | |
| const QwtScaleMap &xMap, const QwtScaleMap &yMap, | | const QwtScaleMap &xMap, const QwtScaleMap &yMap, | |
| const QRectF &canvasRect, int from, int to ) const; | | const QRectF &canvasRect, int from, int to ) const; | |
| | | | |
|
| void drawDots( QPainter *p, | | void drawDots( QPainter *, | |
| const QwtScaleMap &xMap, const QwtScaleMap &yMap, | | const QwtScaleMap &xMap, const QwtScaleMap &yMap, | |
| const QRectF &canvasRect, int from, int to ) const; | | const QRectF &canvasRect, int from, int to ) const; | |
| | | | |
|
| void drawSteps( QPainter *p, | | void drawSteps( QPainter *, | |
| const QwtScaleMap &xMap, const QwtScaleMap &yMap, | | const QwtScaleMap &xMap, const QwtScaleMap &yMap, | |
| const QRectF &canvasRect, int from, int to ) const; | | const QRectF &canvasRect, int from, int to ) const; | |
| | | | |
| virtual void fillCurve( QPainter *, | | virtual void fillCurve( QPainter *, | |
| const QwtScaleMap &, const QwtScaleMap &, | | const QwtScaleMap &, const QwtScaleMap &, | |
| const QRectF &canvasRect, QPolygonF & ) const; | | const QRectF &canvasRect, QPolygonF & ) const; | |
| | | | |
| void closePolyline( QPainter *, | | void closePolyline( QPainter *, | |
| const QwtScaleMap &, const QwtScaleMap &, QPolygonF & ) const; | | const QwtScaleMap &, const QwtScaleMap &, QPolygonF & ) const; | |
| | | | |
| | | | |
End of changes. 6 change blocks. |
| 6 lines changed or deleted | | 6 lines changed or added | |
|
| qwt_plot_renderer.h | | qwt_plot_renderer.h | |
| | | | |
| skipping to change at line 73 | | skipping to change at line 73 | |
| | | | |
| /*! | | /*! | |
| \brief Layout flags | | \brief Layout flags | |
| \sa setLayoutFlag(), testLayoutFlag() | | \sa setLayoutFlag(), testLayoutFlag() | |
| */ | | */ | |
| enum LayoutFlag | | enum LayoutFlag | |
| { | | { | |
| //! Use the default layout without margins and frames | | //! Use the default layout without margins and frames | |
| DefaultLayout = 0x00, | | DefaultLayout = 0x00, | |
| | | | |
|
| //! Render all frames of the plot | | /*! | |
| | | Render all frames of the plot | |
| | | \note Not supported yet | |
| | | */ | |
| KeepFrames = 0x01, | | KeepFrames = 0x01, | |
| | | | |
| /*! | | /*! | |
| Instead of the scales a box is painted around the plot canvas, | | Instead of the scales a box is painted around the plot canvas, | |
| where the scale ticks are aligned to. | | where the scale ticks are aligned to. | |
| */ | | */ | |
| FrameWithScales = 0x02 | | FrameWithScales = 0x02 | |
| }; | | }; | |
| | | | |
| //! Layout flags | | //! Layout flags | |
| | | | |
| skipping to change at line 101 | | skipping to change at line 104 | |
| | | | |
| void setDiscardFlags( DiscardFlags flags ); | | void setDiscardFlags( DiscardFlags flags ); | |
| DiscardFlags discardFlags() const; | | DiscardFlags discardFlags() const; | |
| | | | |
| void setLayoutFlag( LayoutFlag flag, bool on = true ); | | void setLayoutFlag( LayoutFlag flag, bool on = true ); | |
| bool testLayoutFlag( LayoutFlag flag ) const; | | bool testLayoutFlag( LayoutFlag flag ) const; | |
| | | | |
| void setLayoutFlags( LayoutFlags flags ); | | void setLayoutFlags( LayoutFlags flags ); | |
| LayoutFlags layoutFlags() const; | | LayoutFlags layoutFlags() const; | |
| | | | |
|
| void renderDocument( QwtPlot *, const QString &format, | | void renderDocument( QwtPlot *, const QString &fileName, | |
| const QSizeF &sizeMM, int resolution = 85 ); | | const QSizeF &sizeMM, int resolution = 85 ); | |
| | | | |
| void renderDocument( QwtPlot *, | | void renderDocument( QwtPlot *, | |
|
| const QString &title, const QString &format, | | const QString &fileName, const QString &format, | |
| const QSizeF &sizeMM, int resolution = 85 ); | | const QSizeF &sizeMM, int resolution = 85 ); | |
| | | | |
| #ifndef QWT_NO_SVG | | #ifndef QWT_NO_SVG | |
| #ifdef QT_SVG_LIB | | #ifdef QT_SVG_LIB | |
| #if QT_VERSION >= 0x040500 | | #if QT_VERSION >= 0x040500 | |
| void renderTo( QwtPlot *, QSvgGenerator & ) const; | | void renderTo( QwtPlot *, QSvgGenerator & ) const; | |
| #endif | | #endif | |
| #endif | | #endif | |
| #endif | | #endif | |
| | | | |
| | | | |
End of changes. 3 change blocks. |
| 3 lines changed or deleted | | 6 lines changed or added | |
|
| qwt_plot_seriesitem.h | | qwt_plot_seriesitem.h | |
| | | | |
| skipping to change at line 63 | | skipping to change at line 63 | |
| PrivateData *d_data; | | PrivateData *d_data; | |
| }; | | }; | |
| | | | |
| /*! | | /*! | |
| \brief Class template for plot items representing a series of samples | | \brief Class template for plot items representing a series of samples | |
| */ | | */ | |
| template <typename T> | | template <typename T> | |
| class QwtPlotSeriesItem: public QwtPlotAbstractSeriesItem | | class QwtPlotSeriesItem: public QwtPlotAbstractSeriesItem | |
| { | | { | |
| public: | | public: | |
|
| | | /*! | |
| | | Constructor | |
| | | \param title Title of the series item | |
| | | */ | |
| explicit QwtPlotSeriesItem<T>( const QString &title = QString::null ); | | explicit QwtPlotSeriesItem<T>( const QString &title = QString::null ); | |
|
| | | | |
| | | /*! | |
| | | Constructor | |
| | | \param title Title of the series item | |
| | | */ | |
| explicit QwtPlotSeriesItem<T>( const QwtText &title ); | | explicit QwtPlotSeriesItem<T>( const QwtText &title ); | |
| | | | |
|
| | | //! Destructor | |
| virtual ~QwtPlotSeriesItem<T>(); | | virtual ~QwtPlotSeriesItem<T>(); | |
| | | | |
|
| | | /*! | |
| | | Assign a series of samples | |
| | | | |
| | | \param data Data | |
| | | \warning The item takes ownership of the data object, deleting | |
| | | it when its not used anymore. | |
| | | */ | |
| void setData( QwtSeriesData<T> * ); | | void setData( QwtSeriesData<T> * ); | |
| | | | |
|
| | | //! \return the the curve data | |
| QwtSeriesData<T> *data(); | | QwtSeriesData<T> *data(); | |
|
| | | | |
| | | //! \return the the curve data | |
| const QwtSeriesData<T> *data() const; | | const QwtSeriesData<T> *data() const; | |
| | | | |
|
| | | /*! | |
| | | Return the size of the data arrays | |
| | | \sa setData() | |
| | | */ | |
| size_t dataSize() const; | | size_t dataSize() const; | |
|
| | | | |
| | | /*! | |
| | | \param index Index | |
| | | \return Sample at position index | |
| | | */ | |
| T sample( int index ) const; | | T sample( int index ) const; | |
| | | | |
|
| | | /*! | |
| | | \return Bounding rectangle of the data. | |
| | | If there is no bounding rect, like for empty data the rectangle is in | |
| | | valid. | |
| | | | |
| | | \sa QwtSeriesData<T>::boundingRect(), QRectF::isValid() | |
| | | */ | |
| virtual QRectF boundingRect() const; | | virtual QRectF boundingRect() const; | |
|
| | | | |
| | | /*! | |
| | | Update the rect of interest according to the current scale ranges | |
| | | | |
| | | \param xScaleDiv Scale division of the x-axis | |
| | | \param yScaleDiv Scale division of the y-axis | |
| | | | |
| | | \sa QwtSeriesData<T>::setRectOfInterest() | |
| | | */ | |
| virtual void updateScaleDiv( const QwtScaleDiv &, | | virtual void updateScaleDiv( const QwtScaleDiv &, | |
| const QwtScaleDiv & ); | | const QwtScaleDiv & ); | |
| | | | |
| protected: | | protected: | |
| //! Series | | //! Series | |
| QwtSeriesData<T> *d_series; | | QwtSeriesData<T> *d_series; | |
| }; | | }; | |
| | | | |
|
| /*! | | | |
| Constructor | | | |
| \param title Title of the series item | | | |
| */ | | | |
| template <typename T> | | template <typename T> | |
| QwtPlotSeriesItem<T>::QwtPlotSeriesItem( const QString &title ): | | QwtPlotSeriesItem<T>::QwtPlotSeriesItem( const QString &title ): | |
| QwtPlotAbstractSeriesItem( QwtText( title ) ), | | QwtPlotAbstractSeriesItem( QwtText( title ) ), | |
| d_series( NULL ) | | d_series( NULL ) | |
| { | | { | |
| } | | } | |
| | | | |
|
| /*! | | | |
| Constructor | | | |
| \param title Title of the series item | | | |
| */ | | | |
| template <typename T> | | template <typename T> | |
| QwtPlotSeriesItem<T>::QwtPlotSeriesItem( const QwtText &title ): | | QwtPlotSeriesItem<T>::QwtPlotSeriesItem( const QwtText &title ): | |
| QwtPlotAbstractSeriesItem( title ), | | QwtPlotAbstractSeriesItem( title ), | |
| d_series( NULL ) | | d_series( NULL ) | |
| { | | { | |
| } | | } | |
| | | | |
|
| //! Destructor | | | |
| template <typename T> | | template <typename T> | |
| QwtPlotSeriesItem<T>::~QwtPlotSeriesItem() | | QwtPlotSeriesItem<T>::~QwtPlotSeriesItem() | |
| { | | { | |
| delete d_series; | | delete d_series; | |
| } | | } | |
| | | | |
|
| //! \return the the curve data | | | |
| template <typename T> | | template <typename T> | |
| inline QwtSeriesData<T> *QwtPlotSeriesItem<T>::data() | | inline QwtSeriesData<T> *QwtPlotSeriesItem<T>::data() | |
| { | | { | |
| return d_series; | | return d_series; | |
| } | | } | |
| | | | |
|
| //! \return the the curve data | | | |
| template <typename T> | | template <typename T> | |
| inline const QwtSeriesData<T> *QwtPlotSeriesItem<T>::data() const | | inline const QwtSeriesData<T> *QwtPlotSeriesItem<T>::data() const | |
| { | | { | |
| return d_series; | | return d_series; | |
| } | | } | |
| | | | |
|
| /*! | | | |
| \param index Index | | | |
| \return Sample at position index | | | |
| */ | | | |
| template <typename T> | | template <typename T> | |
| inline T QwtPlotSeriesItem<T>::sample( int index ) const | | inline T QwtPlotSeriesItem<T>::sample( int index ) const | |
| { | | { | |
| return d_series ? d_series->sample( index ) : T(); | | return d_series ? d_series->sample( index ) : T(); | |
| } | | } | |
| | | | |
|
| /*! | | | |
| Assign a series of samples | | | |
| | | | |
| \param data Data | | | |
| \warning The item takes ownership of the data object, deleting | | | |
| it when its not used anymore. | | | |
| */ | | | |
| template <typename T> | | template <typename T> | |
| void QwtPlotSeriesItem<T>::setData( QwtSeriesData<T> *data ) | | void QwtPlotSeriesItem<T>::setData( QwtSeriesData<T> *data ) | |
| { | | { | |
| if ( d_series != data ) | | if ( d_series != data ) | |
| { | | { | |
| delete d_series; | | delete d_series; | |
| d_series = data; | | d_series = data; | |
| itemChanged(); | | itemChanged(); | |
| } | | } | |
| } | | } | |
| | | | |
|
| /*! | | | |
| Return the size of the data arrays | | | |
| \sa setData() | | | |
| */ | | | |
| template <typename T> | | template <typename T> | |
| size_t QwtPlotSeriesItem<T>::dataSize() const | | size_t QwtPlotSeriesItem<T>::dataSize() const | |
| { | | { | |
| if ( d_series == NULL ) | | if ( d_series == NULL ) | |
| return 0; | | return 0; | |
| | | | |
| return d_series->size(); | | return d_series->size(); | |
| } | | } | |
| | | | |
|
| /*! | | | |
| \return Bounding rectangle of the data. | | | |
| If there is no bounding rect, like for empty data the rectangle is invali | | | |
| d. | | | |
| | | | |
| \sa QwtSeriesData<T>::boundingRect(), QRectF::isValid() | | | |
| */ | | | |
| template <typename T> | | template <typename T> | |
| QRectF QwtPlotSeriesItem<T>::boundingRect() const | | QRectF QwtPlotSeriesItem<T>::boundingRect() const | |
| { | | { | |
| if ( d_series == NULL ) | | if ( d_series == NULL ) | |
| return QRectF( 1.0, 1.0, -2.0, -2.0 ); // invalid | | return QRectF( 1.0, 1.0, -2.0, -2.0 ); // invalid | |
| | | | |
| return d_series->boundingRect(); | | return d_series->boundingRect(); | |
| } | | } | |
| | | | |
|
| /*! | | | |
| Update the rect of interest according to the current scale ranges | | | |
| | | | |
| \param xScaleDiv Scale division of the x-axis | | | |
| \param yScaleDiv Scale division of the y-axis | | | |
| | | | |
| \sa QwtSeriesData<T>::setRectOfInterest() | | | |
| */ | | | |
| template <typename T> | | template <typename T> | |
| void QwtPlotSeriesItem<T>::updateScaleDiv( | | void QwtPlotSeriesItem<T>::updateScaleDiv( | |
| const QwtScaleDiv &xScaleDiv, const QwtScaleDiv &yScaleDiv ) | | const QwtScaleDiv &xScaleDiv, const QwtScaleDiv &yScaleDiv ) | |
| { | | { | |
|
| const QRectF rect = QRectF( | | if ( d_series ) | |
| xScaleDiv.lowerBound(), yScaleDiv.lowerBound(), | | { | |
| xScaleDiv.range(), yScaleDiv.range() ); | | const QRectF rect = QRectF( | |
| | | xScaleDiv.lowerBound(), yScaleDiv.lowerBound(), | |
| | | xScaleDiv.range(), yScaleDiv.range() ); | |
| | | | |
|
| d_series->setRectOfInterest( rect ); | | d_series->setRectOfInterest( rect ); | |
| | | } | |
| } | | } | |
| | | | |
| #endif | | #endif | |
| | | | |
End of changes. 22 change blocks. |
| 45 lines changed or deleted | | 52 lines changed or added | |
|
| qwt_scale_map.h | | qwt_scale_map.h | |
| | | | |
| skipping to change at line 47 | | skipping to change at line 47 | |
| //! Transformation between a linear and a logarithmic ( base 10 ) s
cale | | //! Transformation between a linear and a logarithmic ( base 10 ) s
cale | |
| Log10, | | Log10, | |
| | | | |
| //! Any other type of transformation | | //! Any other type of transformation | |
| Other | | Other | |
| }; | | }; | |
| | | | |
| QwtScaleTransformation( Type type ); | | QwtScaleTransformation( Type type ); | |
| virtual ~QwtScaleTransformation(); | | virtual ~QwtScaleTransformation(); | |
| | | | |
|
| virtual double xForm( double x, double s1, double s2, | | virtual double xForm( double s, double s1, double s2, | |
| double p1, double p2 ) const; | | double p1, double p2 ) const; | |
|
| virtual double invXForm( double x, double p1, double p2, | | virtual double invXForm( double p, double p1, double p2, | |
| double s1, double s2 ) const; | | double s1, double s2 ) const; | |
| | | | |
| Type type() const; | | Type type() const; | |
| | | | |
| virtual QwtScaleTransformation *copy() const; | | virtual QwtScaleTransformation *copy() const; | |
| | | | |
| private: | | private: | |
| QwtScaleTransformation(); | | QwtScaleTransformation(); | |
| QwtScaleTransformation &operator=( const QwtScaleTransformation ); | | QwtScaleTransformation &operator=( const QwtScaleTransformation ); | |
| | | | |
| | | | |
End of changes. 2 change blocks. |
| 2 lines changed or deleted | | 2 lines changed or added | |
|
| qwt_series_data.h | | qwt_series_data.h | |
| | | | |
| skipping to change at line 120 | | skipping to change at line 120 | |
| return !( *this == other ); | | return !( *this == other ); | |
| } | | } | |
| | | | |
| /*! | | /*! | |
| \brief Abstract interface for iterating over samples | | \brief Abstract interface for iterating over samples | |
| | | | |
| Qwt offers several implementations of the QwtSeriesData API, | | Qwt offers several implementations of the QwtSeriesData API, | |
| but in situations, where data of an application specific format | | but in situations, where data of an application specific format | |
| needs to be displayed, without having to copy it, it is recommended | | needs to be displayed, without having to copy it, it is recommended | |
| to implement an individual data access. | | to implement an individual data access. | |
|
| | | | |
| | | A subclass of QwtSeriesData<QPointF> must implement: | |
| | | | |
| | | - size()\n | |
| | | Should return number of data points. | |
| | | | |
| | | - sample()\n | |
| | | Should return values x and y values of the sample at specific position | |
| | | as QPointF object. | |
| | | | |
| | | - boundingRect()\n | |
| | | Should return the bounding rectangle of the data series. | |
| | | It is used for autoscaling and might help certain algorithms for displ | |
| | | aying | |
| | | the data. You can use qwtBoundingRect() for an implementation | |
| | | but often it is possible to implement a more efficient alogrithm | |
| | | depending on the characteristics of the series. | |
| | | The member d_boundingRect is intended for caching the calculated recta | |
| | | ngle. | |
| | | | |
| */ | | */ | |
| template <typename T> | | template <typename T> | |
| class QwtSeriesData | | class QwtSeriesData | |
| { | | { | |
| public: | | public: | |
|
| | | //! Constructor | |
| QwtSeriesData(); | | QwtSeriesData(); | |
|
| | | | |
| | | //! Destructor | |
| virtual ~QwtSeriesData(); | | virtual ~QwtSeriesData(); | |
| | | | |
| //! \return Number of samples | | //! \return Number of samples | |
| virtual size_t size() const = 0; | | virtual size_t size() const = 0; | |
| | | | |
| /*! | | /*! | |
| Return a sample | | Return a sample | |
| \param i Index | | \param i Index | |
| \return Sample at position i | | \return Sample at position i | |
| */ | | */ | |
| | | | |
| skipping to change at line 150 | | skipping to change at line 171 | |
| | | | |
| The bounding rect is necessary for autoscaling and can be used | | The bounding rect is necessary for autoscaling and can be used | |
| for a couple of painting optimizations. | | for a couple of painting optimizations. | |
| | | | |
| qwtBoundingRect(...) offers slow implementations iterating | | qwtBoundingRect(...) offers slow implementations iterating | |
| over the samples. For large sets it is recommended to implement | | over the samples. For large sets it is recommended to implement | |
| something faster f.e. by caching the bounding rect. | | something faster f.e. by caching the bounding rect. | |
| */ | | */ | |
| virtual QRectF boundingRect() const = 0; | | virtual QRectF boundingRect() const = 0; | |
| | | | |
|
| virtual void setRectOfInterest( const QRectF & ); | | /*! | |
| | | Set a the "rect of interest" | |
| | | | |
| | | QwtPlotSeriesItem defines the current area of the plot canvas | |
| | | as "rect of interest" ( QwtPlotSeriesItem::updateScaleDiv() ). | |
| | | It can be used to implement different levels of details. | |
| | | | |
| | | The default implementation does nothing. | |
| | | | |
| | | \param rect Rectangle of interest | |
| | | */ | |
| | | virtual void setRectOfInterest( const QRectF &rect ); | |
| | | | |
| protected: | | protected: | |
| //! Can be used to cache a calculated bounding rectangle | | //! Can be used to cache a calculated bounding rectangle | |
| mutable QRectF d_boundingRect; | | mutable QRectF d_boundingRect; | |
| | | | |
| private: | | private: | |
| QwtSeriesData<T> &operator=( const QwtSeriesData<T> & ); | | QwtSeriesData<T> &operator=( const QwtSeriesData<T> & ); | |
| }; | | }; | |
| | | | |
|
| //! Constructor | | | |
| template <typename T> | | template <typename T> | |
| QwtSeriesData<T>::QwtSeriesData(): | | QwtSeriesData<T>::QwtSeriesData(): | |
| d_boundingRect( 0.0, 0.0, -1.0, -1.0 ) | | d_boundingRect( 0.0, 0.0, -1.0, -1.0 ) | |
| { | | { | |
| } | | } | |
| | | | |
|
| //! Destructor | | | |
| template <typename T> | | template <typename T> | |
| QwtSeriesData<T>::~QwtSeriesData() | | QwtSeriesData<T>::~QwtSeriesData() | |
| { | | { | |
| } | | } | |
| | | | |
|
| /*! | | | |
| Set a the "rect of interest" | | | |
| | | | |
| QwtPlotSeriesItem defines the current area of the plot canvas | | | |
| as "rect of interest" ( QwtPlotSeriesItem::updateScaleDiv() ). | | | |
| It can be used to implement different levels of details. | | | |
| | | | |
| The default implementation does nothing. | | | |
| */ | | | |
| template <typename T> | | template <typename T> | |
| void QwtSeriesData<T>::setRectOfInterest( const QRectF & ) | | void QwtSeriesData<T>::setRectOfInterest( const QRectF & ) | |
| { | | { | |
| } | | } | |
| | | | |
| /*! | | /*! | |
| \brief Template class for data, that is organized as QVector | | \brief Template class for data, that is organized as QVector | |
| | | | |
| QVector uses implicit data sharing and can be | | QVector uses implicit data sharing and can be | |
| passed around as argument efficiently. | | passed around as argument efficiently. | |
| */ | | */ | |
| template <typename T> | | template <typename T> | |
| class QwtArraySeriesData: public QwtSeriesData<T> | | class QwtArraySeriesData: public QwtSeriesData<T> | |
| { | | { | |
| public: | | public: | |
|
| | | //! Constructor | |
| QwtArraySeriesData(); | | QwtArraySeriesData(); | |
|
| QwtArraySeriesData( const QVector<T> & ); | | | |
| | | | |
|
| void setSamples( const QVector<T> & ); | | /*! | |
| | | Constructor | |
| | | \param samples Array of samples | |
| | | */ | |
| | | QwtArraySeriesData( const QVector<T> &samples ); | |
| | | | |
| | | /*! | |
| | | Assign an array of samples | |
| | | \param samples Array of samples | |
| | | */ | |
| | | void setSamples( const QVector<T> &samples ); | |
| | | | |
| | | //! \return Array of samples | |
| const QVector<T> samples() const; | | const QVector<T> samples() const; | |
| | | | |
|
| | | //! \return Number of samples | |
| virtual size_t size() const; | | virtual size_t size() const; | |
|
| virtual T sample( size_t ) const; | | | |
| | | /*! | |
| | | \return Sample at a specific position | |
| | | | |
| | | \param index Index | |
| | | \return Sample at position i | |
| | | */ | |
| | | virtual T sample( size_t index ) const; | |
| | | | |
| protected: | | protected: | |
| //! Vector of samples | | //! Vector of samples | |
| QVector<T> d_samples; | | QVector<T> d_samples; | |
| }; | | }; | |
| | | | |
|
| //! Constructor | | | |
| template <typename T> | | template <typename T> | |
| QwtArraySeriesData<T>::QwtArraySeriesData() | | QwtArraySeriesData<T>::QwtArraySeriesData() | |
| { | | { | |
| } | | } | |
| | | | |
|
| /*! | | | |
| Constructor | | | |
| \param samples Array of samples | | | |
| */ | | | |
| template <typename T> | | template <typename T> | |
| QwtArraySeriesData<T>::QwtArraySeriesData( const QVector<T> &samples ): | | QwtArraySeriesData<T>::QwtArraySeriesData( const QVector<T> &samples ): | |
| d_samples( samples ) | | d_samples( samples ) | |
| { | | { | |
| } | | } | |
| | | | |
|
| /*! | | | |
| Assign an array of samples | | | |
| \param samples Array of samples | | | |
| */ | | | |
| template <typename T> | | template <typename T> | |
| void QwtArraySeriesData<T>::setSamples( const QVector<T> &samples ) | | void QwtArraySeriesData<T>::setSamples( const QVector<T> &samples ) | |
| { | | { | |
| QwtSeriesData<T>::d_boundingRect = QRectF( 0.0, 0.0, -1.0, -1.0 ); | | QwtSeriesData<T>::d_boundingRect = QRectF( 0.0, 0.0, -1.0, -1.0 ); | |
| d_samples = samples; | | d_samples = samples; | |
| } | | } | |
| | | | |
|
| //! \return Array of samples | | | |
| template <typename T> | | template <typename T> | |
| const QVector<T> QwtArraySeriesData<T>::samples() const | | const QVector<T> QwtArraySeriesData<T>::samples() const | |
| { | | { | |
| return d_samples; | | return d_samples; | |
| } | | } | |
| | | | |
|
| //! \return Number of samples | | | |
| template <typename T> | | template <typename T> | |
| size_t QwtArraySeriesData<T>::size() const | | size_t QwtArraySeriesData<T>::size() const | |
| { | | { | |
| return d_samples.size(); | | return d_samples.size(); | |
| } | | } | |
| | | | |
|
| /*! | | | |
| Return a sample | | | |
| \param i Index | | | |
| \return Sample at position i | | | |
| */ | | | |
| template <typename T> | | template <typename T> | |
| T QwtArraySeriesData<T>::sample( size_t i ) const | | T QwtArraySeriesData<T>::sample( size_t i ) const | |
| { | | { | |
|
| return d_samples[i]; | | return d_samples[ static_cast<int>( i ) ]; | |
| } | | } | |
| | | | |
| //! Interface for iterating over an array of points | | //! Interface for iterating over an array of points | |
| class QWT_EXPORT QwtPointSeriesData: public QwtArraySeriesData<QPointF> | | class QWT_EXPORT QwtPointSeriesData: public QwtArraySeriesData<QPointF> | |
| { | | { | |
| public: | | public: | |
| QwtPointSeriesData( | | QwtPointSeriesData( | |
| const QVector<QPointF> & = QVector<QPointF>() ); | | const QVector<QPointF> & = QVector<QPointF>() ); | |
| | | | |
| virtual QRectF boundingRect() const; | | virtual QRectF boundingRect() const; | |
| | | | |
End of changes. 19 change blocks. |
| 32 lines changed or deleted | | 59 lines changed or added | |
|