File: incrementalplot.h

package info (click to toggle)
libqwt 4.2.0-4.1
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 9,832 kB
  • ctags: 5,512
  • sloc: cpp: 22,973; ansic: 244; makefile: 66
file content (45 lines) | stat: -rw-r--r-- 867 bytes parent folder | download | duplicates (5)
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
#ifndef _INCREMENTALPLOT_H_
#define _INCREMENTALPLOT_H_ 1

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

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

    CurveData();

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

    int count() const;
    int size() const;
    double *x() 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 = 0, const char *name = 0);
    virtual ~IncrementalPlot();

    void appendCurvePoint(long curveId, double x, double y);
    void appendCurveData(long curveId,
        double *x, double *y, int size);

    void removeCurveData(long curveId);
private:

    QIntDict<CurveData> d_curveDictionary;
};

#endif // _INCREMENTALPLOT_H_