| qwt_compass_rose.h | | qwt_compass_rose.h | |
| | | | |
| skipping to change at line 26 | | skipping to change at line 26 | |
| class QPainter; | | class QPainter; | |
| | | | |
| /*! | | /*! | |
| \brief Abstract base class for a compass rose | | \brief Abstract base class for a compass rose | |
| */ | | */ | |
| class QWT_EXPORT QwtCompassRose | | class QWT_EXPORT QwtCompassRose | |
| { | | { | |
| public: | | public: | |
| virtual ~QwtCompassRose() {}; | | virtual ~QwtCompassRose() {}; | |
| | | | |
|
| | | //! Assign a palette | |
| virtual void setPalette(const QPalette &p) { d_palette = p; } | | virtual void setPalette(const QPalette &p) { d_palette = p; } | |
|
| | | | |
| | | //! \return Current palette | |
| const QPalette &palette() const { return d_palette; } | | const QPalette &palette() const { return d_palette; } | |
| | | | |
| /*! | | /*! | |
| Draw the rose | | Draw the rose | |
| | | | |
| \param painter Painter | | \param painter Painter | |
| \param center Center point | | \param center Center point | |
| \param radius Radius of the rose | | \param radius Radius of the rose | |
| \param north Position | | \param north Position | |
| \param colorGroup Color group | | \param colorGroup Color group | |
| | | | |
| skipping to change at line 55 | | skipping to change at line 58 | |
| | | | |
| /*! | | /*! | |
| \brief A simple rose for QwtCompass | | \brief A simple rose for QwtCompass | |
| */ | | */ | |
| class QWT_EXPORT QwtSimpleCompassRose: public QwtCompassRose | | class QWT_EXPORT QwtSimpleCompassRose: public QwtCompassRose | |
| { | | { | |
| public: | | public: | |
| QwtSimpleCompassRose(int numThorns = 8, int numThornLevels = -1); | | QwtSimpleCompassRose(int numThorns = 8, int numThornLevels = -1); | |
| | | | |
| void setWidth(double w); | | void setWidth(double w); | |
|
| | | | |
| | | //! \sa setWidth() | |
| double width() const { return d_width; } | | double width() const { return d_width; } | |
| | | | |
| void setNumThorns(int count); | | void setNumThorns(int count); | |
| int numThorns() const; | | int numThorns() const; | |
| | | | |
| void setNumThornLevels(int count); | | void setNumThornLevels(int count); | |
| int numThornLevels() const; | | int numThornLevels() const; | |
| | | | |
| void setShrinkFactor(double factor) { d_shrinkFactor = factor; } | | void setShrinkFactor(double factor) { d_shrinkFactor = factor; } | |
| double shrinkFactor() const { return d_shrinkFactor; } | | double shrinkFactor() const { return d_shrinkFactor; } | |
| | | | |
End of changes. 3 change blocks. |
| 0 lines changed or deleted | | 5 lines changed or added | |
|
| qwt_dial.h | | qwt_dial.h | |
| | | | |
| skipping to change at line 73 | | skipping to change at line 73 | |
| \sa QwtCompass, QwtAnalogClock, QwtDialNeedle | | \sa QwtCompass, QwtAnalogClock, QwtDialNeedle | |
| \note The examples/dials example shows different types of dials. | | \note The examples/dials example shows different types of dials. | |
| */ | | */ | |
| | | | |
| class QWT_EXPORT QwtDial: public QwtAbstractSlider | | class QWT_EXPORT QwtDial: public QwtAbstractSlider | |
| { | | { | |
| Q_OBJECT | | Q_OBJECT | |
| | | | |
| Q_ENUMS(Shadow) | | Q_ENUMS(Shadow) | |
| Q_ENUMS(Mode) | | Q_ENUMS(Mode) | |
|
| | | Q_ENUMS(Direction) | |
| | | | |
| Q_PROPERTY(bool visibleBackground READ hasVisibleBackground WRITE showB
ackground) | | Q_PROPERTY(bool visibleBackground READ hasVisibleBackground WRITE showB
ackground) | |
| Q_PROPERTY(int lineWidth READ lineWidth WRITE setLineWidth) | | Q_PROPERTY(int lineWidth READ lineWidth WRITE setLineWidth) | |
| Q_PROPERTY(Shadow frameShadow READ frameShadow WRITE setFrameShadow) | | Q_PROPERTY(Shadow frameShadow READ frameShadow WRITE setFrameShadow) | |
| Q_PROPERTY(Mode mode READ mode WRITE setMode) | | Q_PROPERTY(Mode mode READ mode WRITE setMode) | |
| Q_PROPERTY(double origin READ origin WRITE setOrigin) | | Q_PROPERTY(double origin READ origin WRITE setOrigin) | |
| Q_PROPERTY(bool wrapping READ wrapping WRITE setWrapping) | | Q_PROPERTY(bool wrapping READ wrapping WRITE setWrapping) | |
|
| | | Q_PROPERTY(Direction direction READ direction WRITE setDirection) | |
| | | | |
| friend class QwtDialScaleDraw; | | friend class QwtDialScaleDraw; | |
| public: | | public: | |
| | | | |
| /*! | | /*! | |
| \brief Frame shadow | | \brief Frame shadow | |
| | | | |
| Unfortunately it is not possible to use QFrame::Shadow | | Unfortunately it is not possible to use QFrame::Shadow | |
| as a property of a widget that is not derived from QFrame. | | as a property of a widget that is not derived from QFrame. | |
| The following enum is made for the designer only. It is safe | | The following enum is made for the designer only. It is safe | |
| | | | |
| skipping to change at line 118 | | skipping to change at line 120 | |
| In case of RotateNeedle the needle is rotating, in case of | | In case of RotateNeedle the needle is rotating, in case of | |
| RotateScale, the needle points to origin() | | RotateScale, the needle points to origin() | |
| and the scale is rotating. | | and the scale is rotating. | |
| */ | | */ | |
| enum Mode | | enum Mode | |
| { | | { | |
| RotateNeedle, | | RotateNeedle, | |
| RotateScale | | RotateScale | |
| }; | | }; | |
| | | | |
|
| | | /*! | |
| | | Direction of the dial | |
| | | */ | |
| | | enum Direction | |
| | | { | |
| | | Clockwise, | |
| | | CounterClockwise | |
| | | }; | |
| | | | |
| explicit QwtDial( QWidget *parent = NULL); | | explicit QwtDial( QWidget *parent = NULL); | |
| #if QT_VERSION < 0x040000 | | #if QT_VERSION < 0x040000 | |
| explicit QwtDial( QWidget *parent, const char *name); | | explicit QwtDial( QWidget *parent, const char *name); | |
| #endif | | #endif | |
| | | | |
| virtual ~QwtDial(); | | virtual ~QwtDial(); | |
| | | | |
| void setFrameShadow(Shadow); | | void setFrameShadow(Shadow); | |
| Shadow frameShadow() const; | | Shadow frameShadow() const; | |
| | | | |
| | | | |
| skipping to change at line 152 | | skipping to change at line 163 | |
| void setScaleArc(double min, double max); | | void setScaleArc(double min, double max); | |
| void setScaleOptions(int); | | void setScaleOptions(int); | |
| void setScaleTicks(int minLen, int medLen, int majLen, int penWidth = 1
); | | void setScaleTicks(int minLen, int medLen, int majLen, int penWidth = 1
); | |
| | | | |
| double minScaleArc() const; | | double minScaleArc() const; | |
| double maxScaleArc() const; | | double maxScaleArc() const; | |
| | | | |
| virtual void setOrigin(double); | | virtual void setOrigin(double); | |
| double origin() const; | | double origin() const; | |
| | | | |
|
| | | void setDirection(Direction); | |
| | | Direction direction() const; | |
| | | | |
| virtual void setNeedle(QwtDialNeedle *); | | virtual void setNeedle(QwtDialNeedle *); | |
| const QwtDialNeedle *needle() const; | | const QwtDialNeedle *needle() const; | |
| QwtDialNeedle *needle(); | | QwtDialNeedle *needle(); | |
| | | | |
| QRect boundingRect() const; | | QRect boundingRect() const; | |
| QRect contentsRect() const; | | QRect contentsRect() const; | |
| virtual QRect scaleContentsRect() const; | | virtual QRect scaleContentsRect() const; | |
| | | | |
| virtual QSize sizeHint() const; | | virtual QSize sizeHint() const; | |
| virtual QSize minimumSizeHint() const; | | virtual QSize minimumSizeHint() const; | |
| | | | |
End of changes. 4 change blocks. |
| 0 lines changed or deleted | | 14 lines changed or added | |
|
| qwt_double_interval.h | | qwt_double_interval.h | |
| | | | |
| skipping to change at line 24 | | skipping to change at line 24 | |
| | | | |
| /*! | | /*! | |
| \brief A class representing an interval | | \brief A class representing an interval | |
| | | | |
| The interval is represented by 2 doubles, the lower and the upper limit. | | The interval is represented by 2 doubles, the lower and the upper limit. | |
| */ | | */ | |
| | | | |
| class QWT_EXPORT QwtDoubleInterval | | class QWT_EXPORT QwtDoubleInterval | |
| { | | { | |
| public: | | public: | |
|
| | | /*! | |
| | | Flag indicating if a border is included/excluded from an interval | |
| | | | |
| | | - IncludeBorders\n | |
| | | min/max values are inside the interval | |
| | | - ExcludeMinimum\n | |
| | | min value is not included in the interval | |
| | | - ExcludeMaximum\n | |
| | | max value is not included in the interval | |
| | | - ExcludeBorders\n | |
| | | min/max values are not included in the interval | |
| | | | |
| | | \sa setBorderMode(), testBorderMode() | |
| | | */ | |
| | | enum BorderMode | |
| | | { | |
| | | IncludeBorders = 0, | |
| | | | |
| | | ExcludeMinimum = 1, | |
| | | ExcludeMaximum = 2, | |
| | | | |
| | | ExcludeBorders = ExcludeMinimum | ExcludeMaximum | |
| | | }; | |
| | | | |
| inline QwtDoubleInterval(); | | inline QwtDoubleInterval(); | |
|
| inline QwtDoubleInterval(double minValue, double maxValue); | | inline QwtDoubleInterval(double minValue, double maxValue, | |
| | | int borderFlags = IncludeBorders); | |
| | | | |
|
| inline void setInterval(double minValue, double maxValue); | | inline void setInterval(double minValue, double maxValue, | |
| | | int borderFlags = IncludeBorders); | |
| | | | |
| QwtDoubleInterval normalized() const; | | QwtDoubleInterval normalized() const; | |
| QwtDoubleInterval inverted() const; | | QwtDoubleInterval inverted() const; | |
| QwtDoubleInterval limited(double minValue, double maxValue) const; | | QwtDoubleInterval limited(double minValue, double maxValue) const; | |
| | | | |
| inline int operator==(const QwtDoubleInterval &) const; | | inline int operator==(const QwtDoubleInterval &) const; | |
| inline int operator!=(const QwtDoubleInterval &) const; | | inline int operator!=(const QwtDoubleInterval &) const; | |
| | | | |
|
| | | inline void setBorderFlags(int); | |
| | | inline int borderFlags() const; | |
| | | | |
| inline double minValue() const; | | inline double minValue() const; | |
| inline double maxValue() const; | | inline double maxValue() const; | |
| | | | |
| inline double width() const; | | inline double width() const; | |
| | | | |
| inline void setMinValue(double); | | inline void setMinValue(double); | |
| inline void setMaxValue(double); | | inline void setMaxValue(double); | |
| | | | |
| bool contains(double value) const; | | bool contains(double value) const; | |
| | | | |
| | | | |
| skipping to change at line 69 | | skipping to change at line 98 | |
| | | | |
| inline bool isValid() const; | | inline bool isValid() const; | |
| inline bool isNull() const; | | inline bool isNull() const; | |
| inline void invalidate(); | | inline void invalidate(); | |
| | | | |
| QwtDoubleInterval symmetrize(double value) const; | | QwtDoubleInterval symmetrize(double value) const; | |
| | | | |
| private: | | private: | |
| double d_minValue; | | double d_minValue; | |
| double d_maxValue; | | double d_maxValue; | |
|
| | | int d_borderFlags; | |
| }; | | }; | |
| | | | |
| /*! | | /*! | |
| \brief Default Constructor | | \brief Default Constructor | |
| | | | |
| Creates an invalid interval [0.0, -1.0] | | Creates an invalid interval [0.0, -1.0] | |
|
| \sa setInterval, isValid | | \sa setInterval(), isValid() | |
| */ | | */ | |
| inline QwtDoubleInterval::QwtDoubleInterval(): | | inline QwtDoubleInterval::QwtDoubleInterval(): | |
| d_minValue(0.0), | | d_minValue(0.0), | |
|
| d_maxValue(-1.0) | | d_maxValue(-1.0), | |
| | | d_borderFlags(IncludeBorders) | |
| { | | { | |
| } | | } | |
| | | | |
| /*! | | /*! | |
| Constructor | | Constructor | |
| | | | |
|
| | | Build an interval with from min/max values | |
| | | | |
| \param minValue Minimum value | | \param minValue Minimum value | |
| \param maxValue Maximum value | | \param maxValue Maximum value | |
|
| | | \param borderFlags Include/Exclude borders | |
| */ | | */ | |
|
| inline QwtDoubleInterval::QwtDoubleInterval(double minValue, double maxValu | | inline QwtDoubleInterval::QwtDoubleInterval( | |
| e): | | double minValue, double maxValue, int borderFlags): | |
| d_minValue(minValue), | | d_minValue(minValue), | |
|
| d_maxValue(maxValue) | | d_maxValue(maxValue), | |
| | | d_borderFlags(borderFlags) | |
| { | | { | |
| } | | } | |
| | | | |
| /*! | | /*! | |
| Assign the limits of the interval | | Assign the limits of the interval | |
| | | | |
| \param minValue Minimum value | | \param minValue Minimum value | |
| \param maxValue Maximum value | | \param maxValue Maximum value | |
|
| | | \param borderFlags Include/Exclude borders | |
| */ | | */ | |
|
| inline void QwtDoubleInterval::setInterval(double minValue, double maxValue | | inline void QwtDoubleInterval::setInterval( | |
| ) | | double minValue, double maxValue, int borderFlags) | |
| { | | { | |
| d_minValue = minValue; | | d_minValue = minValue; | |
| d_maxValue = maxValue; | | d_maxValue = maxValue; | |
|
| | | d_borderFlags = borderFlags; | |
| | | } | |
| | | | |
| | | /*! | |
| | | Change the border flags | |
| | | | |
| | | \param borderFlags Or'd BorderMode flags | |
| | | \sa borderFlags() | |
| | | */ | |
| | | inline void QwtDoubleInterval::setBorderFlags(int borderFlags) | |
| | | { | |
| | | d_borderFlags = borderFlags; | |
| | | } | |
| | | | |
| | | /*! | |
| | | \return Border flags | |
| | | \sa setBorderFlags() | |
| | | */ | |
| | | inline int QwtDoubleInterval::borderFlags() const | |
| | | { | |
| | | return d_borderFlags; | |
| } | | } | |
| | | | |
| /*! | | /*! | |
| Assign the lower limit of the interval | | Assign the lower limit of the interval | |
| | | | |
| \param minValue Minimum value | | \param minValue Minimum value | |
| */ | | */ | |
| inline void QwtDoubleInterval::setMinValue(double minValue) | | inline void QwtDoubleInterval::setMinValue(double minValue) | |
| { | | { | |
| d_minValue = minValue; | | d_minValue = minValue; | |
| | | | |
| skipping to change at line 144 | | skipping to change at line 203 | |
| inline double QwtDoubleInterval::maxValue() const | | inline double QwtDoubleInterval::maxValue() const | |
| { | | { | |
| return d_maxValue; | | return 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 QwtDoubleInterval::width() const | | inline double QwtDoubleInterval::width() const | |
| { | | { | |
| return isValid() ? (d_maxValue - d_minValue) : 0.0; | | return isValid() ? (d_maxValue - d_minValue) : 0.0; | |
| } | | } | |
| | | | |
| /*! | | /*! | |
| Intersection of two intervals | | Intersection of two intervals | |
|
| \sa intersect | | \sa intersect() | |
| */ | | */ | |
| inline QwtDoubleInterval QwtDoubleInterval::operator&( | | inline QwtDoubleInterval QwtDoubleInterval::operator&( | |
| const QwtDoubleInterval &interval ) const | | const QwtDoubleInterval &interval ) const | |
| { | | { | |
| return intersect(interval); | | return intersect(interval); | |
| } | | } | |
| | | | |
| /*! | | /*! | |
| Union of two intervals | | Union of two intervals | |
|
| \sa unite | | \sa unite() | |
| */ | | */ | |
| inline QwtDoubleInterval QwtDoubleInterval::operator|( | | inline QwtDoubleInterval QwtDoubleInterval::operator|( | |
| const QwtDoubleInterval &interval) const | | const QwtDoubleInterval &interval) const | |
| { | | { | |
| return unite(interval); | | return unite(interval); | |
| } | | } | |
| | | | |
| //! Compare two intervals | | //! Compare two intervals | |
| inline int QwtDoubleInterval::operator==(const QwtDoubleInterval &other) co
nst | | inline int QwtDoubleInterval::operator==(const QwtDoubleInterval &other) co
nst | |
| { | | { | |
| return (d_minValue == other.d_minValue) && | | return (d_minValue == other.d_minValue) && | |
|
| (d_maxValue == other.d_maxValue); | | (d_maxValue == other.d_maxValue) && | |
| | | (d_borderFlags == other.d_borderFlags); | |
| } | | } | |
| | | | |
| //! Compare two intervals | | //! Compare two intervals | |
| inline int QwtDoubleInterval::operator!=(const QwtDoubleInterval &other) co
nst | | inline int QwtDoubleInterval::operator!=(const QwtDoubleInterval &other) co
nst | |
| { | | { | |
| return (!(*this == other)); | | return (!(*this == other)); | |
| } | | } | |
| | | | |
| /*! | | /*! | |
| Extend an interval | | Extend an interval | |
|
| \sa extend | | \sa extend() | |
| */ | | */ | |
| inline QwtDoubleInterval QwtDoubleInterval::operator|(double value) const | | inline QwtDoubleInterval QwtDoubleInterval::operator|(double value) const | |
| { | | { | |
| return extend(value); | | return extend(value); | |
| } | | } | |
| | | | |
|
| //! \return true, if minValue() >= maxValue() | | //! \return true, if isValid() && (minValue() >= maxValue()) | |
| inline bool QwtDoubleInterval::isNull() const | | inline bool QwtDoubleInterval::isNull() const | |
| { | | { | |
|
| return d_minValue >= d_maxValue; | | return isValid() && d_minValue >= d_maxValue; | |
| } | | } | |
| | | | |
|
| //! \return true, if minValue() <= maxValue() | | /*! | |
| | | A interval is valid when minValue() <= maxValue(). | |
| | | In case of QwtDoubleInterval::ExcludeBorders it is true | |
| | | when minValue() < maxValue() | |
| | | */ | |
| inline bool QwtDoubleInterval::isValid() const | | inline bool QwtDoubleInterval::isValid() const | |
| { | | { | |
|
| return d_minValue <= d_maxValue; | | 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 QwtDoubleInterval::invalidate() | | inline void QwtDoubleInterval::invalidate() | |
| { | | { | |
| d_minValue = 0.0; | | d_minValue = 0.0; | |
| d_maxValue = -1.0; | | d_maxValue = -1.0; | |
| } | | } | |
| | | | |
| #endif | | #endif | |
| | | | |
End of changes. 24 change blocks. |
| 19 lines changed or deleted | | 84 lines changed or added | |
|
| qwt_interval_data.h | | qwt_interval_data.h | |
| | | | |
| skipping to change at line 31 | | skipping to change at line 31 | |
| #endif | | #endif | |
| | | | |
| #if defined(QWT_TEMPLATEDLL) | | #if defined(QWT_TEMPLATEDLL) | |
| // MOC_SKIP_BEGIN | | // MOC_SKIP_BEGIN | |
| template class QWT_EXPORT QwtArray<QwtDoubleInterval>; | | template class QWT_EXPORT QwtArray<QwtDoubleInterval>; | |
| template class QWT_EXPORT QwtArray<double>; | | template class QWT_EXPORT QwtArray<double>; | |
| // MOC_SKIP_END | | // MOC_SKIP_END | |
| #endif | | #endif | |
| | | | |
| /*! | | /*! | |
|
| \brief Interval data class. | | \brief Series of samples of a value and an interval | |
| | | | |
|
| | | QwtIntervalData is a series of samples of a value and an interval. | |
| | | F.e. error bars are built from samples [x, y1-y2], while a | |
| | | histogram might consist of [x1-x2, y] samples. | |
| */ | | */ | |
| class QWT_EXPORT QwtIntervalData | | class QWT_EXPORT QwtIntervalData | |
| { | | { | |
| public: | | public: | |
| QwtIntervalData(); | | QwtIntervalData(); | |
| QwtIntervalData(const QwtArray<QwtDoubleInterval> &, | | QwtIntervalData(const QwtArray<QwtDoubleInterval> &, | |
| const QwtArray<double> &); | | const QwtArray<double> &); | |
| | | | |
|
| | | ~QwtIntervalData(); | |
| | | | |
| void setData(const QwtArray<QwtDoubleInterval> &, | | void setData(const QwtArray<QwtDoubleInterval> &, | |
| const QwtArray<double> &); | | const QwtArray<double> &); | |
| | | | |
| size_t size() const; | | size_t size() const; | |
| const QwtDoubleInterval &interval(size_t i) const; | | const QwtDoubleInterval &interval(size_t i) const; | |
| double value(size_t i) const; | | double value(size_t i) const; | |
| | | | |
| QwtDoubleRect boundingRect() const; | | QwtDoubleRect boundingRect() const; | |
| | | | |
| private: | | private: | |
| QwtArray<QwtDoubleInterval> d_intervals; | | QwtArray<QwtDoubleInterval> d_intervals; | |
| QwtArray<double> d_values; | | QwtArray<double> d_values; | |
| }; | | }; | |
| | | | |
|
| | | //! \return Number of samples | |
| inline size_t QwtIntervalData::size() const | | inline size_t QwtIntervalData::size() const | |
| { | | { | |
| return qwtMin(d_intervals.size(), d_values.size()); | | return qwtMin(d_intervals.size(), d_values.size()); | |
| } | | } | |
| | | | |
|
| | | /*! | |
| | | Interval of a sample | |
| | | | |
| | | \param i Sample index | |
| | | \return Interval | |
| | | \sa value(), size() | |
| | | */ | |
| inline const QwtDoubleInterval &QwtIntervalData::interval(size_t i) const | | inline const QwtDoubleInterval &QwtIntervalData::interval(size_t i) const | |
| { | | { | |
| return d_intervals[int(i)]; | | return d_intervals[int(i)]; | |
| } | | } | |
| | | | |
|
| | | /*! | |
| | | Value of a sample | |
| | | | |
| | | \param i Sample index | |
| | | \return Value | |
| | | \sa interval(), size() | |
| | | */ | |
| inline double QwtIntervalData::value(size_t i) const | | inline double QwtIntervalData::value(size_t i) const | |
| { | | { | |
| return d_values[int(i)]; | | return d_values[int(i)]; | |
| } | | } | |
| | | | |
| #endif | | #endif | |
| | | | |
End of changes. 6 change blocks. |
| 1 lines changed or deleted | | 21 lines changed or added | |
|
| qwt_painter.h | | qwt_painter.h | |
| | | | |
| skipping to change at line 15 | | skipping to change at line 15 | |
| * | | * | |
| * This library is free software; you can redistribute it and/or | | * This library is free software; you can redistribute it and/or | |
| * 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_PAINTER_H | | #ifndef QWT_PAINTER_H | |
| #define QWT_PAINTER_H | | #define QWT_PAINTER_H | |
| | | | |
| #include <qpoint.h> | | #include <qpoint.h> | |
| #include <qrect.h> | | #include <qrect.h> | |
|
| | | #include <qpen.h> | |
| #include "qwt_global.h" | | #include "qwt_global.h" | |
| #include "qwt_layout_metrics.h" | | #include "qwt_layout_metrics.h" | |
| #include "qwt_polygon.h" | | #include "qwt_polygon.h" | |
| | | | |
| class QPainter; | | class QPainter; | |
| class QBrush; | | class QBrush; | |
| class QColor; | | class QColor; | |
| class QWidget; | | class QWidget; | |
| class QwtScaleMap; | | class QwtScaleMap; | |
| class QwtColorMap; | | class QwtColorMap; | |
| | | | |
| skipping to change at line 73 | | skipping to change at line 74 | |
| { | | { | |
| public: | | public: | |
| static void setMetricsMap(const QPaintDevice *layout, | | static void setMetricsMap(const QPaintDevice *layout, | |
| const QPaintDevice *device); | | const QPaintDevice *device); | |
| static void setMetricsMap(const QwtMetricsMap &); | | static void setMetricsMap(const QwtMetricsMap &); | |
| static void resetMetricsMap(); | | static void resetMetricsMap(); | |
| static const QwtMetricsMap &metricsMap(); | | static const QwtMetricsMap &metricsMap(); | |
| | | | |
| static void setDeviceClipping(bool); | | static void setDeviceClipping(bool); | |
| static bool deviceClipping(); | | static bool deviceClipping(); | |
|
| | | static const QRect &deviceClipRect(); | |
| | | | |
| static void setClipRect(QPainter *, const QRect &); | | static void setClipRect(QPainter *, const QRect &); | |
| | | | |
| static void drawText(QPainter *, int x, int y, | | static void drawText(QPainter *, int x, int y, | |
| const QString &); | | const QString &); | |
| static void drawText(QPainter *, const QPoint &, | | static void drawText(QPainter *, const QPoint &, | |
| const QString &); | | const QString &); | |
| static void drawText(QPainter *, int x, int y, int w, int h, | | static void drawText(QPainter *, int x, int y, int w, int h, | |
| int flags, const QString &); | | int flags, const QString &); | |
| static void drawText(QPainter *, const QRect &, | | static void drawText(QPainter *, const QRect &, | |
| | | | |
| skipping to change at line 118 | | skipping to change at line 120 | |
| #if QT_VERSION < 0x040000 | | #if QT_VERSION < 0x040000 | |
| static void drawRoundFrame(QPainter *, const QRect &, | | static void drawRoundFrame(QPainter *, const QRect &, | |
| int width, const QColorGroup &cg, bool sunken); | | int width, const QColorGroup &cg, bool sunken); | |
| #else | | #else | |
| static void drawRoundFrame(QPainter *, const QRect &, | | static void drawRoundFrame(QPainter *, const QRect &, | |
| int width, const QPalette &, bool sunken); | | int width, const QPalette &, bool sunken); | |
| #endif | | #endif | |
| static void drawFocusRect(QPainter *, QWidget *); | | static void drawFocusRect(QPainter *, QWidget *); | |
| static void drawFocusRect(QPainter *, QWidget *, const QRect &); | | static void drawFocusRect(QPainter *, QWidget *, const QRect &); | |
| | | | |
|
| static QwtPolygon clip(const QwtPolygon &); | | | |
| | | | |
| static void drawColorBar(QPainter *painter, | | static void drawColorBar(QPainter *painter, | |
| const QwtColorMap &, const QwtDoubleInterval &, | | const QwtColorMap &, const QwtDoubleInterval &, | |
| const QwtScaleMap &, Qt::Orientation, const QRect &); | | const QwtScaleMap &, Qt::Orientation, const QRect &); | |
| | | | |
| #if QT_VERSION < 0x040000 | | #if QT_VERSION < 0x040000 | |
| static void setSVGMode(bool on); | | static void setSVGMode(bool on); | |
| static bool isSVGMode(); | | static bool isSVGMode(); | |
| #endif | | #endif | |
| | | | |
|
| | | static QPen scaledPen(const QPen &); | |
| | | | |
| private: | | private: | |
| static void drawColoredArc(QPainter *, const QRect &, | | static void drawColoredArc(QPainter *, const QRect &, | |
| int peak, int arc, int intervall, const QColor &c1, const QColor &c
2); | | int peak, int arc, int intervall, const QColor &c1, const QColor &c
2); | |
| | | | |
|
| static const QRect &deviceClipRect(); | | | |
| | | | |
| static bool d_deviceClipping; | | static bool d_deviceClipping; | |
| static QwtMetricsMap d_metricsMap; | | static QwtMetricsMap d_metricsMap; | |
| #if QT_VERSION < 0x040000 | | #if QT_VERSION < 0x040000 | |
| static bool d_SVGMode; | | static bool d_SVGMode; | |
| #endif | | #endif | |
| }; | | }; | |
| | | | |
| //! Wrapper for QPainter::drawLine() | | //! Wrapper for QPainter::drawLine() | |
| inline void QwtPainter::drawLine(QPainter *painter, | | inline void QwtPainter::drawLine(QPainter *painter, | |
| const QPoint &p1, const QPoint &p2) | | const QPoint &p1, const QPoint &p2) | |
| { | | { | |
| drawLine(painter, p1.x(), p1.y(), p2.x(), p2.y()); | | drawLine(painter, p1.x(), p1.y(), p2.x(), p2.y()); | |
| } | | } | |
| | | | |
|
| | | /*! | |
| | | Returns whether device clipping is enabled. On X11 the default | |
| | | is enabled, otherwise it is disabled. | |
| | | \sa QwtPainter::setDeviceClipping() | |
| | | */ | |
| | | inline bool QwtPainter::deviceClipping() | |
| | | { | |
| | | return d_deviceClipping; | |
| | | } | |
| | | | |
| #endif | | #endif | |
| | | | |
End of changes. 6 change blocks. |
| 4 lines changed or deleted | | 14 lines changed or added | |
|
| qwt_plot.h | | qwt_plot.h | |
| | | | |
| skipping to change at line 54 | | skipping to change at line 54 | |
| \image html plot.png | | \image html plot.png | |
| | | | |
| \par Example | | \par Example | |
| The following example shows (schematically) the most simple | | The following example shows (schematically) the most simple | |
| way to use QwtPlot. By default, only the left and bottom axes are | | way to use QwtPlot. By default, only the left and bottom axes are | |
| visible and their scales are computed automatically. | | visible and their scales are computed automatically. | |
| \verbatim | | \verbatim | |
| #include <qwt_plot.h> | | #include <qwt_plot.h> | |
| #include <qwt_plot_curve.h> | | #include <qwt_plot_curve.h> | |
| | | | |
|
| QwtPlot *myPlot; | | QwtPlot *myPlot = new QwtPlot("Two Curves", parent); | |
| double x[100], y1[100], y2[100]; // x and y values | | | |
| | | | |
| myPlot = new QwtPlot("Two Curves", parent); | | | |
| | | | |
| // add curves | | // add curves | |
| QwtPlotCurve *curve1 = new QwtPlotCurve("Curve 1"); | | QwtPlotCurve *curve1 = new QwtPlotCurve("Curve 1"); | |
| QwtPlotCurve *curve2 = new QwtPlotCurve("Curve 2"); | | QwtPlotCurve *curve2 = new QwtPlotCurve("Curve 2"); | |
| | | | |
|
| getSomeValues(x, y1, y2); | | | |
| | | | |
| // copy the data into the curves | | // copy the data into the curves | |
|
| curve1->setData(x, y1, 100); | | curve1->setData(...); | |
| curve2->setData(x, y2, 100); | | curve2->setData(...); | |
| | | | |
| curve1->attach(myPlot); | | curve1->attach(myPlot); | |
| curve2->attach(myPlot); | | curve2->attach(myPlot); | |
| | | | |
| // finally, refresh the plot | | // finally, refresh the plot | |
| myPlot->replot(); | | myPlot->replot(); | |
| \endverbatim | | \endverbatim | |
| */ | | */ | |
| | | | |
| class QWT_EXPORT QwtPlot: public QFrame, public QwtPlotDict | | class QWT_EXPORT QwtPlot: public QFrame, public QwtPlotDict | |
| { | | { | |
|
| friend class QwtPlotCanvas; | | | |
| | | | |
| Q_OBJECT | | Q_OBJECT | |
| Q_PROPERTY( QString propertiesDocument | | Q_PROPERTY( QString propertiesDocument | |
| READ grabProperties WRITE applyProperties ) | | READ grabProperties WRITE applyProperties ) | |
| | | | |
| public: | | public: | |
|
| //! Axis index | | /*! | |
| | | Axis index | |
| | | | |
| | | - yLeft\n | |
| | | - yRight\n | |
| | | - xBottom\n | |
| | | - xTop\n | |
| | | */ | |
| enum Axis | | enum Axis | |
| { | | { | |
| yLeft, | | yLeft, | |
| yRight, | | yRight, | |
| xBottom, | | xBottom, | |
| xTop, | | xTop, | |
| | | | |
| axisCnt | | axisCnt | |
| }; | | }; | |
| | | | |
| /*! | | /*! | |
|
| \brief Position of the legend, relative to the canvas. | | Position of the legend, relative to the canvas. | |
| | | | |
|
| ExternalLegend means that only the content of the legend | | - LeftLegend\n | |
| will be handled by QwtPlot, but not its geometry. | | The legend will be left from the yLeft axis. | |
| This might be interesting if an application wants to | | - RightLegend\n | |
| have a legend in an external window. | | The legend will be right from the yLeft axis. | |
| | | - BottomLegend\n | |
| | | The legend will be right below the xBottom axis. | |
| | | - TopLegend\n | |
| | | The legend will be between xTop axis and the title. | |
| | | - ExternalLegend\n | |
| | | External means that only the content of the legend | |
| | | will be handled by QwtPlot, but not its geometry. | |
| | | This might be interesting if an application wants to | |
| | | have a legend in an external window ( or on the canvas ). | |
| | | | |
| | | \note In case of ExternalLegend, the legend is not | |
| | | printed by print(). | |
| | | | |
| | | \sa insertLegend() | |
| */ | | */ | |
| enum LegendPosition | | enum LegendPosition | |
| { | | { | |
| LeftLegend, | | LeftLegend, | |
| RightLegend, | | RightLegend, | |
| BottomLegend, | | BottomLegend, | |
| TopLegend, | | TopLegend, | |
| | | | |
| ExternalLegend | | ExternalLegend | |
| }; | | }; | |
| | | | |
| skipping to change at line 228 | | skipping to change at line 242 | |
| QwtLegend *legend(); | | QwtLegend *legend(); | |
| const QwtLegend *legend() const; | | const QwtLegend *legend() const; | |
| | | | |
| // Misc | | // Misc | |
| | | | |
| virtual void polish(); | | virtual void polish(); | |
| virtual QSize sizeHint() const; | | virtual QSize sizeHint() const; | |
| virtual QSize minimumSizeHint() const; | | virtual QSize minimumSizeHint() const; | |
| | | | |
| virtual void updateLayout(); | | virtual void updateLayout(); | |
|
| | | virtual void drawCanvas(QPainter *); | |
| | | | |
| | | void updateAxes(); | |
| | | | |
| virtual bool event(QEvent *); | | virtual bool event(QEvent *); | |
| | | | |
| signals: | | signals: | |
| /*! | | /*! | |
| A signal which is emitted when the user has clicked on | | A signal which is emitted when the user has clicked on | |
| a legend item, which is in QwtLegend::ClickableItem mode. | | a legend item, which is in QwtLegend::ClickableItem mode. | |
| | | | |
| \param plotItem Corresponding plot item of the | | \param plotItem Corresponding plot item of the | |
| selected legend item | | selected legend item | |
| | | | |
| \note clicks are disabled as default | | \note clicks are disabled as default | |
|
| \sa QwtLegend::setItemMode, QwtLegend::itemMode | | \sa QwtLegend::setItemMode(), QwtLegend::itemMode() | |
| */ | | */ | |
| void legendClicked(QwtPlotItem *plotItem); | | void legendClicked(QwtPlotItem *plotItem); | |
| | | | |
| /*! | | /*! | |
| A signal which is emitted when the user has clicked on | | A signal which is emitted when the user has clicked on | |
| a legend item, which is in QwtLegend::CheckableItem mode | | a legend item, which is in QwtLegend::CheckableItem mode | |
| | | | |
| \param plotItem Corresponding plot item of the | | \param plotItem Corresponding plot item of the | |
| selected legend item | | selected legend item | |
| \param on True when the legen item is checked | | \param on True when the legen item is checked | |
| | | | |
| \note clicks are disabled as default | | \note clicks are disabled as default | |
|
| \sa QwtLegend::setItemMode, QwtLegend::itemMode | | \sa QwtLegend::setItemMode(), QwtLegend::itemMode() | |
| */ | | */ | |
| | | | |
| void legendChecked(QwtPlotItem *plotItem, bool on); | | void legendChecked(QwtPlotItem *plotItem, bool on); | |
| | | | |
| public slots: | | public slots: | |
| virtual void clear(); | | virtual void clear(); | |
| | | | |
| virtual void replot(); | | virtual void replot(); | |
| void autoRefresh(); | | void autoRefresh(); | |
| | | | |
| protected slots: | | protected slots: | |
| virtual void legendItemClicked(); | | virtual void legendItemClicked(); | |
| virtual void legendItemChecked(bool); | | virtual void legendItemChecked(bool); | |
| | | | |
| protected: | | protected: | |
| static bool axisValid(int axisId); | | static bool axisValid(int axisId); | |
| | | | |
|
| virtual void drawCanvas(QPainter *); | | | |
| virtual void drawItems(QPainter *, const QRect &, | | virtual void drawItems(QPainter *, const QRect &, | |
| const QwtScaleMap maps[axisCnt], | | const QwtScaleMap maps[axisCnt], | |
| const QwtPlotPrintFilter &) const; | | const QwtPlotPrintFilter &) const; | |
| | | | |
| virtual void updateTabOrder(); | | virtual void updateTabOrder(); | |
| | | | |
|
| void updateAxes(); | | | |
| | | | |
| virtual void resizeEvent(QResizeEvent *e); | | virtual void resizeEvent(QResizeEvent *e); | |
| | | | |
| virtual void printLegendItem(QPainter *, | | virtual void printLegendItem(QPainter *, | |
| const QWidget *, const QRect &) const; | | const QWidget *, const QRect &) const; | |
| | | | |
| virtual void printTitle(QPainter *, const QRect &) const; | | virtual void printTitle(QPainter *, const QRect &) const; | |
| | | | |
| virtual void printScale(QPainter *, int axisId, int startDist, int endD
ist, | | virtual void printScale(QPainter *, int axisId, int startDist, int endD
ist, | |
| int baseDist, const QRect &) const; | | int baseDist, const QRect &) const; | |
| | | | |
| | | | |
End of changes. 12 change blocks. |
| 21 lines changed or deleted | | 35 lines changed or added | |
|
| qwt_plot_curve.h | | qwt_plot_curve.h | |
| | | | |
| skipping to change at line 27 | | skipping to change at line 27 | |
| #include "qwt_text.h" | | #include "qwt_text.h" | |
| #include "qwt_polygon.h" | | #include "qwt_polygon.h" | |
| #include "qwt_data.h" | | #include "qwt_data.h" | |
| | | | |
| class QPainter; | | class QPainter; | |
| class QwtScaleMap; | | class QwtScaleMap; | |
| class QwtSymbol; | | class QwtSymbol; | |
| class QwtCurveFitter; | | class QwtCurveFitter; | |
| | | | |
| /*! | | /*! | |
|
| \brief A class which draws curves | | \brief A plot item, that represents a series of points | |
| | | | |
|
| This class can be used to display data as a curve in the x-y plane. | | A curve is the representation of a series of points in the x-y plane. | |
| It supports different display styles, spline interpolation and symbols. | | It supports different display styles, interpolation ( f.e. spline ) | |
| | | and symbols. | |
| | | | |
| \par Usage | | \par Usage | |
|
| <dl><dt>A. Assign curve properties</dt> | | <dl><dt>a) Assign curve properties</dt> | |
| <dd>When a curve is created, it is configured to draw black solid lines | | <dd>When a curve is created, it is configured to draw black solid lines | |
|
| with QwtPlotCurve::Lines and no symbols. You can change this by calling | | with in Lines style and no symbols. You can change this by calling | |
| setPen(), setStyle() and setSymbol().</dd> | | setPen(), setStyle() and setSymbol().</dd> | |
|
| <dt>B. Assign or change data.</dt> | | <dt>b) Connect/Assign data.</dt> | |
| <dd>Data can be set in two ways:<ul> | | <dd>QwtPlotCurve gets its points using a QwtData object offering | |
| <li>setData() is overloaded to initialize the x and y data by | | a bridge to the real storage of the points ( like QAbstractItemModel ). | |
| copying from different data structures with different kind of copy semant | | There are several convenience classes derived from QwtData, that also sto | |
| ics. | | re | |
| <li>setRawData() only stores the pointers and size information | | the points inside ( like QStandardItemModel ). QwtPlotCurve also offers | |
| and is provided for backwards compatibility. This function is less safe | | a couple of variations of setData(), that build QwtData objects from | |
| (you | | arrays internally.</dd> | |
| must not delete the data while they are attached), but has been more | | <dt>c) Attach the curve to a plot</dt> | |
| efficient, and has been more convenient for dynamically changing data. | | <dd>See QwtPlotItem::attach() | |
| Use of setData() in combination with a problem-specific subclass | | | |
| of QwtData is always preferrable.</ul></dd> | | | |
| <dt>C. Draw</dt> | | | |
| <dd>draw() maps the data into pixel coordinates and paints them. | | | |
| </dd></dl> | | </dd></dl> | |
| | | | |
| \par Example: | | \par Example: | |
|
| see examples/curvdemo | | see examples/bode | |
| | | | |
|
| \sa QwtData, QwtSymbol, QwtScaleMap | | \sa QwtPlot, QwtData, QwtSymbol, QwtScaleMap | |
| */ | | */ | |
| class QWT_EXPORT QwtPlotCurve: public QwtPlotItem | | class QWT_EXPORT QwtPlotCurve: public QwtPlotItem | |
| { | | { | |
| public: | | public: | |
|
| | | /*! | |
| | | Curve type. | |
| | | | |
| | | - Yfx\n | |
| | | Draws y as a function of x (the default). The | |
| | | baseline is interpreted as a horizontal line | |
| | | with y = baseline(). | |
| | | - Xfy\n | |
| | | Draws x as a function of y. The baseline is | |
| | | interpreted as a vertical line with x = baseline(). | |
| | | | |
| | | The baseline is used for aligning the sticks, or | |
| | | filling the curve with a brush. | |
| | | | |
| | | \sa setCurveType(), curveType(), baseline() brush() | |
| | | */ | |
| enum CurveType | | enum CurveType | |
| { | | { | |
| Yfx, | | Yfx, | |
| Xfy | | Xfy | |
| }; | | }; | |
| | | | |
| /*! | | /*! | |
| Curve styles. | | Curve styles. | |
|
| \sa setStyle | | | |
| | | - NoCurve\n | |
| | | Don't draw a curve. Note: This doesn't affect the symbols. | |
| | | - Lines\n | |
| | | Connect the points with straight lines. The lines might | |
| | | be interpolated depending on the 'Fitted' attribute. Curve | |
| | | fitting can be configured using setCurveFitter(). | |
| | | - Sticks\n | |
| | | Draw vertical(Yfx) or horizontal(Xfy) sticks from a baseline | |
| | | which is defined by setBaseline(). | |
| | | - Steps\n | |
| | | Connect the points with a step function. The step function | |
| | | is drawn from the left to the right or vice versa, | |
| | | depending on the 'Inverted' attribute. | |
| | | - Dots\n | |
| | | Draw dots at the locations of the data points. Note: | |
| | | This is different from a dotted line (see setPen()), and faster | |
| | | as a curve in NoStyle style and a symbol painting a point. | |
| | | - UserCurve\n | |
| | | Styles >= UserCurve are reserved for derived | |
| | | classes of QwtPlotCurve that overload drawCurve() with | |
| | | additional application specific curve types. | |
| | | | |
| | | \sa setStyle(), style() | |
| */ | | */ | |
| enum CurveStyle | | enum CurveStyle | |
| { | | { | |
| NoCurve, | | NoCurve, | |
| | | | |
| Lines, | | Lines, | |
| Sticks, | | Sticks, | |
| Steps, | | Steps, | |
| Dots, | | Dots, | |
| | | | |
| UserCurve = 100 | | UserCurve = 100 | |
| }; | | }; | |
| | | | |
| /*! | | /*! | |
|
| Curve attributes. | | Attribute for drawing the curve | |
| \sa setCurveAttribute, testCurveAttribute | | | |
| | | - Fitted ( in combination with the Lines QwtPlotCurve::CurveStyle onl | |
| | | y )\n | |
| | | A QwtCurveFitter tries to | |
| | | interpolate/smooth the curve, before it is painted. | |
| | | Note that curve fitting requires temorary memory | |
| | | for calculating coefficients and additional points. | |
| | | If painting in Fitted mode is slow it might be better | |
| | | to fit the points, before they are passed to QwtPlotCurve. | |
| | | - Inverted\n | |
| | | For Steps only. Draws a step function | |
| | | from the right to the left. | |
| | | | |
| | | \sa setCurveAttribute(), testCurveAttribute(), curveFitter() | |
| */ | | */ | |
| enum CurveAttribute | | enum CurveAttribute | |
| { | | { | |
| Inverted = 1, | | Inverted = 1, | |
| Fitted = 2 | | Fitted = 2 | |
| }; | | }; | |
| | | | |
| /*! | | /*! | |
|
| Paint attributes | | Attributes to modify the drawing algorithm. | |
| \sa setPaintAttribute, testPaintAttribute | | | |
| | | - PaintFiltered\n | |
| | | Tries to reduce the data that has to be painted, by sorting out | |
| | | duplicates, or paintings outside the visible area. Might have a | |
| | | notable impact on curves with many close points. | |
| | | Only a couple of very basic filtering algos are implemented. | |
| | | - ClipPolygons\n | |
| | | Clip polygons before painting them. In situations, where points | |
| | | are far outside the visible area (f.e when zooming deep) this | |
| | | might be a substantial improvement for the painting performance | |
| | | ( especially on Windows ). | |
| | | | |
| | | The default is, that no paint attributes are enabled. | |
| | | | |
| | | \sa setPaintAttribute(), testPaintAttribute() | |
| */ | | */ | |
| enum PaintAttribute | | enum PaintAttribute | |
| { | | { | |
| PaintFiltered = 1, | | PaintFiltered = 1, | |
| ClipPolygons = 2 | | ClipPolygons = 2 | |
| }; | | }; | |
| | | | |
| explicit QwtPlotCurve(); | | explicit QwtPlotCurve(); | |
| explicit QwtPlotCurve(const QwtText &title); | | explicit QwtPlotCurve(const QwtText &title); | |
| explicit QwtPlotCurve(const QString &title); | | explicit QwtPlotCurve(const QString &title); | |
| | | | |
End of changes. 11 change blocks. |
| 26 lines changed or deleted | | 89 lines changed or added | |
|
| qwt_plot_item.h | | qwt_plot_item.h | |
| | | | |
| skipping to change at line 29 | | skipping to change at line 29 | |
| class QRect; | | class QRect; | |
| class QPainter; | | class QPainter; | |
| class QWidget; | | class QWidget; | |
| class QwtPlot; | | class QwtPlot; | |
| class QwtLegend; | | class QwtLegend; | |
| class QwtScaleMap; | | class QwtScaleMap; | |
| class QwtScaleDiv; | | class QwtScaleDiv; | |
| | | | |
| /*! | | /*! | |
| \brief Base class for items on the plot canvas | | \brief Base class for items on the plot canvas | |
|
| | | | |
| | | A plot item is "something", that can be painted on the plot canvas, | |
| | | or only affects the scales of the plot widget. They can be categorized as | |
| | | : | |
| | | | |
| | | - Representator\n | |
| | | A "Representator" is an item that represents some sort of data | |
| | | on the plot canvas. The different representator classes are organized | |
| | | according to the characteristics of the data: | |
| | | - QwtPlotMarker | |
| | | Represents a point or a horizontal/vertical coordinate | |
| | | - QwtPlotCurve | |
| | | Represents a series of points | |
| | | - QwtPlotSpectrogram ( QwtPlotRasterItem ) | |
| | | Represents raster data | |
| | | - ... | |
| | | | |
| | | - Decorators\n | |
| | | A "Decorator" is an item, that displays additional information, that | |
| | | is not related to any data: | |
| | | - QwtPlotGrid | |
| | | - QwtPlotScaleItem | |
| | | - QwtPlotSvgItem | |
| | | - ... | |
| | | | |
| | | Depending on the QwtPlotItem::ItemAttribute flags, an item is included | |
| | | into autoscaling or has an entry on the legnd. | |
| | | | |
| | | Before misusing the existing item classes it might be better to | |
| | | implement a new type of plot item | |
| | | ( don't implement a watermark as spectrogram ). | |
| | | Deriving a new type of QwtPlotItem primarily means to implement | |
| | | the YourPlotItem::draw() method. | |
| | | | |
| | | \sa The cpuplot example shows the implementation of additional plot items | |
| | | . | |
| */ | | */ | |
| | | | |
| class QWT_EXPORT QwtPlotItem: public QwtLegendItemManager | | class QWT_EXPORT QwtPlotItem: public QwtLegendItemManager | |
| { | | { | |
| public: | | public: | |
|
| | | /*! | |
| | | \brief Runtime type information | |
| | | | |
| | | RttiValues is used to cast plot items, without | |
| | | having to enable runtime type information of the compiler. | |
| | | */ | |
| enum RttiValues | | enum RttiValues | |
| { | | { | |
| Rtti_PlotItem = 0, | | Rtti_PlotItem = 0, | |
| | | | |
| Rtti_PlotGrid, | | Rtti_PlotGrid, | |
| Rtti_PlotScale, | | Rtti_PlotScale, | |
| Rtti_PlotMarker, | | Rtti_PlotMarker, | |
| Rtti_PlotCurve, | | Rtti_PlotCurve, | |
| Rtti_PlotHistogram, | | Rtti_PlotHistogram, | |
| Rtti_PlotSpectrogram, | | Rtti_PlotSpectrogram, | |
| Rtti_PlotSVG, | | Rtti_PlotSVG, | |
| | | | |
| Rtti_PlotUserItem = 1000 | | Rtti_PlotUserItem = 1000 | |
| }; | | }; | |
| | | | |
|
| | | /*! | |
| | | Plot Item Attributes | |
| | | | |
| | | - Legend\n | |
| | | The item is represented on the legend. | |
| | | - AutoScale \n | |
| | | The boundingRect() of the item is included in the | |
| | | autoscaling calculation. | |
| | | | |
| | | \sa setItemAttribute(), testItemAttribute() | |
| | | */ | |
| enum ItemAttribute | | enum ItemAttribute | |
| { | | { | |
| Legend = 1, | | Legend = 1, | |
| AutoScale = 2 | | AutoScale = 2 | |
| }; | | }; | |
| | | | |
| #if QT_VERSION >= 0x040000 | | #if QT_VERSION >= 0x040000 | |
|
| | | //! Render hints | |
| enum RenderHint | | enum RenderHint | |
| { | | { | |
| RenderAntialiased = 1 | | RenderAntialiased = 1 | |
| }; | | }; | |
| #endif | | #endif | |
| | | | |
| explicit QwtPlotItem(const QwtText &title = QwtText()); | | explicit QwtPlotItem(const QwtText &title = QwtText()); | |
| virtual ~QwtPlotItem(); | | virtual ~QwtPlotItem(); | |
| | | | |
| void attach(QwtPlot *plot); | | void attach(QwtPlot *plot); | |
| | | | |
End of changes. 4 change blocks. |
| 0 lines changed or deleted | | 54 lines changed or added | |
|
| qwt_plot_marker.h | | qwt_plot_marker.h | |
| | | | |
| skipping to change at line 51 | | skipping to change at line 51 | |
| the marker, which means, for example, that the label would be printed | | the marker, which means, for example, that the label would be printed | |
| left above the center point if the alignment was set to AlignLeft|AlignTo
p. | | left above the center point if the alignment was set to AlignLeft|AlignTo
p. | |
| */ | | */ | |
| | | | |
| class QWT_EXPORT QwtPlotMarker: public QwtPlotItem | | class QWT_EXPORT QwtPlotMarker: public QwtPlotItem | |
| { | | { | |
| public: | | public: | |
| | | | |
| /*! | | /*! | |
| Line styles. | | Line styles. | |
|
| \sa QwtPlotMarker::setLineStyle, QwtPlotMarker::lineStyle | | \sa setLineStyle(), lineStyle() | |
| */ | | */ | |
|
| enum LineStyle {NoLine, HLine, VLine, Cross}; | | enum LineStyle | |
| | | { | |
| | | NoLine, | |
| | | HLine, | |
| | | VLine, | |
| | | Cross | |
| | | }; | |
| | | | |
| explicit QwtPlotMarker(); | | explicit QwtPlotMarker(); | |
| virtual ~QwtPlotMarker(); | | virtual ~QwtPlotMarker(); | |
| | | | |
| virtual int rtti() const; | | virtual int rtti() const; | |
| | | | |
| double xValue() const; | | double xValue() const; | |
| double yValue() const; | | double yValue() const; | |
| QwtDoublePoint value() const; | | QwtDoublePoint value() const; | |
| | | | |
| | | | |
| skipping to change at line 89 | | skipping to change at line 95 | |
| QwtText label() const; | | QwtText label() const; | |
| | | | |
| #if QT_VERSION < 0x040000 | | #if QT_VERSION < 0x040000 | |
| void setLabelAlignment(int align); | | void setLabelAlignment(int align); | |
| int labelAlignment() const; | | int labelAlignment() const; | |
| #else | | #else | |
| void setLabelAlignment(Qt::Alignment); | | void setLabelAlignment(Qt::Alignment); | |
| Qt::Alignment labelAlignment() const; | | Qt::Alignment labelAlignment() const; | |
| #endif | | #endif | |
| | | | |
|
| | | void setLabelOrientation(Qt::Orientation); | |
| | | Qt::Orientation labelOrientation() const; | |
| | | | |
| | | void setSpacing(int); | |
| | | int spacing() const; | |
| | | | |
| virtual void draw(QPainter *p, | | virtual void draw(QPainter *p, | |
| const QwtScaleMap &xMap, const QwtScaleMap &yMap, | | const QwtScaleMap &xMap, const QwtScaleMap &yMap, | |
| const QRect &) const; | | const QRect &) const; | |
| | | | |
| virtual QwtDoubleRect boundingRect() const; | | virtual QwtDoubleRect boundingRect() const; | |
| | | | |
|
| | | protected: | |
| | | void drawAt(QPainter *,const QRect &, const QPoint &) const; | |
| | | | |
| private: | | private: | |
|
| | | void drawLabel(QPainter *, const QRect &, const QPoint &) const; | |
| | | | |
| class PrivateData; | | class PrivateData; | |
| PrivateData *d_data; | | PrivateData *d_data; | |
| }; | | }; | |
| | | | |
| #endif | | #endif | |
| | | | |
End of changes. 5 change blocks. |
| 2 lines changed or deleted | | 19 lines changed or added | |
|
| qwt_raster_data.h | | qwt_raster_data.h | |
| | | | |
| skipping to change at line 52 | | skipping to change at line 52 | |
| template class QWT_EXPORT QMap<double, QwtArray<QwtDoublePoint> >; | | template class QWT_EXPORT QMap<double, QwtArray<QwtDoublePoint> >; | |
| #endif //end of QMAP_TEMPLATE_QWTDOUBLEPOINT | | #endif //end of QMAP_TEMPLATE_QWTDOUBLEPOINT | |
| // MOC_SKIP_END | | // MOC_SKIP_END | |
| #endif | | #endif | |
| #endif | | #endif | |
| | | | |
| class QwtScaleMap; | | class QwtScaleMap; | |
| | | | |
| /*! | | /*! | |
| \brief QwtRasterData defines an interface to any type of raster data. | | \brief QwtRasterData defines an interface to any type of raster data. | |
|
| | | | |
| | | QwtRasterData is an abstract interface, that is used by | |
| | | QwtPlotRasterItem to find the values at the pixels of its raster. | |
| | | | |
| | | Often a raster item is used to display values from a matrix. Then the | |
| | | derived raster data class needs to implement some sort of resampling, | |
| | | that maps the raster of the matrix into the requested raster of | |
| | | the raster item ( depending on resolution and scales of the canvas ). | |
| */ | | */ | |
| class QWT_EXPORT QwtRasterData | | class QWT_EXPORT QwtRasterData | |
| { | | { | |
| public: | | public: | |
| #if QT_VERSION >= 0x040000 | | #if QT_VERSION >= 0x040000 | |
| typedef QMap<double, QPolygonF> ContourLines; | | typedef QMap<double, QPolygonF> ContourLines; | |
| #else | | #else | |
| typedef QMap<double, QwtArray<QwtDoublePoint> > ContourLines; | | typedef QMap<double, QwtArray<QwtDoublePoint> > ContourLines; | |
| #endif | | #endif | |
| | | | |
|
| | | //! Attribute to modify the contour algorithm | |
| enum ConrecAttribute | | enum ConrecAttribute | |
| { | | { | |
| IgnoreAllVerticesOnLevel = 1, | | IgnoreAllVerticesOnLevel = 1, | |
| IgnoreOutOfRange = 2 | | IgnoreOutOfRange = 2 | |
| }; | | }; | |
| | | | |
| QwtRasterData(); | | QwtRasterData(); | |
| QwtRasterData(const QwtDoubleRect &); | | QwtRasterData(const QwtDoubleRect &); | |
| virtual ~QwtRasterData(); | | virtual ~QwtRasterData(); | |
| | | | |
| | | | |
| skipping to change at line 83 | | skipping to change at line 92 | |
| virtual QwtRasterData *copy() const = 0; | | virtual QwtRasterData *copy() const = 0; | |
| | | | |
| virtual void setBoundingRect(const QwtDoubleRect &); | | virtual void setBoundingRect(const QwtDoubleRect &); | |
| QwtDoubleRect boundingRect() const; | | QwtDoubleRect boundingRect() const; | |
| | | | |
| virtual QSize rasterHint(const QwtDoubleRect &) const; | | virtual QSize rasterHint(const QwtDoubleRect &) const; | |
| | | | |
| virtual void initRaster(const QwtDoubleRect &, const QSize& raster); | | virtual void initRaster(const QwtDoubleRect &, const QSize& raster); | |
| virtual void discardRaster(); | | virtual void discardRaster(); | |
| | | | |
|
| //! \return the value at a raster position | | /*! | |
| | | \return the value at a raster position | |
| | | \param x X value in plot coordinates | |
| | | \param y Y value in plot coordinates | |
| | | */ | |
| virtual double value(double x, double y) const = 0; | | virtual double value(double x, double y) const = 0; | |
| | | | |
| //! \return the range of the values | | //! \return the range of the values | |
| virtual QwtDoubleInterval range() const = 0; | | virtual QwtDoubleInterval range() const = 0; | |
| | | | |
| #if QT_VERSION >= 0x040000 | | #if QT_VERSION >= 0x040000 | |
| virtual ContourLines contourLines(const QwtDoubleRect &rect, | | virtual ContourLines contourLines(const QwtDoubleRect &rect, | |
| const QSize &raster, const QList<double> &levels, | | const QSize &raster, const QList<double> &levels, | |
| int flags) const; | | int flags) const; | |
| #else | | #else | |
| | | | |
End of changes. 3 change blocks. |
| 1 lines changed or deleted | | 14 lines changed or added | |
|
| qwt_scale_div.h | | qwt_scale_div.h | |
| | | | |
| skipping to change at line 27 | | skipping to change at line 27 | |
| class QwtDoubleInterval; | | class QwtDoubleInterval; | |
| | | | |
| /*! | | /*! | |
| \brief A class representing a scale division | | \brief A class representing a scale division | |
| | | | |
| A scale division consists of its limits and 3 list | | A scale division consists of its limits and 3 list | |
| of tick values qualified as major, medium and minor ticks. | | of tick values qualified as major, medium and minor ticks. | |
| | | | |
| In most cases scale divisions are calculated by a QwtScaleEngine. | | In most cases scale divisions are calculated by a QwtScaleEngine. | |
| | | | |
|
| \sa QwtScaleEngine::subDivideInto, QwtScaleEngine::subDivide | | \sa subDivideInto(), subDivide() | |
| */ | | */ | |
| | | | |
| class QWT_EXPORT QwtScaleDiv | | class QWT_EXPORT QwtScaleDiv | |
| { | | { | |
| public: | | public: | |
|
| | | //! Scale tick types | |
| enum TickType | | enum TickType | |
| { | | { | |
| NoTick = -1, | | NoTick = -1, | |
| | | | |
| MinorTick, | | MinorTick, | |
| MediumTick, | | MediumTick, | |
| MajorTick, | | MajorTick, | |
| | | | |
| NTickTypes | | NTickTypes | |
| }; | | }; | |
| | | | |
| explicit QwtScaleDiv(); | | explicit QwtScaleDiv(); | |
| explicit QwtScaleDiv(const QwtDoubleInterval &, | | explicit QwtScaleDiv(const QwtDoubleInterval &, | |
| QwtValueList[NTickTypes]); | | QwtValueList[NTickTypes]); | |
|
| explicit QwtScaleDiv(double lBound, double rBound, | | explicit QwtScaleDiv(double lowerBound, double upperBound, | |
| QwtValueList[NTickTypes]); | | QwtValueList[NTickTypes]); | |
| | | | |
| int operator==(const QwtScaleDiv &s) const; | | int operator==(const QwtScaleDiv &s) const; | |
| int operator!=(const QwtScaleDiv &s) const; | | int operator!=(const QwtScaleDiv &s) const; | |
| | | | |
|
| void setInterval(double lBound, double rBound); | | void setInterval(double lowerBound, double upperBound); | |
| void setInterval(const QwtDoubleInterval &); | | void setInterval(const QwtDoubleInterval &); | |
| QwtDoubleInterval interval() const; | | QwtDoubleInterval interval() const; | |
| | | | |
|
| inline double lBound() const; | | inline double lowerBound() const; | |
| inline double hBound() const; | | inline double upperBound() const; | |
| inline double range() const; | | inline double range() const; | |
| | | | |
| bool contains(double v) const; | | bool contains(double v) const; | |
| | | | |
| void setTicks(int type, const QwtValueList &); | | void setTicks(int type, const QwtValueList &); | |
| const QwtValueList &ticks(int type) const; | | const QwtValueList &ticks(int type) const; | |
| | | | |
| void invalidate(); | | void invalidate(); | |
| bool isValid() const; | | bool isValid() const; | |
| | | | |
| void invert(); | | void invert(); | |
| | | | |
| private: | | private: | |
|
| double d_lBound; | | double d_lowerBound; | |
| double d_hBound; | | double d_upperBound; | |
| QwtValueList d_ticks[NTickTypes]; | | QwtValueList d_ticks[NTickTypes]; | |
| | | | |
| bool d_isValid; | | bool d_isValid; | |
| }; | | }; | |
| | | | |
| /*! | | /*! | |
| Change the interval | | Change the interval | |
|
| \lBound left bound | | \param lowerBound lower bound | |
| \rBound right bound | | \param upperBound upper bound | |
| */ | | */ | |
|
| inline void QwtScaleDiv::setInterval(double lBound, double hBound) | | inline void QwtScaleDiv::setInterval(double lowerBound, double upperBound) | |
| { | | { | |
|
| d_lBound = lBound; | | d_lowerBound = lowerBound; | |
| d_hBound = hBound; | | d_upperBound = upperBound; | |
| } | | } | |
| | | | |
| /*! | | /*! | |
|
| \return lBound -> hBound | | \return lowerBound -> upperBound | |
| */ | | */ | |
| inline QwtDoubleInterval QwtScaleDiv::interval() const | | inline QwtDoubleInterval QwtScaleDiv::interval() const | |
| { | | { | |
|
| return QwtDoubleInterval(d_lBound, d_hBound); | | return QwtDoubleInterval(d_lowerBound, d_upperBound); | |
| } | | } | |
| | | | |
| /*! | | /*! | |
|
| \return left bound | | \return lower bound | |
| \sa QwtScaleDiv::hBound | | \sa upperBound() | |
| */ | | */ | |
|
| inline double QwtScaleDiv::lBound() const | | inline double QwtScaleDiv::lowerBound() const | |
| { | | { | |
|
| return d_lBound; | | return d_lowerBound; | |
| } | | } | |
| | | | |
| /*! | | /*! | |
|
| \return right bound | | \return upper bound | |
| \sa QwtScaleDiv::lBound | | \sa lowerBound() | |
| */ | | */ | |
|
| inline double QwtScaleDiv::hBound() const | | inline double QwtScaleDiv::upperBound() const | |
| { | | { | |
|
| return d_hBound; | | return d_upperBound; | |
| } | | } | |
| | | | |
| /*! | | /*! | |
|
| \return hBound() - lBound() | | \return upperBound() - lowerBound() | |
| */ | | */ | |
| inline double QwtScaleDiv::range() const | | inline double QwtScaleDiv::range() const | |
| { | | { | |
|
| return d_hBound - d_lBound; | | return d_upperBound - d_lowerBound; | |
| } | | } | |
| #endif | | #endif | |
| | | | |
End of changes. 19 change blocks. |
| 24 lines changed or deleted | | 25 lines changed or added | |
|
| qwt_scale_engine.h | | qwt_scale_engine.h | |
| | | | |
| skipping to change at line 53 | | skipping to change at line 53 | |
| The layout of the scale can be varied with setAttribute(). | | The layout of the scale can be varied with setAttribute(). | |
| | | | |
| Qwt offers implementations for logarithmic (log10) | | Qwt offers implementations for logarithmic (log10) | |
| and linear scales. Contributions for other types of scale engines | | and linear scales. Contributions for other types of scale engines | |
| (date/time, log2 ... ) are welcome. | | (date/time, log2 ... ) are welcome. | |
| */ | | */ | |
| | | | |
| class QWT_EXPORT QwtScaleEngine | | class QWT_EXPORT QwtScaleEngine | |
| { | | { | |
| public: | | public: | |
|
| //! see QwtScaleEngine::setAttribute, testAttribute | | /*! | |
| | | - IncludeReference\n | |
| | | Build a scale which includes the reference() value. | |
| | | - Symmetric\n | |
| | | Build a scale which is symmetric to the reference() value. | |
| | | - Floating\n | |
| | | The endpoints of the scale are supposed to be equal the | |
| | | outmost included values plus the specified margins (see setMargins | |
| | | ()). If this attribute is *not* set, the endpoints of the scale wi | |
| | | ll | |
| | | be integer multiples of the step size. | |
| | | - Inverted\n | |
| | | Turn the scale upside down. | |
| | | | |
| | | \sa setAttribute(), testAttribute(), reference(), | |
| | | lowerMargin(), upperMargin() | |
| | | */ | |
| | | | |
| enum Attribute | | enum Attribute | |
| { | | { | |
| NoAttribute = 0, | | NoAttribute = 0, | |
| IncludeReference = 1, | | IncludeReference = 1, | |
| Symmetric = 2, | | Symmetric = 2, | |
| Floating = 4, | | Floating = 4, | |
| Inverted = 8 | | Inverted = 8 | |
| }; | | }; | |
| | | | |
| explicit QwtScaleEngine(); | | explicit QwtScaleEngine(); | |
| | | | |
| skipping to change at line 75 | | skipping to change at line 90 | |
| | | | |
| void setAttribute(Attribute, bool on = true); | | void setAttribute(Attribute, bool on = true); | |
| bool testAttribute(Attribute) const; | | bool testAttribute(Attribute) const; | |
| | | | |
| void setAttributes(int); | | void setAttributes(int); | |
| int attributes() const; | | int attributes() const; | |
| | | | |
| void setReference(double reference); | | void setReference(double reference); | |
| double reference() const; | | double reference() const; | |
| | | | |
|
| void setMargins(double m1, double m2); | | void setMargins(double lower, double upper); | |
| double loMargin() const; | | double lowerMargin() const; | |
| double hiMargin() const; | | double upperMargin() const; | |
| | | | |
| /*! | | /*! | |
| Align and divide an interval | | Align and divide an interval | |
| | | | |
| \param maxNumSteps Max. number of steps | | \param maxNumSteps Max. number of steps | |
| \param x1 First limit of the interval (In/Out) | | \param x1 First limit of the interval (In/Out) | |
| \param x2 Second limit of the interval (In/Out) | | \param x2 Second limit of the interval (In/Out) | |
| \param stepSize Step size (Return value) | | \param stepSize Step size (Return value) | |
| */ | | */ | |
| virtual void autoScale(int maxNumSteps, | | virtual void autoScale(int maxNumSteps, | |
| | | | |
End of changes. 2 change blocks. |
| 4 lines changed or deleted | | 21 lines changed or added | |
|
| qwt_scale_map.h | | qwt_scale_map.h | |
| | | | |
| skipping to change at line 38 | | skipping to change at line 38 | |
| }; | | }; | |
| | | | |
| QwtScaleTransformation(Type type); | | QwtScaleTransformation(Type type); | |
| virtual ~QwtScaleTransformation(); | | virtual ~QwtScaleTransformation(); | |
| | | | |
| virtual double xForm(double x, double s1, double s2, | | virtual double xForm(double x, double s1, double s2, | |
| double p1, double p2) const; | | double p1, double p2) const; | |
| virtual double invXForm(double x, double s1, double s2, | | virtual double invXForm(double x, double s1, double s2, | |
| double p1, double p2) const; | | double p1, double p2) const; | |
| | | | |
|
| | | //! \return Transformation type | |
| inline Type type() const { return d_type; } | | inline Type type() const { return d_type; } | |
| | | | |
| virtual QwtScaleTransformation *copy() const; | | virtual QwtScaleTransformation *copy() const; | |
| | | | |
| private: | | private: | |
| QwtScaleTransformation(); | | QwtScaleTransformation(); | |
| QwtScaleTransformation &operator=( const QwtScaleTransformation); | | QwtScaleTransformation &operator=( const QwtScaleTransformation); | |
| | | | |
| const Type d_type; | | const Type d_type; | |
| }; | | }; | |
| | | | |
| skipping to change at line 132 | | skipping to change at line 133 | |
| } | | } | |
| | | | |
| /*! | | /*! | |
| \return Second border of the paint interval | | \return Second border of the paint interval | |
| */ | | */ | |
| inline double QwtScaleMap::p2() const | | inline double QwtScaleMap::p2() const | |
| { | | { | |
| return d_p2; | | return d_p2; | |
| } | | } | |
| | | | |
|
| | | /*! | |
| | | \return qwtAbs(p2() - p1()) | |
| | | */ | |
| inline double QwtScaleMap::pDist() const | | inline double QwtScaleMap::pDist() const | |
| { | | { | |
| return qwtAbs(d_p2 - d_p1); | | return qwtAbs(d_p2 - d_p1); | |
| } | | } | |
| | | | |
|
| | | /*! | |
| | | \return qwtAbs(s2() - s1()) | |
| | | */ | |
| inline double QwtScaleMap::sDist() const | | inline double QwtScaleMap::sDist() const | |
| { | | { | |
| return qwtAbs(d_s2 - d_s1); | | return qwtAbs(d_s2 - d_s1); | |
| } | | } | |
| | | | |
| /*! | | /*! | |
| Transform a point related to the scale interval into an point | | Transform a point related to the scale interval into an point | |
| related to the interval of the paint device | | related to the interval of the paint device | |
|
| | | | |
| | | \param s Value relative to the coordinates of the scale | |
| */ | | */ | |
| inline double QwtScaleMap::xTransform(double s) const | | inline double QwtScaleMap::xTransform(double s) const | |
| { | | { | |
| // try to inline code from QwtScaleTransformation | | // try to inline code from QwtScaleTransformation | |
| | | | |
| if ( d_transformation->type() == QwtScaleTransformation::Linear ) | | if ( d_transformation->type() == QwtScaleTransformation::Linear ) | |
| return d_p1 + (s - d_s1) * d_cnv; | | return d_p1 + (s - d_s1) * d_cnv; | |
| | | | |
| if ( d_transformation->type() == QwtScaleTransformation::Log10 ) | | if ( d_transformation->type() == QwtScaleTransformation::Log10 ) | |
| return d_p1 + log(s / d_s1) * d_cnv; | | return d_p1 + log(s / d_s1) * d_cnv; | |
| | | | |
| return d_transformation->xForm(s, d_s1, d_s2, d_p1, d_p2 ); | | return d_transformation->xForm(s, d_s1, d_s2, d_p1, d_p2 ); | |
| } | | } | |
| | | | |
| /*! | | /*! | |
|
| \brief Transform an paint device value into a value in the | | Transform an paint device value into a value in the | |
| interval of the scale. | | interval of the scale. | |
| | | | |
| | | \param p Value relative to the coordinates of the paint device | |
| | | \sa transform() | |
| */ | | */ | |
| inline double QwtScaleMap::invTransform(double p) const | | inline double QwtScaleMap::invTransform(double p) const | |
| { | | { | |
| return d_transformation->invXForm(p, d_p1, d_p2, d_s1, d_s2 ); | | return d_transformation->invXForm(p, d_p1, d_p2, d_s1, d_s2 ); | |
| } | | } | |
| | | | |
| /*! | | /*! | |
| Transform a point related to the scale interval into an point | | Transform a point related to the scale interval into an point | |
| related to the interval of the paint device and round it to | | related to the interval of the paint device and round it to | |
| an integer. (In Qt <= 3.x paint devices are integer based. ) | | an integer. (In Qt <= 3.x paint devices are integer based. ) | |
| | | | |
|
| \sa QwtScaleMap::xTransform | | \param s Value relative to the coordinates of the scale | |
| | | \sa xTransform() | |
| */ | | */ | |
| inline int QwtScaleMap::transform(double s) const | | inline int QwtScaleMap::transform(double s) const | |
| { | | { | |
| return qRound(xTransform(s)); | | return qRound(xTransform(s)); | |
| } | | } | |
| | | | |
| #endif | | #endif | |
| | | | |
End of changes. 6 change blocks. |
| 3 lines changed or deleted | | 16 lines changed or added | |
|