Changeset 8127 in ntrip for trunk/BNC/qwt/qwt_plot_curve.h


Ignore:
Timestamp:
May 10, 2017, 3:20:54 PM (7 years ago)
Author:
stoecker
Message:

update qwt and qwtpolar, many QT5 fixes (unfinished)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/BNC/qwt/qwt_plot_curve.h

    r4271 r8127  
    5353  \sa QwtPointSeriesData, QwtSymbol, QwtScaleMap
    5454*/
    55 class QWT_EXPORT QwtPlotCurve: public QwtPlotSeriesItem<QPointF>
     55class QWT_EXPORT QwtPlotCurve:
     56    public QwtPlotSeriesItem, public QwtSeriesStore<QPointF>
    5657{
    5758public:
     
    120121          interpolate/smooth the curve, before it is painted.
    121122
    122           \note Curve fitting requires temorary memory
     123          \note Curve fitting requires temporary memory
    123124          for calculating coefficients and additional points.
    124125          If painting in QwtPlotCurve::Fitted mode is slow it might be better
     
    135136
    136137        \sa setLegendAttribute(), testLegendAttribute(),
    137             drawLegendIdentifier()
     138            QwtPlotItem::legendData(), legendIcon()
    138139     */
    139140
     
    169170    /*!
    170171        Attributes to modify the drawing algorithm.
    171         The default setting enables ClipPolygons
     172        The default setting enables ClipPolygons | FilterPoints
    172173
    173174        \sa setPaintAttribute(), testPaintAttribute()
     
    183184
    184185        /*!
    185           Paint the symbol to a QPixmap and paint the pixmap
    186           instead rendering the symbol for each point. The flag has
    187           no effect, when the curve is not painted to the canvas
    188           ( f.e when exporting the plot to a PDF document ).
    189          */
    190         CacheSymbols = 0x02
     186          Tries to reduce the data that has to be painted, by sorting out
     187          duplicates, or paintings outside the visible area. Might have a
     188          notable impact on curves with many close points.
     189          Only a couple of very basic filtering algorithms are implemented.
     190         */
     191        FilterPoints = 0x02,
     192
     193        /*!
     194          Minimize memory usage that is temporarily needed for the
     195          translated points, before they get painted.
     196          This might slow down the performance of painting
     197         */
     198        MinimizeMemory = 0x04,
     199
     200        /*!
     201          Render the points to a temporary image and paint the image.
     202          This is a very special optimization for Dots style, when
     203          having a huge amount of points.
     204          With a reasonable number of points QPainter::drawPoints()
     205          will be faster.
     206         */
     207        ImageBuffer = 0x08
    191208    };
    192209
     
    213230#endif
    214231    void setSamples( const QVector<QPointF> & );
     232    void setSamples( QwtSeriesData<QPointF> * );
    215233
    216234    int closestPoint( const QPoint &pos, double *dist = NULL ) const;
     
    224242    bool testCurveAttribute( CurveAttribute ) const;
    225243
     244    void setPen( const QColor &, qreal width = 0.0, Qt::PenStyle = Qt::SolidLine );
    226245    void setPen( const QPen & );
    227246    const QPen &pen() const;
     
    230249    const QBrush &brush() const;
    231250
    232     void setBaseline( double ref );
     251    void setBaseline( double );
    233252    double baseline() const;
    234253
     
    236255    CurveStyle style() const;
    237256
    238     void setSymbol( const QwtSymbol *s );
     257    void setSymbol( QwtSymbol * );
    239258    const QwtSymbol *symbol() const;
    240259
     
    246265        const QRectF &canvasRect, int from, int to ) const;
    247266
    248     virtual void updateLegend( QwtLegend * ) const;
    249     virtual void drawLegendIdentifier( QPainter *, const QRectF & ) const;
     267    virtual QwtGraphic legendIcon( int index, const QSizeF & ) const;
    250268
    251269protected:
     
    261279        const QRectF &canvasRect, int from, int to ) const;
    262280
    263     void drawLines( QPainter *p,
    264         const QwtScaleMap &xMap, const QwtScaleMap &yMap,
    265         const QRectF &canvasRect, int from, int to ) const;
    266 
    267     void drawSticks( QPainter *p,
    268         const QwtScaleMap &xMap, const QwtScaleMap &yMap,
    269         const QRectF &canvasRect, int from, int to ) const;
    270 
    271     void drawDots( QPainter *p,
    272         const QwtScaleMap &xMap, const QwtScaleMap &yMap,
    273         const QRectF &canvasRect, int from, int to ) const;
    274 
    275     void drawSteps( QPainter *p,
     281    virtual void drawLines( QPainter *p,
     282        const QwtScaleMap &xMap, const QwtScaleMap &yMap,
     283        const QRectF &canvasRect, int from, int to ) const;
     284
     285    virtual void drawSticks( QPainter *p,
     286        const QwtScaleMap &xMap, const QwtScaleMap &yMap,
     287        const QRectF &canvasRect, int from, int to ) const;
     288
     289    virtual void drawDots( QPainter *p,
     290        const QwtScaleMap &xMap, const QwtScaleMap &yMap,
     291        const QRectF &canvasRect, int from, int to ) const;
     292
     293    virtual void drawSteps( QPainter *p,
    276294        const QwtScaleMap &xMap, const QwtScaleMap &yMap,
    277295        const QRectF &canvasRect, int from, int to ) const;
Note: See TracChangeset for help on using the changeset viewer.