00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #ifndef MULTISCALEDETECTORPLOTWIDGET_H_
00024 #define MULTISCALEDETECTORPLOTWIDGET_H_
00025
00026 #include <QtGui/QGridLayout>
00027 #include <QtCore/QVector>
00028 #include <QtGui/QColor>
00029 #include <qwt_plot.h>
00030 #include <qwt_plot_curve.h>
00031 #include <qwt_plot_marker.h>
00032 #include <qwt_symbol.h>
00033 #include <qwt_plot_zoomer.h>
00034 #include <qwt_plot_layout.h>
00035
00036 class MultiScaleDetectorPlotWidget: public QWidget {
00037 Q_OBJECT
00038 public:
00039 MultiScaleDetectorPlotWidget(QWidget* parent = 0, unsigned int _scales = 0);
00040
00041 virtual ~MultiScaleDetectorPlotWidget();
00042
00043 inline void setScales(unsigned int _scales)
00044 {m_scales = _scales; initCurves();}
00045
00046 inline unsigned int getScales() const
00047 {return m_scales;}
00048
00049 inline void setColors(const std::vector<QColor>& _colors)
00050 {if(_colors.size() == m_scales) m_colors = _colors;}
00051
00052 inline const std::vector<QColor>& getColors() const
00053 {return m_colors;}
00054
00055 public slots:
00056 virtual void setSmoothData(QVector<double>& _dataX, QVector<double>& _dataY, unsigned int _scale);
00057 virtual void setSmoothData(QVector< QVector<double> >& _dataX, QVector< QVector<double> >& _dataY);
00058
00059 virtual void setDifferentialData(QVector<double>& _dataX, QVector<double>& _dataY, unsigned int _scale);
00060 virtual void setDifferentialData(QVector< QVector<double> >& _dataX, QVector< QVector<double> >& _dataY);
00061
00062 virtual void setSmoothMarker(QVector<double>& _dataX, QVector<double>& _dataY, unsigned int _scale);
00063 virtual void setSmoothMarker(QVector< QVector<double> >& _dataX, QVector< QVector<double> >& _dataY);
00064
00065 virtual void setDifferentialMarker(QVector<double>& _dataX, QVector<double>& _dataY, unsigned int _scale);
00066 virtual void setDifferentialMarker(QVector< QVector<double> >& _dataX, QVector< QVector<double> >& _dataY);
00067
00068 virtual void replot();
00069
00070 protected:
00071 void buildGui();
00072 void initCurves();
00073
00074 void setData(QVector<QwtPlotCurve *>& _curve, QVector<double>& _dataX, QVector<double>& _dataY, unsigned int _scale);
00075 void setData(QVector<QwtPlotCurve *>& _curve, QVector< QVector<double> >& _dataX, QVector< QVector<double> >& _dataY);
00076
00077 QGridLayout *m_plotLayout;
00078 QwtPlot *m_smooth;
00079 QwtPlot *m_derivative;
00080 QVector<QwtPlotCurve *> m_smoothCurve;
00081 QVector<QwtPlotCurve *> m_smoothMarker;
00082 QVector<QwtPlotCurve *> m_diffCurve;
00083 QVector<QwtPlotCurve *> m_diffMarker;
00084 QwtPlotZoomer* m_smoothZoomer;
00085 QwtPlotZoomer* m_diffZoomer;
00086 unsigned int m_scales;
00087
00088 std::vector<QColor> m_colors;
00089 };
00090
00091 #endif