ScreenPickerTool.h

Go to the documentation of this file.
00001 /***************************************************************************
00002     File                 : ScreenPickerTool.h
00003     Project              : QtiPlot
00004     --------------------------------------------------------------------
00005     Copyright            : (C) 2006,2007 by Ion Vasilief, Knut Franke
00006     Email (use @ for *)  : ion_vasilief*yahoo.fr, knut.franke*gmx.de
00007     Description          : Plot tool for selecting arbitrary points.
00008 
00009  ***************************************************************************/
00010 
00011 /***************************************************************************
00012  *                                                                         *
00013  *  This program is free software; you can redistribute it and/or modify   *
00014  *  it under the terms of the GNU General Public License as published by   *
00015  *  the Free Software Foundation; either version 2 of the License, or      *
00016  *  (at your option) any later version.                                    *
00017  *                                                                         *
00018  *  This program is distributed in the hope that it will be useful,        *
00019  *  but WITHOUT ANY WARRANTY; without even the implied warranty of         *
00020  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the          *
00021  *  GNU General Public License for more details.                           *
00022  *                                                                         *
00023  *   You should have received a copy of the GNU General Public License     *
00024  *   along with this program; if not, write to the Free Software           *
00025  *   Foundation, Inc., 51 Franklin Street, Fifth Floor,                    *
00026  *   Boston, MA  02110-1301  USA                                           *
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

Generated on Fri Nov 7 03:36:52 2008 for QtiPlot by  doxygen 1.5.6