Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029 #ifndef SCREEN_PICKER_TOOL_H
00030 #define SCREEN_PICKER_TOOL_H
00031
00032 #include "PlotToolInterface.h"
00033 #include <QObject>
00034 #include <QPointer>
00035 #include <QLabel>
00036 #include <DoubleSpinBox.h>
00037
00038 #include <qwt_double_rect.h>
00039 #include <qwt_plot_marker.h>
00040 #include <qwt_plot_picker.h>
00041
00042 class ApplicationWindow;
00043 class Table;
00044 class Matrix;
00045 class DataCurve;
00046
00052 class ScreenPickerTool : public QwtPlotPicker, public PlotToolInterface
00053 {
00054 Q_OBJECT
00055 public:
00056 enum MoveRestriction { NoRestriction, Vertical, Horizontal };
00057 ScreenPickerTool(Graph *graph, const QObject *status_target=NULL, const char *status_slot="");
00058 virtual ~ScreenPickerTool();
00059 virtual void append(const QwtDoublePoint &pos);
00060 void setMoveRestriction(ScreenPickerTool::MoveRestriction r){d_move_restriction = r;};
00061
00062 double xValue(){return d_selection_marker.xValue();};
00063 double yValue(){return d_selection_marker.yValue();};
00064
00065 signals:
00070 void statusText(const QString&);
00071 protected:
00072 virtual bool eventFilter(QObject *obj, QEvent *event);
00073 virtual void append(const QPoint &point);
00074 QwtPlotMarker d_selection_marker;
00075 MoveRestriction d_move_restriction;
00076 };
00077
00081 class DrawPointTool : public ScreenPickerTool
00082 {
00083 Q_OBJECT
00084 public:
00085 DrawPointTool(ApplicationWindow *app, Graph *graph, const QObject *status_target=NULL, const char *status_slot="");
00086 virtual int rtti() const { return Rtti_DrawDataPoints;};
00087
00088 protected:
00089 virtual bool eventFilter(QObject *obj, QEvent *event);
00090 void appendPoint(const QwtDoublePoint &point);
00091 DataCurve *d_curve;
00092 Table *d_table;
00093 ApplicationWindow *d_app;
00094 };
00095
00099 class ImageProfilesTool : public ScreenPickerTool
00100 {
00101 Q_OBJECT
00102 public:
00103 ImageProfilesTool(ApplicationWindow *app, Graph *graph, Matrix *m, Table *horTable, Table *verTable,
00104 const QObject *status_target=NULL, const char *status_slot="");
00105
00106 ImageProfilesTool* clone(Graph *g);
00107
00108 virtual ~ImageProfilesTool();
00109 virtual void append(const QwtDoublePoint &pos);
00110 virtual int rtti() const { return Rtti_ImageProfilesTool;};
00111
00112
00113 QPointer<Matrix> matrix(){return d_matrix;};
00114 QPointer<Table> horizontalTable(){return d_hor_table;};
00115 QPointer<Table> verticalTable(){return d_ver_table;};
00116
00117 private slots:
00118 void modifiedMatrix(Matrix *);
00119 void updateCursorPosition();
00120
00121 protected:
00122 ApplicationWindow *d_app;
00123 QPointer<Matrix> d_matrix;
00124 QPointer<Table> d_hor_table, d_ver_table;
00125 DoubleSpinBox *horSpinBox, *vertSpinBox;
00126 QLabel *zLabel;
00127 };
00128
00129 #endif // ifndef SCREEN_PICKER_TOOL_H