| qwt_polar_canvas.h | | qwt_polar_canvas.h | |
| | | | |
| skipping to change at line 12 | | skipping to change at line 12 | |
| * QwtPolar Widget Library | | * QwtPolar Widget Library | |
| * Copyright (C) 2008 Uwe Rathmann | | * Copyright (C) 2008 Uwe Rathmann | |
| * | | * | |
| * 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_POLAR_CANVAS_H | | #ifndef QWT_POLAR_CANVAS_H | |
| #define QWT_POLAR_CANVAS_H 1 | | #define QWT_POLAR_CANVAS_H 1 | |
| | | | |
|
| #include <qframe.h> | | | |
| #include "qwt_polar_global.h" | | #include "qwt_polar_global.h" | |
|
| #include "qwt_double_rect.h" | | #include <qwt_point_polar.h> | |
| | | #include <qframe.h> | |
| | | | |
| class QPainter; | | class QPainter; | |
| class QwtPolarPlot; | | class QwtPolarPlot; | |
| | | | |
| /*! | | /*! | |
| \brief Canvas of a QwtPolarPlot. | | \brief Canvas of a QwtPolarPlot. | |
| | | | |
| The canvas is the widget, where all polar items are painted to. | | The canvas is the widget, where all polar items are painted to. | |
| | | | |
| \note In opposite to QwtPlot all axes are painted on the canvas. | | \note In opposite to QwtPlot all axes are painted on the canvas. | |
| \sa QwtPolarPlot | | \sa QwtPolarPlot | |
| */ | | */ | |
| class QWT_POLAR_EXPORT QwtPolarCanvas: public QFrame | | class QWT_POLAR_EXPORT QwtPolarCanvas: public QFrame | |
| { | | { | |
| Q_OBJECT | | Q_OBJECT | |
| | | | |
| public: | | public: | |
| /*! | | /*! | |
| \brief Paint attributes | | \brief Paint attributes | |
| | | | |
|
| - PaintCached\n | | The default setting enables BackingStore | |
| Paint double buffered and reuse the content of the pixmap buffer | | | |
| for some spontaneous repaints that happen when a plot gets unhidden | | | |
| , | | | |
| deiconified or changes the focus. | | | |
| | | | |
|
| The default setting enables PaintCached | | \sa setPaintAttribute(), testPaintAttribute(), backingStore() | |
| \sa setPaintAttribute(), testPaintAttribute(), paintCache() | | | |
| */ | | */ | |
| | | | |
| enum PaintAttribute | | enum PaintAttribute | |
| { | | { | |
|
| PaintCached = 1 | | /*! | |
| | | Paint double buffered and reuse the content of the pixmap buffer | |
| | | for some spontaneous repaints that happen when a plot gets unhidd | |
| | | en, | |
| | | deiconified or changes the focus. | |
| | | */ | |
| | | BackingStore = 0x01 | |
| }; | | }; | |
| | | | |
|
| explicit QwtPolarCanvas(QwtPolarPlot *); | | //! Paint attributes | |
| | | typedef QFlags<PaintAttribute> PaintAttributes; | |
| | | | |
| | | explicit QwtPolarCanvas( QwtPolarPlot * ); | |
| virtual ~QwtPolarCanvas(); | | virtual ~QwtPolarCanvas(); | |
| | | | |
| QwtPolarPlot *plot(); | | QwtPolarPlot *plot(); | |
| const QwtPolarPlot *plot() const; | | const QwtPolarPlot *plot() const; | |
| | | | |
|
| void setPaintAttribute(PaintAttribute, bool on = true); | | void setPaintAttribute( PaintAttribute, bool on = true ); | |
| bool testPaintAttribute(PaintAttribute) const; | | bool testPaintAttribute( PaintAttribute ) const; | |
| | | | |
|
| QPixmap *paintCache(); | | const QPixmap *backingStore() const; | |
| const QPixmap *paintCache() const; | | void invalidateBackingStore(); | |
| void invalidatePaintCache(); | | | |
| | | | |
|
| protected: | | QwtPointPolar invTransform( const QPoint & ) const; | |
| virtual void paintEvent(QPaintEvent *); | | QPoint transform( const QwtPointPolar & ) const; | |
| virtual void resizeEvent(QResizeEvent *); | | | |
| | | | |
|
| virtual void drawContents(QPainter *); | | protected: | |
| | | virtual void paintEvent( QPaintEvent * ); | |
| void drawCanvas(QPainter *, const QwtDoubleRect &); | | virtual void resizeEvent( QResizeEvent * ); | |
| | | | |
|
| | | private: | |
| class PrivateData; | | class PrivateData; | |
| PrivateData *d_data; | | PrivateData *d_data; | |
| }; | | }; | |
| | | | |
|
| | | Q_DECLARE_OPERATORS_FOR_FLAGS( QwtPolarCanvas::PaintAttributes ) | |
| | | | |
| #endif | | #endif | |
| | | | |
End of changes. 12 change blocks. |
| 22 lines changed or deleted | | 27 lines changed or added | |
|
| qwt_polar_curve.h | | qwt_polar_curve.h | |
| | | | |
| skipping to change at line 13 | | skipping to change at line 13 | |
| * Copyright (C) 2008 Uwe Rathmann | | * Copyright (C) 2008 Uwe Rathmann | |
| * | | * | |
| * 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_POLAR_CURVE_H | | #ifndef QWT_POLAR_CURVE_H | |
| #define QWT_POLAR_CURVE_H | | #define QWT_POLAR_CURVE_H | |
| | | | |
| #include "qwt_polar_global.h" | | #include "qwt_polar_global.h" | |
|
| #include "qwt_data.h" | | | |
| #include "qwt_polar_point.h" | | | |
| #include "qwt_polar_item.h" | | #include "qwt_polar_item.h" | |
|
| | | #include <qwt_point_polar.h> | |
| | | #include <qwt_series_data.h> | |
| | | | |
| class QPainter; | | class QPainter; | |
| class QwtSymbol; | | class QwtSymbol; | |
| class QwtCurveFitter; | | class QwtCurveFitter; | |
| | | | |
| /*! | | /*! | |
| \brief An item, that represents a series of points | | \brief An item, that represents a series of points | |
| | | | |
| A curve is the representation of a series of points in polar coordinates. | | A curve is the representation of a series of points in polar coordinates. | |
| The points are connected to the curve using the abstract QwtData interfac
e. | | The points are connected to the curve using the abstract QwtData interfac
e. | |
| | | | |
| \sa QwtPolarPlot, QwtSymbol, QwtScaleMap | | \sa QwtPolarPlot, QwtSymbol, QwtScaleMap | |
| */ | | */ | |
| | | | |
| class QWT_POLAR_EXPORT QwtPolarCurve: public QwtPolarItem | | class QWT_POLAR_EXPORT QwtPolarCurve: public QwtPolarItem | |
| { | | { | |
| public: | | public: | |
| /*! | | /*! | |
| Curve styles. | | Curve styles. | |
|
| | | \sa setStyle(), style() | |
| - 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(). | | | |
| | | | |
| \sa setStyle() | | | |
| */ | | */ | |
| enum CurveStyle | | enum CurveStyle | |
| { | | { | |
|
| | | //! Don't draw a curve. Note: This doesn't affect the symbols. | |
| NoCurve, | | NoCurve, | |
|
| | | | |
| | | /*! | |
| | | Connect the points with straight lines. The lines might | |
| | | be interpolated depending on the 'Fitted' attribute. Curve | |
| | | fitting can be configured using setCurveFitter(). | |
| | | */ | |
| Lines, | | Lines, | |
|
| | | | |
| | | //! Values > 100 are reserved for user specific curve styles | |
| UserCurve = 100 | | UserCurve = 100 | |
| }; | | }; | |
| | | | |
|
| | | /*! | |
| | | \brief Attributes how to represent the curve on the legend | |
| | | | |
| | | If none of the flags is activated QwtPlotCurve tries to find | |
| | | a color representing the curve and paints a rectangle with it. | |
| | | In the default setting all attributes are off. | |
| | | | |
| | | \sa setLegendAttribute(), testLegendAttribute(), | |
| | | drawLegendIdentifier() | |
| | | */ | |
| | | | |
| | | enum LegendAttribute | |
| | | { | |
| | | /*! | |
| | | If the curveStyle() is not NoCurve a line is painted with the | |
| | | curvePen(). | |
| | | */ | |
| | | LegendShowLine = 0x01, | |
| | | | |
| | | //! If the curve has a valid symbol it is painted. | |
| | | LegendShowSymbol = 0x02 | |
| | | }; | |
| | | | |
| | | //! Legend attributes | |
| | | typedef QFlags<LegendAttribute> LegendAttributes; | |
| | | | |
| explicit QwtPolarCurve(); | | explicit QwtPolarCurve(); | |
|
| explicit QwtPolarCurve(const QwtText &title); | | explicit QwtPolarCurve( const QwtText &title ); | |
| explicit QwtPolarCurve(const QString &title); | | explicit QwtPolarCurve( const QString &title ); | |
| | | | |
| virtual ~QwtPolarCurve(); | | virtual ~QwtPolarCurve(); | |
| | | | |
| virtual int rtti() const; | | virtual int rtti() const; | |
| | | | |
|
| void setData(const QwtData &data); | | void setLegendAttribute( LegendAttribute, bool on = true ); | |
| QwtData &data(); | | bool testLegendAttribute( LegendAttribute ) const; | |
| const QwtData &data() const; | | | |
| | | | |
| int dataSize() const; | | | |
| double radius(int i) const; | | | |
| double azimuth(int i) const; | | | |
| QwtPolarPoint sample(int i) const; | | | |
| | | | |
|
| void setPen(const QPen &); | | void setData( QwtSeriesData<QwtPointPolar> *data ); | |
| | | const QwtSeriesData<QwtPointPolar> *data() const; | |
| | | | |
| | | size_t dataSize() const; | |
| | | QwtPointPolar sample( int i ) const; | |
| | | | |
| | | void setPen( const QPen & ); | |
| const QPen &pen() const; | | const QPen &pen() const; | |
| | | | |
|
| void setStyle(CurveStyle style); | | void setStyle( CurveStyle style ); | |
| CurveStyle style() const; | | CurveStyle style() const; | |
| | | | |
|
| void setSymbol(const QwtSymbol &s); | | void setSymbol( const QwtSymbol * ); | |
| const QwtSymbol& symbol() const; | | const QwtSymbol *symbol() const; | |
| | | | |
|
| void setCurveFitter(QwtCurveFitter *); | | void setCurveFitter( QwtCurveFitter * ); | |
| QwtCurveFitter *curveFitter() const; | | QwtCurveFitter *curveFitter() const; | |
| | | | |
|
| virtual void draw(QPainter *p, | | virtual void draw( QPainter *p, | |
| const QwtScaleMap &azimuthMap, const QwtScaleMap &radialMap, | | const QwtScaleMap &azimuthMap, const QwtScaleMap &radialMap, | |
|
| const QwtDoublePoint &pole, double radius, | | const QPointF &pole, double radius, | |
| const QwtDoubleRect &canvasRect) const; | | const QRectF &canvasRect ) const; | |
| | | | |
|
| virtual void draw(QPainter *p, | | virtual void draw( QPainter *p, | |
| const QwtScaleMap &azimuthMap, const QwtScaleMap &radialMap, | | const QwtScaleMap &azimuthMap, const QwtScaleMap &radialMap, | |
|
| const QwtDoublePoint &pole, | | const QPointF &pole, int from, int to ) const; | |
| int from, int to) const; | | | |
| | | | |
|
| virtual void updateLegend(QwtLegend *) const; | | virtual void updateLegend( QwtLegend * ) const; | |
| virtual QwtDoubleInterval boundingInterval(int scaleId) const; | | virtual QwtInterval boundingInterval( int scaleId ) const; | |
| | | | |
| | | virtual void drawLegendIdentifier( QPainter *, const QRectF & ) const; | |
| | | | |
| protected: | | protected: | |
| | | | |
| void init(); | | void init(); | |
| | | | |
|
| virtual void drawCurve(QPainter *, int style, | | virtual void drawCurve( QPainter *, int style, | |
| const QwtScaleMap &azimuthMap, const QwtScaleMap &radialMap, | | const QwtScaleMap &azimuthMap, const QwtScaleMap &radialMap, | |
|
| const QwtDoublePoint &pole, | | const QPointF &pole, int from, int to ) const; | |
| int from, int to) const; | | | |
| | | | |
|
| virtual void drawSymbols(QPainter *, const QwtSymbol &, | | virtual void drawSymbols( QPainter *, const QwtSymbol &, | |
| const QwtScaleMap &azimuthMap, const QwtScaleMap &radialMap, | | const QwtScaleMap &azimuthMap, const QwtScaleMap &radialMap, | |
|
| const QwtDoublePoint &pole, | | const QPointF &pole, int from, int to ) const; | |
| int from, int to) const; | | | |
| | | | |
|
| void drawLines(QPainter *, | | void drawLines( QPainter *, | |
| const QwtScaleMap &azimuthMap, const QwtScaleMap &radialMap, | | const QwtScaleMap &azimuthMap, const QwtScaleMap &radialMap, | |
|
| const QwtDoublePoint &pole, | | const QPointF &pole, int from, int to ) const; | |
| int from, int to) const; | | | |
| | | | |
| private: | | private: | |
|
| QwtData *d_points; | | QwtSeriesData<QwtPointPolar> *d_series; | |
| | | | |
| class PrivateData; | | class PrivateData; | |
| PrivateData *d_data; | | PrivateData *d_data; | |
| }; | | }; | |
| | | | |
| //! \return the the curve data | | //! \return the the curve data | |
|
| inline QwtData &QwtPolarCurve::data() | | inline const QwtSeriesData<QwtPointPolar> *QwtPolarCurve::data() const | |
| { | | { | |
|
| return *d_points; | | return d_series; | |
| } | | | |
| | | | |
| //! \return the the curve data | | | |
| inline const QwtData &QwtPolarCurve::data() const | | | |
| { | | | |
| return *d_points; | | | |
| } | | | |
| | | | |
| /*! | | | |
| \param i index | | | |
| \return azimuth at position i | | | |
| */ | | | |
| inline double QwtPolarCurve::azimuth(int i) const | | | |
| { | | | |
| return d_points->x(i); | | | |
| } | | | |
| | | | |
| /*! | | | |
| \param i index | | | |
| \return radius at position i | | | |
| */ | | | |
| inline double QwtPolarCurve::radius(int i) const | | | |
| { | | | |
| return d_points->y(i); | | | |
| } | | } | |
| | | | |
| /*! | | /*! | |
| \param i index | | \param i index | |
| \return point at position i | | \return point at position i | |
| */ | | */ | |
|
| inline QwtPolarPoint QwtPolarCurve::sample(int i) const | | inline QwtPointPolar QwtPolarCurve::sample( int i ) const | |
| { | | { | |
|
| return QwtPolarPoint(azimuth(i), radius(i)); | | return d_series->sample( i ); | |
| } | | } | |
| | | | |
|
| | | Q_DECLARE_OPERATORS_FOR_FLAGS( QwtPolarCurve::LegendAttributes ) | |
| | | | |
| #endif | | #endif | |
| | | | |
End of changes. 30 change blocks. |
| 72 lines changed or deleted | | 75 lines changed or added | |
|
| qwt_polar_grid.h | | qwt_polar_grid.h | |
| | | | |
| skipping to change at line 16 | | skipping to change at line 16 | |
| * 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_POLAR_GRID_H | | #ifndef QWT_POLAR_GRID_H | |
| #define QWT_POLAR_GRID_H | | #define QWT_POLAR_GRID_H | |
| | | | |
| #include "qwt_polar_global.h" | | #include "qwt_polar_global.h" | |
| #include "qwt_polar.h" | | #include "qwt_polar.h" | |
| #include "qwt_polar_item.h" | | #include "qwt_polar_item.h" | |
| #include "qwt_polar_plot.h" | | #include "qwt_polar_plot.h" | |
|
| #include "qwt_scale_div.h" | | | |
| | | | |
| class QPainter; | | class QPainter; | |
| class QPen; | | class QPen; | |
| class QwtScaleMap; | | class QwtScaleMap; | |
| class QwtScaleDiv; | | class QwtScaleDiv; | |
| class QwtRoundScaleDraw; | | class QwtRoundScaleDraw; | |
| class QwtScaleDraw; | | class QwtScaleDraw; | |
| | | | |
| /*! | | /*! | |
| \brief An item which draws scales and grid lines on a polar plot. | | \brief An item which draws scales and grid lines on a polar plot. | |
| | | | |
| skipping to change at line 49 | | skipping to change at line 48 | |
| \sa QwtPolarPlot, QwtPolar::Axis | | \sa QwtPolarPlot, QwtPolar::Axis | |
| */ | | */ | |
| | | | |
| class QWT_POLAR_EXPORT QwtPolarGrid: public QwtPolarItem | | class QWT_POLAR_EXPORT QwtPolarGrid: public QwtPolarItem | |
| { | | { | |
| public: | | public: | |
| /*! | | /*! | |
| Mysterious flags trying to avoid conflicts, when painting the | | Mysterious flags trying to avoid conflicts, when painting the | |
| scales and grid lines. | | scales and grid lines. | |
| | | | |
|
| - SmartOriginLabel\n | | The default setting enables all flags. | |
| Try to avoid situations, where the label of the origin is | | | |
| painted over another axis. | | \sa setDisplayFlag(), testDisplayFlag() | |
| - HideMaxRadiusLabel\n | | */ | |
| | | enum DisplayFlag | |
| | | { | |
| | | /*! | |
| | | Try to avoid situations, where the label of the origin is | |
| | | painted over another axis. | |
| | | */ | |
| | | SmartOriginLabel = 1, | |
| | | | |
| | | /*! | |
| Often the outermost tick of the radial scale is close to the | | Often the outermost tick of the radial scale is close to the | |
| canvas border. With HideMaxRadiusLabel enabled it is not painted. | | canvas border. With HideMaxRadiusLabel enabled it is not painted. | |
|
| - ClipAxisBackground\n | | */ | |
| | | HideMaxRadiusLabel = 2, | |
| | | | |
| | | /*! | |
| The tick labels of the radial scales might be hard to read, when | | The tick labels of the radial scales might be hard to read, when | |
| they are painted on top of the radial grid lines ( or on top | | they are painted on top of the radial grid lines ( or on top | |
| of a curve/spectrogram ). When ClipAxisBackground the bounding rect | | of a curve/spectrogram ). When ClipAxisBackground the bounding rect | |
| of each label is added to the clip region. | | of each label is added to the clip region. | |
|
| - SmartScaleDraw\n | | */ | |
| | | ClipAxisBackground = 4, | |
| | | | |
| | | /*! | |
| Don't paint the backbone of the radial axes, when they are very clo
se | | Don't paint the backbone of the radial axes, when they are very clo
se | |
| to a line of the azimuth grid. | | to a line of the azimuth grid. | |
|
| - ClipGridLines\n | | */ | |
| | | SmartScaleDraw = 8, | |
| | | | |
| | | /*! | |
| All grid lines are clipped against the plot area before being paint
ed. | | All grid lines are clipped against the plot area before being paint
ed. | |
| When the plot is zoomed in this will have an significant impact | | When the plot is zoomed in this will have an significant impact | |
| on the performance of the painting cde. | | on the performance of the painting cde. | |
|
| | | */ | |
| The default setting enables all flags. | | | |
| */ | | | |
| enum DisplayFlag | | | |
| { | | | |
| SmartOriginLabel = 1, | | | |
| HideMaxRadiusLabel = 2, | | | |
| ClipAxisBackground = 4, | | | |
| SmartScaleDraw = 8, | | | |
| ClipGridLines = 16 | | ClipGridLines = 16 | |
| }; | | }; | |
| | | | |
|
| | | //! Display flags | |
| | | typedef QFlags<DisplayFlag> DisplayFlags; | |
| | | | |
| /*! | | /*! | |
| \brief Grid attributes | | \brief Grid attributes | |
|
| | | \sa setGridAttributes(), testGridAttributes() | |
| - AutoScaling\n | | | |
| When AutoScaling is enabled, the radial axes will be adjusted | | | |
| to the interval, that is currently visible on the canvas plot. | | | |
| */ | | */ | |
| enum GridAttribute | | enum GridAttribute | |
| { | | { | |
|
| AutoScaling = 1 | | /*! | |
| | | When AutoScaling is enabled, the radial axes will be adjusted | |
| | | to the interval, that is currently visible on the canvas plot. | |
| | | */ | |
| | | AutoScaling = 0x01 | |
| }; | | }; | |
| | | | |
|
| | | //! Grid attributes | |
| | | typedef QFlags<GridAttribute> GridAttributes; | |
| | | | |
| explicit QwtPolarGrid(); | | explicit QwtPolarGrid(); | |
| virtual ~QwtPolarGrid(); | | virtual ~QwtPolarGrid(); | |
| | | | |
| virtual int rtti() const; | | virtual int rtti() const; | |
| | | | |
|
| void setDisplayFlag(DisplayFlag, bool on = true); | | void setDisplayFlag( DisplayFlag, bool on = true ); | |
| bool testDisplayFlag(DisplayFlag) const; | | bool testDisplayFlag( DisplayFlag ) const; | |
| | | | |
|
| void setGridAttribute(GridAttribute, bool on = true); | | void setGridAttribute( GridAttribute, bool on = true ); | |
| bool testGridAttribute(GridAttribute) const; | | bool testGridAttribute( GridAttribute ) const; | |
| | | | |
|
| void showGrid(int scaleId, bool show = true); | | void showGrid( int scaleId, bool show = true ); | |
| bool isGridVisible(int scaleId) const; | | bool isGridVisible( int scaleId ) const; | |
| | | | |
|
| void showMinorGrid(int scaleId, bool show = true); | | void showMinorGrid( int scaleId, bool show = true ); | |
| bool isMinorGridVisible(int scaleId) const; | | bool isMinorGridVisible( int scaleId ) const; | |
| | | | |
|
| void showAxis(int axisId, bool show = true); | | void showAxis( int axisId, bool show = true ); | |
| bool isAxisVisible(int axisId) const; | | bool isAxisVisible( int axisId ) const; | |
| | | | |
|
| void setPen(const QPen &p); | | void setPen( const QPen &p ); | |
| void setFont(const QFont &); | | void setFont( const QFont & ); | |
| | | | |
|
| void setMajorGridPen(const QPen &p); | | void setMajorGridPen( const QPen &p ); | |
| void setMajorGridPen(int scaleId, const QPen &p); | | void setMajorGridPen( int scaleId, const QPen &p ); | |
| QPen majorGridPen(int scaleId) const; | | QPen majorGridPen( int scaleId ) const; | |
| | | | |
|
| void setMinorGridPen(const QPen &p); | | void setMinorGridPen( const QPen &p ); | |
| void setMinorGridPen(int scaleId, const QPen &p); | | void setMinorGridPen( int scaleId, const QPen &p ); | |
| QPen minorGridPen(int scaleId) const; | | QPen minorGridPen( int scaleId ) const; | |
| | | | |
|
| void setAxisPen(int axisId, const QPen &p); | | void setAxisPen( int axisId, const QPen &p ); | |
| QPen axisPen(int axisId) const; | | QPen axisPen( int axisId ) const; | |
| | | | |
|
| void setAxisFont(int axisId, const QFont &p); | | void setAxisFont( int axisId, const QFont &p ); | |
| QFont axisFont(int axisId) const; | | QFont axisFont( int axisId ) const; | |
| | | | |
|
| virtual void draw(QPainter *p, | | void setScaleDraw( int axisId, QwtScaleDraw * ); | |
| | | const QwtScaleDraw *scaleDraw( int axisId ) const; | |
| | | QwtScaleDraw *scaleDraw( int axisId ); | |
| | | | |
| | | void setAzimuthScaleDraw( QwtRoundScaleDraw * ); | |
| | | const QwtRoundScaleDraw *azimuthScaleDraw() const; | |
| | | QwtRoundScaleDraw *azimuthScaleDraw(); | |
| | | | |
| | | virtual void draw( QPainter *p, | |
| const QwtScaleMap &azimuthMap, const QwtScaleMap &radialMap, | | const QwtScaleMap &azimuthMap, const QwtScaleMap &radialMap, | |
|
| const QwtDoublePoint &pole, double radius, | | const QPointF &pole, double radius, | |
| const QwtDoubleRect &rect) const; | | const QRectF &rect ) const; | |
| | | | |
|
| virtual void updateScaleDiv(const QwtScaleDiv &azimuthMap, | | virtual void updateScaleDiv( const QwtScaleDiv &azimuthMap, | |
| const QwtScaleDiv &radialMap, const QwtDoubleInterval &); | | const QwtScaleDiv &radialMap, const QwtInterval & ); | |
| | | | |
| virtual int marginHint() const; | | virtual int marginHint() const; | |
| | | | |
| protected: | | protected: | |
|
| void drawRays(QPainter *, const QwtDoubleRect &, | | void drawRays( QPainter *, const QRectF &, | |
| const QwtDoublePoint &pole, double radius, | | const QPointF &pole, double radius, | |
| const QwtScaleMap &azimuthMap, const QwtValueList &) const; | | const QwtScaleMap &azimuthMap, const QList<double> & ) const; | |
| void drawCircles(QPainter *, const QwtDoubleRect &, | | void drawCircles( QPainter *, const QRectF &, | |
| const QwtDoublePoint &pole, const QwtScaleMap &radialMap, | | const QPointF &pole, const QwtScaleMap &radialMap, | |
| const QwtValueList &) const; | | const QList<double> & ) const; | |
| | | | |
|
| void drawAxis(QPainter *, int axisId) const; | | void drawAxis( QPainter *, int axisId ) const; | |
| | | | |
| private: | | private: | |
| void updateScaleDraws( | | void updateScaleDraws( | |
| const QwtScaleMap &azimuthMap, const QwtScaleMap &radialMap, | | const QwtScaleMap &azimuthMap, const QwtScaleMap &radialMap, | |
|
| const QwtDoublePoint &pole, const double radius) const; | | const QPointF &pole, const double radius ) const; | |
| | | | |
| private: | | private: | |
| class GridData; | | class GridData; | |
| class AxisData; | | class AxisData; | |
| class PrivateData; | | class PrivateData; | |
| PrivateData *d_data; | | PrivateData *d_data; | |
| }; | | }; | |
| | | | |
|
| | | Q_DECLARE_OPERATORS_FOR_FLAGS( QwtPolarGrid::DisplayFlags ) | |
| | | Q_DECLARE_OPERATORS_FOR_FLAGS( QwtPolarGrid::GridAttributes ) | |
| | | | |
| #endif | | #endif | |
| | | | |
End of changes. 27 change blocks. |
| 57 lines changed or deleted | | 84 lines changed or added | |
|
| qwt_polar_item.h | | qwt_polar_item.h | |
| | | | |
| skipping to change at line 13 | | skipping to change at line 13 | |
| * Copyright (C) 2008 Uwe Rathmann | | * Copyright (C) 2008 Uwe Rathmann | |
| * | | * | |
| * 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_POLAR_ITEM_H | | #ifndef QWT_POLAR_ITEM_H | |
| #define QWT_POLAR_ITEM_H | | #define QWT_POLAR_ITEM_H | |
| | | | |
| #include "qwt_polar_global.h" | | #include "qwt_polar_global.h" | |
|
| #include "qwt_text.h" | | #include <qwt_text.h> | |
| #include "qwt_legend_itemmanager.h" | | #include <qwt_legend_itemmanager.h> | |
| #include "qwt_double_interval.h" | | #include <qwt_interval.h> | |
| #include "qwt_double_rect.h" | | | |
| | | | |
| class QString; | | class QString; | |
| class QRect; | | class QRect; | |
|
| | | class QPointF; | |
| class QPainter; | | class QPainter; | |
| class QwtPolarPlot; | | class QwtPolarPlot; | |
| class QwtScaleMap; | | class QwtScaleMap; | |
| class QwtScaleDiv; | | class QwtScaleDiv; | |
| | | | |
| /*! | | /*! | |
| \brief Base class for items on a polar plot | | \brief Base class for items on a polar plot | |
| | | | |
| A QwtPolarItem is "something that can be painted on the canvas". | | A QwtPolarItem is "something that can be painted on the canvas". | |
| It is connected to the QwtPolar framework by a couple of virtual | | It is connected to the QwtPolar framework by a couple of virtual | |
| | | | |
| skipping to change at line 47 | | skipping to change at line 47 | |
| { | | { | |
| public: | | public: | |
| /*! | | /*! | |
| \brief Runtime type information | | \brief Runtime type information | |
| | | | |
| RttiValues is used to cast plot items, without | | RttiValues is used to cast plot items, without | |
| having to enable runtime type information of the compiler. | | having to enable runtime type information of the compiler. | |
| */ | | */ | |
| enum RttiValues | | enum RttiValues | |
| { | | { | |
|
| | | //! Unspecific value, that can be used, when it doesn't matter | |
| Rtti_PolarItem = 0, | | Rtti_PolarItem = 0, | |
| | | | |
|
| | | //! For QwtPolarGrid | |
| Rtti_PolarGrid, | | Rtti_PolarGrid, | |
|
| Rtti_PolarScale, | | | |
| | | //! For QwtPolarMarker | |
| Rtti_PolarMarker, | | Rtti_PolarMarker, | |
|
| | | | |
| | | //! For QwtPolarCurve | |
| Rtti_PolarCurve, | | Rtti_PolarCurve, | |
|
| | | | |
| | | //! For QwtPolarSpectrogram | |
| Rtti_PolarSpectrogram, | | Rtti_PolarSpectrogram, | |
| | | | |
|
| | | /*! | |
| | | Values >= Rtti_PolarUserItem are reserved for plot items | |
| | | not implemented in the QwtPolar library. | |
| | | */ | |
| Rtti_PolarUserItem = 1000 | | Rtti_PolarUserItem = 1000 | |
| }; | | }; | |
| | | | |
| /*! | | /*! | |
| \brief Plot Item Attributes | | \brief 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() | | \sa setItemAttribute(), testItemAttribute() | |
| */ | | */ | |
| enum ItemAttribute | | enum ItemAttribute | |
| { | | { | |
|
| Legend = 1, | | //! The item is represented on the legend. | |
| AutoScale = 2 | | Legend = 0x01, | |
| | | | |
| | | /*! | |
| | | The boundingRect() of the item is included in the | |
| | | autoscaling calculation. | |
| | | */ | |
| | | AutoScale = 0x02 | |
| }; | | }; | |
| | | | |
|
| #if QT_VERSION >= 0x040000 | | //! Item attributes | |
| //! Render hints | | typedef QFlags<ItemAttribute> ItemAttributes; | |
| | | | |
| | | /*! | |
| | | \brief Render hints | |
| | | \sa setRenderHint(), testRenderHint() | |
| | | */ | |
| enum RenderHint | | enum RenderHint | |
| { | | { | |
|
| RenderAntialiased = 1 | | //! Enable antialiasing | |
| | | RenderAntialiased = 0x01 | |
| }; | | }; | |
|
| #endif | | | |
| | | | |
|
| explicit QwtPolarItem(const QwtText &title = QwtText()); | | //! Item attributes | |
| | | typedef QFlags<RenderHint> RenderHints; | |
| | | | |
| | | explicit QwtPolarItem( const QwtText &title = QwtText() ); | |
| virtual ~QwtPolarItem(); | | virtual ~QwtPolarItem(); | |
| | | | |
|
| void attach(QwtPolarPlot *plot); | | void attach( QwtPolarPlot *plot ); | |
| | | | |
| /*! | | /*! | |
| \brief This method detaches a QwtPolarItem from any QwtPolarPlot it | | \brief This method detaches a QwtPolarItem from any QwtPolarPlot it | |
| has been associated with. | | has been associated with. | |
| | | | |
| detach() is equivalent to calling attach( NULL ) | | detach() is equivalent to calling attach( NULL ) | |
| \sa attach( QwtPolarPlot* plot ) | | \sa attach( QwtPolarPlot* plot ) | |
| */ | | */ | |
|
| void detach() { attach(NULL); } | | void detach() { attach( NULL ); } | |
| | | | |
| QwtPolarPlot *plot() const; | | QwtPolarPlot *plot() const; | |
| | | | |
|
| void setTitle(const QString &title); | | void setTitle( const QString &title ); | |
| void setTitle(const QwtText &title); | | void setTitle( const QwtText &title ); | |
| const QwtText &title() const; | | const QwtText &title() const; | |
| | | | |
| virtual int rtti() const; | | virtual int rtti() const; | |
| | | | |
|
| void setItemAttribute(ItemAttribute, bool on = true); | | void setItemAttribute( ItemAttribute, bool on = true ); | |
| bool testItemAttribute(ItemAttribute) const; | | bool testItemAttribute( ItemAttribute ) const; | |
| | | | |
|
| #if QT_VERSION >= 0x040000 | | void setRenderHint( RenderHint, bool on = true ); | |
| void setRenderHint(RenderHint, bool on = true); | | bool testRenderHint( RenderHint ) const; | |
| bool testRenderHint(RenderHint) const; | | | |
| #endif | | | |
| | | | |
| double z() const; | | double z() const; | |
|
| void setZ(double z); | | void setZ( double z ); | |
| | | | |
| void show(); | | void show(); | |
| void hide(); | | void hide(); | |
|
| virtual void setVisible(bool); | | virtual void setVisible( bool ); | |
| bool isVisible () const; | | bool isVisible () const; | |
| | | | |
| virtual void itemChanged(); | | virtual void itemChanged(); | |
| | | | |
| /*! | | /*! | |
| \brief Draw the item | | \brief Draw the item | |
| | | | |
| \param painter Painter | | \param painter Painter | |
| \param azimuthMap Maps azimuth values to values related to 0.0, M_2PI | | \param azimuthMap Maps azimuth values to values related to 0.0, M_2PI | |
| \param radialMap Maps radius values into painter coordinates. | | \param radialMap Maps radius values into painter coordinates. | |
| \param pole Position of the pole in painter coordinates | | \param pole Position of the pole in painter coordinates | |
| \param radius Radius of the complete plot area in painter coordinates | | \param radius Radius of the complete plot area in painter coordinates | |
| \param canvasRect Contents rect of the canvas in painter coordinates | | \param canvasRect Contents rect of the canvas in painter coordinates | |
| */ | | */ | |
|
| virtual void draw(QPainter *painter, | | virtual void draw( QPainter *painter, | |
| const QwtScaleMap &azimuthMap, const QwtScaleMap &radialMap, | | const QwtScaleMap &azimuthMap, const QwtScaleMap &radialMap, | |
|
| const QwtDoublePoint &pole, double radius, | | const QPointF &pole, double radius, | |
| const QwtDoubleRect &canvasRect) const = 0; | | const QRectF &canvasRect ) const = 0; | |
| | | | |
|
| virtual QwtDoubleInterval boundingInterval(int scaleId) const; | | virtual QwtInterval boundingInterval( int scaleId ) const; | |
| | | | |
| virtual QWidget *legendItem() const; | | virtual QWidget *legendItem() const; | |
| | | | |
|
| virtual void updateLegend(QwtLegend *) const; | | virtual void updateLegend( QwtLegend * ) const; | |
| virtual void updateScaleDiv(const QwtScaleDiv &, | | virtual void updateScaleDiv( const QwtScaleDiv &, | |
| const QwtScaleDiv &, const QwtDoubleInterval &); | | const QwtScaleDiv &, const QwtInterval & ); | |
| | | | |
| virtual int marginHint() const; | | virtual int marginHint() const; | |
| | | | |
| private: | | private: | |
| // Disabled copy constructor and operator= | | // Disabled copy constructor and operator= | |
| QwtPolarItem( const QwtPolarItem & ); | | QwtPolarItem( const QwtPolarItem & ); | |
| QwtPolarItem &operator=( const QwtPolarItem & ); | | QwtPolarItem &operator=( const QwtPolarItem & ); | |
| | | | |
| class PrivateData; | | class PrivateData; | |
| PrivateData *d_data; | | PrivateData *d_data; | |
| }; | | }; | |
| | | | |
|
| | | Q_DECLARE_OPERATORS_FOR_FLAGS( QwtPolarItem::ItemAttributes ) | |
| | | Q_DECLARE_OPERATORS_FOR_FLAGS( QwtPolarItem::RenderHints ) | |
| | | | |
| #endif | | #endif | |
| | | | |
End of changes. 26 change blocks. |
| 38 lines changed or deleted | | 57 lines changed or added | |
|
| qwt_polar_itemdict.h | | qwt_polar_itemdict.h | |
| | | | |
| skipping to change at line 16 | | skipping to change at line 16 | |
| * 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_POLAR_ITEMDICT_H | | #ifndef QWT_POLAR_ITEMDICT_H | |
| #define QWT_POLAR_ITEMDICT_H | | #define QWT_POLAR_ITEMDICT_H | |
| | | | |
| /*! \file !*/ | | /*! \file !*/ | |
| | | | |
| #include "qwt_polar_global.h" | | #include "qwt_polar_global.h" | |
| #include "qwt_polar_item.h" | | #include "qwt_polar_item.h" | |
|
| | | | |
| #if QT_VERSION < 0x040000 | | | |
| #include <qvaluelist.h> | | | |
| typedef QValueListConstIterator<QwtPolarItem *> QwtPolarItemIterator; | | | |
| /// \var typedef QValueList< QwtPolarItem *> QwtPolarItemList | | | |
| /// \brief See QT 3.x assistant documentation for QValueList | | | |
| typedef QValueList<QwtPolarItem *> QwtPolarItemList; | | | |
| #else | | | |
| #include <qlist.h> | | #include <qlist.h> | |
|
| | | | |
| typedef QList<QwtPolarItem *>::ConstIterator QwtPolarItemIterator; | | typedef QList<QwtPolarItem *>::ConstIterator QwtPolarItemIterator; | |
| /// \var typedef QList< QwtPolarItem *> QwtPolarItemList | | /// \var typedef QList< QwtPolarItem *> QwtPolarItemList | |
| /// \brief See QT 4.x assistant documentation for QList | | /// \brief See QT 4.x assistant documentation for QList | |
| typedef QList<QwtPolarItem *> QwtPolarItemList; | | typedef QList<QwtPolarItem *> QwtPolarItemList; | |
|
| #endif | | | |
| | | | |
| /*! | | /*! | |
| \brief A dictionary for polar plot items | | \brief A dictionary for polar plot items | |
| | | | |
| QwtPolarItemDict organizes polar plot items in increasing z-order. | | QwtPolarItemDict organizes polar plot items in increasing z-order. | |
| If autoDelete() is enabled, all attached items will be deleted | | If autoDelete() is enabled, all attached items will be deleted | |
| in the destructor of the dictionary. | | in the destructor of the dictionary. | |
| | | | |
| \sa QwtPolarItem::attach(), QwtPolarItem::detach(), QwtPolarItem::z() | | \sa QwtPolarItem::attach(), QwtPolarItem::detach(), QwtPolarItem::z() | |
| */ | | */ | |
| class QWT_POLAR_EXPORT QwtPolarItemDict | | class QWT_POLAR_EXPORT QwtPolarItemDict | |
| { | | { | |
| public: | | public: | |
| explicit QwtPolarItemDict(); | | explicit QwtPolarItemDict(); | |
| ~QwtPolarItemDict(); | | ~QwtPolarItemDict(); | |
| | | | |
|
| void setAutoDelete(bool); | | void setAutoDelete( bool ); | |
| bool autoDelete() const; | | bool autoDelete() const; | |
| | | | |
| const QwtPolarItemList& itemList() const; | | const QwtPolarItemList& itemList() const; | |
| | | | |
|
| void detachItems(int rtti = QwtPolarItem::Rtti_PolarItem, | | void detachItems( int rtti = QwtPolarItem::Rtti_PolarItem, | |
| bool autoDelete = true); | | bool autoDelete = true ); | |
| | | | |
| private: | | private: | |
| friend class QwtPolarItem; | | friend class QwtPolarItem; | |
| | | | |
|
| void attachItem(QwtPolarItem *, bool); | | void attachItem( QwtPolarItem *, bool ); | |
| | | | |
| class PrivateData; | | class PrivateData; | |
| PrivateData *d_data; | | PrivateData *d_data; | |
| }; | | }; | |
| | | | |
| #endif | | #endif | |
| | | | |
End of changes. 6 change blocks. |
| 13 lines changed or deleted | | 5 lines changed or added | |
|
| qwt_polar_layout.h | | qwt_polar_layout.h | |
| | | | |
| skipping to change at line 12 | | skipping to change at line 12 | |
| * QwtPolar Widget Library | | * QwtPolar Widget Library | |
| * Copyright (C) 2008 Uwe Rathmann | | * Copyright (C) 2008 Uwe Rathmann | |
| * | | * | |
| * 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_POLAR_LAYOUT_H | | #ifndef QWT_POLAR_LAYOUT_H | |
| #define QWT_POLAR_LAYOUT_H | | #define QWT_POLAR_LAYOUT_H | |
| | | | |
|
| #include "qwt_global.h" | | #include "qwt_polar_global.h" | |
| #include "qwt_polar_plot.h" | | #include "qwt_polar_plot.h" | |
| | | | |
| /*! | | /*! | |
| \brief Layout class for QwtPolarPlot. | | \brief Layout class for QwtPolarPlot. | |
| | | | |
| Organizes the geometry for the different QwtPolarPlot components. | | Organizes the geometry for the different QwtPolarPlot components. | |
| It is used by the QwtPolar widget to organize its internal widgets | | It is used by the QwtPolar widget to organize its internal widgets | |
|
| or by QwtPolarPlot::renderTo() to render its content to a QPaintDevice li
ke | | or by QwtPolarRnderer to render its content to a QPaintDevice like | |
| a QPrinter, QPixmap/QImage or QSvgRenderer. | | a QPrinter, QPixmap/QImage or QSvgRenderer. | |
| */ | | */ | |
| | | | |
| class QWT_POLAR_EXPORT QwtPolarLayout | | class QWT_POLAR_EXPORT QwtPolarLayout | |
| { | | { | |
| public: | | public: | |
|
| /*! | | | |
| Options to configure the plot layout engine | | | |
| | | | |
|
| - IgnoreScrollbars\n | | //! \brief Options to configure the plot layout engine | |
| Ignore the dimension of the scrollbars. There are no | | enum Option | |
| scrollbars, when the plot is rendered to a paint device | | | |
| (QwtPolarPlot::renderTo() ). | | | |
| - IgnoreFrames\n | | | |
| Ignore all frames. QwtPolarPlot::renderTo() doesn't paint them. | | | |
| - IgnoreTitle\n | | | |
| Ignore the title. | | | |
| - IgnoreLegend\n | | | |
| Ignore the legend. | | | |
| */ | | | |
| | | | |
| enum Options | | | |
| { | | { | |
|
| IgnoreScrollbars = 1, | | //! Ignore the dimension of the scrollbars. | |
| IgnoreFrames = 2, | | IgnoreScrollbars = 0x01, | |
| IgnoreTitle = 4, | | | |
| IgnoreLegend = 8 | | //! Ignore all frames. | |
| | | IgnoreFrames = 0x02, | |
| | | | |
| | | //! Ignore the title. | |
| | | IgnoreTitle = 0x04, | |
| | | | |
| | | //! Ignore the legend. | |
| | | IgnoreLegend = 0x08 | |
| }; | | }; | |
| | | | |
|
| | | //! Options to configure the plot layout engine | |
| | | typedef QFlags<Option> Options; | |
| | | | |
| explicit QwtPolarLayout(); | | explicit QwtPolarLayout(); | |
| virtual ~QwtPolarLayout(); | | virtual ~QwtPolarLayout(); | |
| | | | |
|
| void setLegendPosition(QwtPolarPlot::LegendPosition pos, double ratio); | | void setLegendPosition( QwtPolarPlot::LegendPosition pos, double ratio | |
| void setLegendPosition(QwtPolarPlot::LegendPosition pos); | | ); | |
| | | void setLegendPosition( QwtPolarPlot::LegendPosition pos ); | |
| QwtPolarPlot::LegendPosition legendPosition() const; | | QwtPolarPlot::LegendPosition legendPosition() const; | |
| | | | |
|
| void setLegendRatio(double ratio); | | void setLegendRatio( double ratio ); | |
| double legendRatio() const; | | double legendRatio() const; | |
| | | | |
|
| virtual QSize minimumSizeHint(const QwtPolarPlot *) const; | | virtual void activate( const QwtPolarPlot *, | |
| | | const QRectF &rect, Options options = 0 ); | |
| virtual void activate(const QwtPolarPlot *, | | | |
| const QRect &rect, int options = 0); | | | |
| | | | |
| virtual void invalidate(); | | virtual void invalidate(); | |
| | | | |
|
| const QRect &titleRect() const; | | const QRectF &titleRect() const; | |
| const QRect &legendRect() const; | | const QRectF &legendRect() const; | |
| const QRect &canvasRect() const; | | const QRectF &canvasRect() const; | |
| | | | |
| class LayoutData; | | class LayoutData; | |
| | | | |
| protected: | | protected: | |
|
| QRect layoutLegend(int options, const QRect &) const; | | QRectF layoutLegend( Options options, QRectF & ) const; | |
| | | | |
| private: | | private: | |
| class PrivateData; | | class PrivateData; | |
| PrivateData *d_data; | | PrivateData *d_data; | |
| }; | | }; | |
| | | | |
|
| | | Q_DECLARE_OPERATORS_FOR_FLAGS( QwtPolarLayout::Options ) | |
| | | | |
| #endif | | #endif | |
| | | | |
End of changes. 12 change blocks. |
| 32 lines changed or deleted | | 30 lines changed or added | |
|
| qwt_polar_marker.h | | qwt_polar_marker.h | |
| | | | |
| skipping to change at line 12 | | skipping to change at line 12 | |
| * QwtPolar Widget Library | | * QwtPolar Widget Library | |
| * Copyright (C) 2008 Uwe Rathmann | | * Copyright (C) 2008 Uwe Rathmann | |
| * | | * | |
| * 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_POLAR_MARKER_H | | #ifndef QWT_POLAR_MARKER_H | |
| #define QWT_POLAR_MARKER_H | | #define QWT_POLAR_MARKER_H | |
| | | | |
|
| #include <qstring.h> | | | |
| #include "qwt_polar_global.h" | | #include "qwt_polar_global.h" | |
|
| #include "qwt_polar_point.h" | | | |
| #include "qwt_polar_item.h" | | #include "qwt_polar_item.h" | |
|
| | | #include <qwt_point_polar.h> | |
| | | #include <qstring.h> | |
| | | | |
| class QRect; | | class QRect; | |
| class QwtText; | | class QwtText; | |
| class QwtSymbol; | | class QwtSymbol; | |
| | | | |
| /*! | | /*! | |
| \brief A class for drawing markers | | \brief A class for drawing markers | |
| | | | |
| A marker can be a a symbol, a label or a combination of them, which can | | A marker can be a a symbol, a label or a combination of them, which can | |
| be drawn around a center point inside a bounding rectangle. | | be drawn around a center point inside a bounding rectangle. | |
| | | | |
| skipping to change at line 46 | | skipping to change at line 46 | |
| */ | | */ | |
| | | | |
| class QWT_POLAR_EXPORT QwtPolarMarker: public QwtPolarItem | | class QWT_POLAR_EXPORT QwtPolarMarker: public QwtPolarItem | |
| { | | { | |
| public: | | public: | |
| explicit QwtPolarMarker(); | | explicit QwtPolarMarker(); | |
| virtual ~QwtPolarMarker(); | | virtual ~QwtPolarMarker(); | |
| | | | |
| virtual int rtti() const; | | virtual int rtti() const; | |
| | | | |
|
| void setPosition(const QwtPolarPoint &); | | void setPosition( const QwtPointPolar & ); | |
| QwtPolarPoint position() const; | | QwtPointPolar position() const; | |
| | | | |
|
| void setSymbol(const QwtSymbol &s); | | void setSymbol( const QwtSymbol *s ); | |
| const QwtSymbol &symbol() const; | | const QwtSymbol *symbol() const; | |
| | | | |
|
| void setLabel(const QwtText&); | | void setLabel( const QwtText& ); | |
| QwtText label() const; | | QwtText label() const; | |
| | | | |
|
| #if QT_VERSION < 0x040000 | | void setLabelAlignment( Qt::Alignment ); | |
| void setLabelAlignment(int align); | | | |
| int labelAlignment() const; | | | |
| #else | | | |
| void setLabelAlignment(Qt::Alignment); | | | |
| Qt::Alignment labelAlignment() const; | | Qt::Alignment labelAlignment() const; | |
|
| #endif | | | |
| | | | |
|
| virtual void draw(QPainter *painter, | | virtual void draw( QPainter *painter, | |
| const QwtScaleMap &azimuthMap, const QwtScaleMap &radialMap, | | const QwtScaleMap &azimuthMap, const QwtScaleMap &radialMap, | |
|
| const QwtDoublePoint &pole, double radius, | | const QPointF &pole, double radius, | |
| const QwtDoubleRect &canvasRect) const; | | const QRectF &canvasRect ) const; | |
| | | | |
|
| virtual QwtDoubleInterval boundingInterval(int scaleId) const; | | virtual QwtInterval boundingInterval( int scaleId ) const; | |
| | | | |
| private: | | private: | |
| class PrivateData; | | class PrivateData; | |
| PrivateData *d_data; | | PrivateData *d_data; | |
| }; | | }; | |
| | | | |
| #endif | | #endif | |
| | | | |
End of changes. 11 change blocks. |
| 17 lines changed or deleted | | 12 lines changed or added | |
|
| qwt_polar_plot.h | | qwt_polar_plot.h | |
| | | | |
| skipping to change at line 12 | | skipping to change at line 12 | |
| * QwtPolar Widget Library | | * QwtPolar Widget Library | |
| * Copyright (C) 2008 Uwe Rathmann | | * Copyright (C) 2008 Uwe Rathmann | |
| * | | * | |
| * 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_POLAR_PLOT_H | | #ifndef QWT_POLAR_PLOT_H | |
| #define QWT_POLAR_PLOT_H 1 | | #define QWT_POLAR_PLOT_H 1 | |
| | | | |
|
| #include <qframe.h> | | | |
| #include "qwt_polar_global.h" | | #include "qwt_polar_global.h" | |
|
| #include "qwt_double_interval.h" | | | |
| #include "qwt_scale_map.h" | | | |
| #include "qwt_polar.h" | | #include "qwt_polar.h" | |
|
| #include "qwt_polar_point.h" | | | |
| #include "qwt_polar_itemdict.h" | | #include "qwt_polar_itemdict.h" | |
|
| | | #include <qwt_interval.h> | |
| | | #include <qwt_scale_map.h> | |
| | | #include <qwt_point_polar.h> | |
| | | #include <qframe.h> | |
| | | | |
| class QwtRoundScaleDraw; | | class QwtRoundScaleDraw; | |
| class QwtScaleEngine; | | class QwtScaleEngine; | |
| class QwtScaleDiv; | | class QwtScaleDiv; | |
| class QwtTextLabel; | | class QwtTextLabel; | |
| class QwtPolarCanvas; | | class QwtPolarCanvas; | |
| class QwtPolarLayout; | | class QwtPolarLayout; | |
| | | | |
| /*! | | /*! | |
| \brief A plotting widget, displaying a polar coordinate system | | \brief A plotting widget, displaying a polar coordinate system | |
| | | | |
| skipping to change at line 49 | | skipping to change at line 49 | |
| for the radial scale. | | for the radial scale. | |
| | | | |
| In opposite to QwtPlot the scales might be different from the | | In opposite to QwtPlot the scales might be different from the | |
| view, that is displayed on the canvas. The view can be changed by | | view, that is displayed on the canvas. The view can be changed by | |
| zooming - f.e. by using QwtPolarPanner or QwtPolarMaginfier. | | zooming - f.e. by using QwtPolarPanner or QwtPolarMaginfier. | |
| */ | | */ | |
| class QWT_POLAR_EXPORT QwtPolarPlot: public QFrame, public QwtPolarItemDict | | class QWT_POLAR_EXPORT QwtPolarPlot: public QFrame, public QwtPolarItemDict | |
| { | | { | |
| Q_OBJECT | | Q_OBJECT | |
| | | | |
|
| Q_PROPERTY(QBrush plotBackground READ plotBackground WRITE setPlotBackg | | Q_PROPERTY( QBrush plotBackground READ plotBackground WRITE setPlotBack | |
| round) | | ground ) | |
| Q_PROPERTY(double azimuthOrigin READ azimuthOrigin WRITE setAzimuthOrig | | Q_PROPERTY( double azimuthOrigin READ azimuthOrigin WRITE setAzimuthOri | |
| in) | | gin ) | |
| | | | |
| public: | | public: | |
| /*! | | /*! | |
| Position of the legend, relative to the canvas. | | Position of the legend, relative to the canvas. | |
|
| | | | |
| - LeftLegend\n | | | |
| The legend will be left from the canvas. | | | |
| - RightLegend\n | | | |
| The legend will be right from the canvas. | | | |
| - BottomLegend\n | | | |
| The legend will be below the canvas. | | | |
| - TopLegend\n | | | |
| The legend will be between canvas and 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 | | | |
| painted by renderTo(). | | | |
| | | | |
| \sa insertLegend() | | \sa insertLegend() | |
| */ | | */ | |
| enum LegendPosition | | enum LegendPosition | |
| { | | { | |
|
| | | //! The legend will be left from the canvas. | |
| LeftLegend, | | LeftLegend, | |
|
| | | | |
| | | //! The legend will be right from the canvas. | |
| RightLegend, | | RightLegend, | |
|
| | | | |
| | | //! The legend will be below the canvas. | |
| BottomLegend, | | BottomLegend, | |
|
| | | | |
| | | //! The legend will be between canvas and title. | |
| TopLegend, | | TopLegend, | |
| | | | |
|
| | | /*! | |
| | | 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 The legend is not painted by QwtPolarRenderer | |
| | | */ | |
| ExternalLegend | | ExternalLegend | |
| }; | | }; | |
| | | | |
|
| explicit QwtPolarPlot( QWidget *parent = NULL); | | explicit QwtPolarPlot( QWidget *parent = NULL ); | |
| QwtPolarPlot(const QwtText &title, QWidget *parent = NULL); | | QwtPolarPlot( const QwtText &title, QWidget *parent = NULL ); | |
| | | | |
| virtual ~QwtPolarPlot(); | | virtual ~QwtPolarPlot(); | |
| | | | |
|
| void setTitle(const QString &); | | void setTitle( const QString & ); | |
| void setTitle(const QwtText &); | | void setTitle( const QwtText & ); | |
| | | | |
| QwtText title() const; | | QwtText title() const; | |
| | | | |
| QwtTextLabel *titleLabel(); | | QwtTextLabel *titleLabel(); | |
| const QwtTextLabel *titleLabel() const; | | const QwtTextLabel *titleLabel() const; | |
| | | | |
|
| void setAutoReplot(bool tf = true); | | void setAutoReplot( bool tf = true ); | |
| bool autoReplot() const; | | bool autoReplot() const; | |
| | | | |
|
| void setAutoScale(int scaleId); | | void setAutoScale( int scaleId ); | |
| bool hasAutoScale(int scaleId) const; | | bool hasAutoScale( int scaleId ) const; | |
| | | | |
|
| void setScaleMaxMinor(int scaleId, int maxMinor); | | void setScaleMaxMinor( int scaleId, int maxMinor ); | |
| int scaleMaxMinor(int scaleId) const; | | int scaleMaxMinor( int scaleId ) const; | |
| | | | |
|
| int scaleMaxMajor(int scaleId) const; | | int scaleMaxMajor( int scaleId ) const; | |
| void setScaleMaxMajor(int scaleId, int maxMajor); | | void setScaleMaxMajor( int scaleId, int maxMajor ); | |
| | | | |
|
| QwtScaleEngine *scaleEngine(int scaleId); | | QwtScaleEngine *scaleEngine( int scaleId ); | |
| const QwtScaleEngine *scaleEngine(int scaleId) const; | | const QwtScaleEngine *scaleEngine( int scaleId ) const; | |
| void setScaleEngine(int scaleId, QwtScaleEngine *); | | void setScaleEngine( int scaleId, QwtScaleEngine * ); | |
| | | | |
|
| void setScale(int scaleId, double min, double max, double step = 0); | | void setScale( int scaleId, double min, double max, double step = 0 ); | |
| | | | |
|
| void setScaleDiv(int scaleId, const QwtScaleDiv &); | | void setScaleDiv( int scaleId, const QwtScaleDiv & ); | |
| const QwtScaleDiv *scaleDiv(int scaleId) const; | | const QwtScaleDiv *scaleDiv( int scaleId ) const; | |
| QwtScaleDiv *scaleDiv(int scaleId); | | QwtScaleDiv *scaleDiv( int scaleId ); | |
| | | | |
|
| QwtScaleMap scaleMap(int scaleId, double radius) const; | | QwtScaleMap scaleMap( int scaleId, double radius ) const; | |
| QwtScaleMap scaleMap(int scaleId) const; | | QwtScaleMap scaleMap( int scaleId ) const; | |
| | | | |
|
| void updateScale(int scaleId); | | void updateScale( int scaleId ); | |
| | | | |
| double azimuthOrigin() const; | | double azimuthOrigin() const; | |
| | | | |
|
| void zoom(const QwtPolarPoint&, double factor); | | void zoom( const QwtPointPolar&, double factor ); | |
| void unzoom(); | | void unzoom(); | |
| | | | |
|
| QwtPolarPoint zoomPos() const; | | QwtPointPolar zoomPos() const; | |
| double zoomFactor() const; | | double zoomFactor() const; | |
| | | | |
|
| virtual void polish(); | | | |
| | | | |
| // Canvas | | // Canvas | |
| | | | |
| QwtPolarCanvas *canvas(); | | QwtPolarCanvas *canvas(); | |
| const QwtPolarCanvas *canvas() const; | | const QwtPolarCanvas *canvas() const; | |
| | | | |
|
| void setPlotBackground (const QBrush &c); | | void setPlotBackground ( const QBrush &c ); | |
| const QBrush& plotBackground() const; | | const QBrush& plotBackground() const; | |
| | | | |
|
| virtual void drawCanvas(QPainter *, const QwtDoubleRect &) const; | | virtual void drawCanvas( QPainter *, const QRectF & ) const; | |
| | | | |
| // Legend | | // Legend | |
| | | | |
|
| void insertLegend(QwtLegend *, LegendPosition = QwtPolarPlot::RightLege | | void insertLegend( QwtLegend *, | |
| nd, | | LegendPosition = RightLegend, double ratio = -1.0 ); | |
| double ratio = -1.0); | | | |
| | | | |
| QwtLegend *legend(); | | QwtLegend *legend(); | |
| const QwtLegend *legend() const; | | const QwtLegend *legend() const; | |
| | | | |
| // Layout | | // Layout | |
| QwtPolarLayout *plotLayout(); | | QwtPolarLayout *plotLayout(); | |
| const QwtPolarLayout *plotLayout() const; | | const QwtPolarLayout *plotLayout() const; | |
| | | | |
|
| QwtDoubleInterval visibleInterval() const; | | QwtInterval visibleInterval() const; | |
| QwtDoubleRect plotRect() const; | | QRectF plotRect() const; | |
| QwtDoubleRect plotRect(const QRect &) const; | | QRectF plotRect( const QRectF & ) const; | |
| | | | |
| int plotMarginHint() const; | | int plotMarginHint() const; | |
| | | | |
|
| void renderTo(QPaintDevice &) const; | | Q_SIGNALS: | |
| virtual void renderTo(QPainter *, const QRect &) const; | | | |
| | | | |
| 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(QwtPolarItem *plotItem); | | void legendClicked( QwtPolarItem *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(QwtPolarItem *plotItem, bool on); | | void legendChecked( QwtPolarItem *plotItem, bool on ); | |
| | | | |
| /*! | | /*! | |
| A signal that is emitted, whenever the layout of the plot | | A signal that is emitted, whenever the layout of the plot | |
| has been recalculated. | | has been recalculated. | |
| */ | | */ | |
| void layoutChanged(); | | void layoutChanged(); | |
| | | | |
|
| public slots: | | public Q_SLOTS: | |
| virtual void replot(); | | virtual void replot(); | |
| void autoRefresh(); | | void autoRefresh(); | |
|
| void setAzimuthOrigin(double); | | void setAzimuthOrigin( double ); | |
| | | | |
|
| protected slots: | | protected Q_SLOTS: | |
| virtual void legendItemClicked(); | | virtual void legendItemClicked(); | |
|
| virtual void legendItemChecked(bool); | | virtual void legendItemChecked( bool ); | |
| | | | |
| protected: | | protected: | |
|
| virtual bool event(QEvent *); | | virtual bool event( QEvent * ); | |
| virtual void resizeEvent(QResizeEvent *); | | virtual void resizeEvent( QResizeEvent * ); | |
| | | | |
| virtual void updateLayout(); | | virtual void updateLayout(); | |
| | | | |
|
| virtual void drawItems(QPainter *painter, | | virtual void drawItems( QPainter *painter, | |
| const QwtScaleMap &radialMap, const QwtScaleMap &azimuthMap, | | const QwtScaleMap &radialMap, const QwtScaleMap &azimuthMap, | |
|
| const QwtDoublePoint &pole, double radius, | | const QPointF &pole, double radius, | |
| const QwtDoubleRect &canvasRect) const; | | const QRectF &canvasRect ) const; | |
| | | | |
| virtual void renderTitle(QPainter *, const QRect &) const; | | | |
| virtual void renderLegend(QPainter *, const QRect &) const; | | | |
| virtual void renderLegendItem(QPainter *, | | | |
| const QWidget *, const QRect &) const; | | | |
| | | | |
| private: | | private: | |
|
| void initPlot(const QwtText &); | | void initPlot( const QwtText & ); | |
| | | | |
| class ScaleData; | | class ScaleData; | |
| class PrivateData; | | class PrivateData; | |
| PrivateData *d_data; | | PrivateData *d_data; | |
| }; | | }; | |
| | | | |
| #endif | | #endif | |
| | | | |
End of changes. 40 change blocks. |
| 80 lines changed or deleted | | 66 lines changed or added | |
|
| qwt_polar_spectrogram.h | | qwt_polar_spectrogram.h | |
| | | | |
| skipping to change at line 31 | | skipping to change at line 31 | |
| | | | |
| A spectrogram displays threedimenional data, where the 3rd dimension | | A spectrogram displays threedimenional data, where the 3rd dimension | |
| ( the intensity ) is displayed using colors. The colors are calculated | | ( the intensity ) is displayed using colors. The colors are calculated | |
| from the values using a color map. | | from the values using a color map. | |
| | | | |
| \sa QwtRasterData, QwtColorMap | | \sa QwtRasterData, QwtColorMap | |
| */ | | */ | |
| class QWT_POLAR_EXPORT QwtPolarSpectrogram: public QwtPolarItem | | class QWT_POLAR_EXPORT QwtPolarSpectrogram: public QwtPolarItem | |
| { | | { | |
| public: | | public: | |
|
| | | /*! | |
| | | Attributes to modify the drawing algorithm. | |
| | | The default setting disables ApproximatedAtan | |
| | | | |
| | | \sa setPaintAttribute(), testPaintAttribute() | |
| | | */ | |
| | | enum PaintAttribute | |
| | | { | |
| | | /*! | |
| | | Use qwtFastAtan2 instead of atan2 for translating | |
| | | widget into polar coordinates. | |
| | | */ | |
| | | | |
| | | ApproximatedAtan = 0x01 | |
| | | }; | |
| | | | |
| | | //! Paint attributes | |
| | | typedef QFlags<PaintAttribute> PaintAttributes; | |
| | | | |
| explicit QwtPolarSpectrogram(); | | explicit QwtPolarSpectrogram(); | |
| virtual ~QwtPolarSpectrogram(); | | virtual ~QwtPolarSpectrogram(); | |
| | | | |
|
| void setData(const QwtRasterData &data); | | void setData( QwtRasterData *data ); | |
| const QwtRasterData &data() const; | | const QwtRasterData *data() const; | |
| | | | |
| | | void setColorMap( QwtColorMap * ); | |
| | | const QwtColorMap *colorMap() const; | |
| | | | |
| | | void setPaintAttribute( PaintAttribute, bool on = true ); | |
| | | bool testPaintAttribute( PaintAttribute ) const; | |
| | | | |
|
| void setColorMap(const QwtColorMap &); | | void setRenderThreadCount( uint numThreads ); | |
| const QwtColorMap &colorMap() const; | | uint renderThreadCount() const; | |
| | | | |
| virtual int rtti() const; | | virtual int rtti() const; | |
| | | | |
|
| virtual void draw(QPainter *painter, | | virtual void draw( QPainter *painter, | |
| const QwtScaleMap &azimuthMap, const QwtScaleMap &radialMap, | | const QwtScaleMap &azimuthMap, const QwtScaleMap &radialMap, | |
|
| const QwtDoublePoint &pole, double radius, | | const QPointF &pole, double radius, | |
| const QwtDoubleRect &canvasRect) const; | | const QRectF &canvasRect ) const; | |
| | | | |
|
| virtual QwtDoubleInterval boundingInterval(int scaleId) const; | | virtual QwtInterval boundingInterval( int scaleId ) const; | |
| | | | |
| protected: | | protected: | |
| virtual QImage renderImage( | | virtual QImage renderImage( | |
| const QwtScaleMap &azimuthMap, const QwtScaleMap &radialMap, | | const QwtScaleMap &azimuthMap, const QwtScaleMap &radialMap, | |
|
| const QwtDoublePoint &pole, const QRect &rect) const; | | const QPointF &pole, const QRect &rect ) const; | |
| | | | |
| | | virtual void renderTile( | |
| | | const QwtScaleMap &azimuthMap, const QwtScaleMap &radialMap, | |
| | | const QPointF &pole, const QPoint &imagePos, | |
| | | const QRect &tile, QImage *image ) const; | |
| | | | |
| private: | | private: | |
|
| | | class TileInfo; | |
| | | void renderTile( const QwtScaleMap &, const QwtScaleMap &, | |
| | | const QPointF &pole, TileInfo * ) const; | |
| | | | |
| class PrivateData; | | class PrivateData; | |
| PrivateData *d_data; | | PrivateData *d_data; | |
| }; | | }; | |
| | | | |
|
| | | Q_DECLARE_OPERATORS_FOR_FLAGS( QwtPolarSpectrogram::PaintAttributes ) | |
| | | | |
| #endif | | #endif | |
| | | | |
End of changes. 9 change blocks. |
| 9 lines changed or deleted | | 45 lines changed or added | |
|