Main Page | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members | Related Pages

# qwt_data.h

    00001 /* -*- mode: C++ ; c-file-style: "stroustrup" -*- *****************************
    00002  * Qwt Widget Library
    00003  * Copyright (C) 1997   Josef Wilgen
    00004  * Copyright (C) 2002   Uwe Rathmann
    00005  *
    00006  * This library is free software; you can redistribute it and/or
    00007  * modify it under the terms of the Qwt License, Version 1.0
    00008  *****************************************************************************/
    00009
    00010 // vim: expandtab
    00011
    00012 #ifndef QWT_DATA_H
    00013 #define QWT_DATA_H 1
    00014
    00015 #include "qwt_global.h"
    00016 #include "qwt_array.h"
    00017 #include "qwt_double_rect.h"
    00018
    00019 #if defined(QWT_TEMPLATEDLL)
    00020 // MOC_SKIP_BEGIN
    00021 template class QWT_EXPORT QwtArray<QwtDoublePoint>;
    00022 template class QWT_EXPORT QwtArray<double>;
    00023 // MOC_SKIP_END
    00024 #endif
    00025
    00040 class QWT_EXPORT QwtData
    00041 {
    00042 public:
    00043     QwtData();
    00044     virtual ~QwtData();
    00048     virtual QwtData *copy() const = 0;
    00049
    00053     virtual size_t size() const = 0;
    00059     virtual double x(size_t i) const = 0;
    00065     virtual double y(size_t i) const = 0;
    00066
    00067     virtual QwtDoubleRect boundingRect() const;
    00068
    00069 protected:
    00073     QwtData &operator=(const QwtData &);
    00074 };
    00075
    00079 class QWT_EXPORT QwtDoublePointData: public QwtData
    00080 {
    00081 public:
    00087     QwtDoublePointData(const QwtArray<QwtDoublePoint> &);
    00088     QwtDoublePointData &operator=(const QwtDoublePointData &);
    00089     virtual QwtData *copy() const;
    00090
    00091     virtual size_t size() const;
    00092     virtual double x(size_t i) const;
    00093     virtual double y(size_t i) const;
    00094
    00095 private:
    00096     QwtArray<QwtDoublePoint> d_data;
    00097 };
    00098
    00103 class QWT_EXPORT QwtArrayData: public QwtData
    00104 {
    00105 public:
    00106     QwtArrayData(const QwtArray<double> &x, const QwtArray<double> &y);
    00107     QwtArrayData(const double *x, const double *y, size_t size);
    00108     QwtArrayData &operator=(const QwtArrayData &);
    00109     virtual QwtData *copy() const;
    00110
    00111     virtual size_t size() const;
    00112     virtual double x(size_t i) const;
    00113     virtual double y(size_t i) const;
    00114
    00115     virtual QwtDoubleRect boundingRect() const;
    00116
    00117 private:
    00118     QwtArray<double> d_x;
    00119     QwtArray<double> d_y;
    00120 };
    00121
    00125 class QWT_EXPORT QwtCPointerData: public QwtData
    00126 {
    00127 public:
    00136     QwtCPointerData(const double *x, const double *y, size_t size);
    00137     QwtCPointerData &operator=(const QwtCPointerData &);
    00138     virtual QwtData *copy() const;
    00139
    00140     virtual size_t size() const;
    00141     virtual double x(size_t i) const;
    00142     virtual double y(size_t i) const;
    00143
    00144     virtual QwtDoubleRect boundingRect() const;
    00145
    00146 private:
    00147     const double *d_x;
    00148     const double *d_y;
    00149     size_t d_size;
    00150 };
    00151
    00152 #endif // !QWT_DATA
    00153
    00154 // Local Variables:
    00155 // mode: C++
    00156 // c-file-style: "stroustrup"
    00157 // indent-tabs-mode: nil
    00158 // End:
    00159