Go to the documentation of this file.00001
00022 #ifndef DGVPLOT_H
00023 #define DGVPLOT_H
00024
00025 #include <qwt_plot.h>
00026 #include <qwt_plot_curve.h>
00027
00028 #include "DGVAliases.h"
00029
00070 class DGV_EXPORT DGVPlot : public QwtPlot
00071 {
00072 Q_OBJECT
00073
00074 public:
00079 DGVPlot(QWidget *parent = 0);
00084 virtual ~DGVPlot();
00085
00090 void setName(QString filename);
00095 void setToLinePlot(bool lines);
00100 void setData(Array<imageType,1> &xData, Array<imageType,1> &yData);
00105 void setData(Array< Array<imageType,1>, 1 > &xData, Array< Array<imageType,1>, 1 > &yData);
00110 virtual void createCurvePlots(Array< Array<imageType,1>, 1 > &xData, Array< Array<imageType,1>, 1 > &yData, QString plotTitle);
00111 virtual void createCurvePlot(Array<imageType,1> xData, Array<imageType,1> yData, QString plotTitle);
00116 void generatePlot();
00117
00122 bool loadGNU(QString filename);
00127 bool saveGNU(QString filename);
00128
00129 void setRenderAntialiased()
00130 { antialiased = true; }
00135 QString strippedName();
00140 QString strippedNamePrefix();
00141
00142 public slots:
00147 void save();
00152 void xLabel();
00157 void yLabel();
00162 void titleLabel();
00167 void rescaleAxis(const int axis);
00172 void rescaleXAxis();
00177 void rescaleYAxis();
00182 void toggleLinePlot();
00187 void renameData();
00188
00189 protected:
00190 QString name;
00191 bool loaded;
00192 bool linePlot;
00193
00194
00195 QAction *saveAct;
00196
00197 QAction *xLabelAct;
00198 QAction *yLabelAct;
00199 QAction *titleAct;
00200 QAction *xScaleAct;
00201 QAction *yScaleAct;
00202 QAction *linePlotAct;
00203
00204 QAction *renameAct;
00205 QAction *refreshAct;
00206 QAction *closeAct;
00207
00208 bool antialiased;
00209
00210 Array< Array<imageType,1>, 1 > xArray;
00211 Array< Array<imageType,1>, 1 > yArray;
00212 int plotSize;
00213
00214 Array<QwtPlotCurve*, 1> curves;
00215
00216 virtual void contextMenuEvent(QContextMenuEvent *event);
00217 };
00218
00219 #endif // DGVPLOT_H