File: incrementalplot.h

package info (click to toggle)
qwt5 5.2.2-3
  • links: PTS
  • area: main
  • in suites: wheezy
  • size: 13,340 kB
  • sloc: cpp: 32,645; makefile: 23; sh: 4
file content (46 lines) | stat: -rw-r--r-- 802 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#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_