ScreenPickerTool.h
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 <qwt_double_rect.h>
00035 #include <qwt_plot_marker.h>
00036 #include <qwt_plot_picker.h>
00037
00038 class ApplicationWindow;
00039 class Table;
00040 class DataCurve;
00041
00047 class ScreenPickerTool : public QwtPlotPicker, public PlotToolInterface
00048 {
00049 Q_OBJECT
00050 public:
00051 enum MoveRestriction { NoRestriction, Vertical, Horizontal };
00052 ScreenPickerTool(Graph *graph, const QObject *status_target=NULL, const char *status_slot="");
00053 virtual ~ScreenPickerTool();
00054 void append(const QwtDoublePoint &pos);
00055 void setMoveRestriction(ScreenPickerTool::MoveRestriction r){d_move_restriction = r;};
00056
00057 signals:
00062 void statusText(const QString&);
00063 protected:
00064 virtual bool eventFilter(QObject *obj, QEvent *event);
00065 virtual void append(const QPoint &point);
00066 QwtPlotMarker d_selection_marker;
00067 MoveRestriction d_move_restriction;
00068 };
00069
00073 class DrawPointTool : public ScreenPickerTool
00074 {
00075 Q_OBJECT
00076 public:
00077 DrawPointTool(ApplicationWindow *app, Graph *graph, const QObject *status_target=NULL, const char *status_slot="");
00078
00079 protected:
00080 virtual bool eventFilter(QObject *obj, QEvent *event);
00081 void appendPoint(const QwtDoublePoint &point);
00082 DataCurve *d_curve;
00083 Table *d_table;
00084 ApplicationWindow *d_app;
00085 };
00086
00087 #endif // ifndef SCREEN_PICKER_TOOL_H