00001 /*************************************************************************** 00002 File : TranslateCurveTool.h 00003 Project : QtiPlot 00004 -------------------------------------------------------------------- 00005 Copyright : (C) 2006,2007 by Ion Vasilief, 00006 Tilman Hoener zu Siederdissen, Knut Franke 00007 Email (use @ for *) : ion_vasilief*yahoo.fr, thzs*gmx.net, 00008 knut.franke*gmx.de 00009 Description : Plot tool for translating curves. 00010 00011 ***************************************************************************/ 00012 00013 /*************************************************************************** 00014 * * 00015 * This program is free software; you can redistribute it and/or modify * 00016 * it under the terms of the GNU General Public License as published by * 00017 * the Free Software Foundation; either version 2 of the License, or * 00018 * (at your option) any later version. * 00019 * * 00020 * This program is distributed in the hope that it will be useful, * 00021 * but WITHOUT ANY WARRANTY; without even the implied warranty of * 00022 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 00023 * GNU General Public License for more details. * 00024 * * 00025 * You should have received a copy of the GNU General Public License * 00026 * along with this program; if not, write to the Free Software * 00027 * Foundation, Inc., 51 Franklin Street, Fifth Floor, * 00028 * Boston, MA 02110-1301 USA * 00029 * * 00030 ***************************************************************************/ 00031 #ifndef TRANSLATE_CURVE_TOOL_H 00032 #define TRANSLATE_CURVE_TOOL_H 00033 00034 #include "PlotToolInterface.h" 00035 #include <QObject> 00036 #include <qwt_double_rect.h> 00037 00038 class ApplicationWindow; 00039 class QwtPlotCurve; 00040 00042 class TranslateCurveTool : public QObject, public PlotToolInterface 00043 { 00044 Q_OBJECT 00045 public: 00046 enum Direction { Vertical, Horizontal }; 00056 TranslateCurveTool(Graph *graph, ApplicationWindow *app, Direction dir, const QObject *status_target=NULL, const char *status_slot=""); 00057 signals: 00062 void statusText(const QString&); 00063 public slots: 00065 void selectCurvePoint(QwtPlotCurve *curve, int point_index); 00067 void selectDestination(const QwtDoublePoint &point); 00068 private: 00069 Direction d_dir; 00070 PlotToolInterface *d_sub_tool; 00071 QwtPlotCurve *d_selected_curve; 00072 QwtDoublePoint d_curve_point; 00073 ApplicationWindow *d_app; 00074 }; 00075 00076 #endif // TRANSLATE_CURVE_TOOL_H 00077