incrementalplot.h

来自「QWT5.01用于Qt开发的二维图形库程序」· C头文件 代码 · 共 47 行

H
47 行
字号
#ifndef _INCREMENTALPLOT_H_
#define _INCREMENTALPLOT_H_ 1

#include <qwt_array.h>
#include <qwt_plot.h>

class QwtPlotCurve;

class CurveData
{
    // A container class for growing data
public:

    CurveData();

    void append(double *x, double *y, int count);

    int count() const;
    int size() const;
    const double *x() const;
    const double *y() const;

private:
    int d_count;
    QwtArray<double> d_x;
    QwtArray<double> d_y;
};

class IncrementalPlot : public QwtPlot
{
    Q_OBJECT
public:
    IncrementalPlot(QWidget *parent = NULL);
    virtual ~IncrementalPlot();

    void appendData(double x, double y);
    void appendData(double *x, double *y, int size);

    void removeData();

private:
    CurveData *d_data;
    QwtPlotCurve *d_curve;
};

#endif // _INCREMENTALPLOT_H_

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?