QtiPlot  0.9.8.2
TranslateCurveTool.h
Go to the documentation of this file.
1 /***************************************************************************
2  File : TranslateCurveTool.h
3  Project : QtiPlot
4  --------------------------------------------------------------------
5  Copyright : (C) 2006,2007 by Ion Vasilief, Knut Franke
6  Email (use @ for *) : ion_vasilief*yahoo.fr, knut.franke*gmx.de
7  Description : Plot tool for translating curves.
8 
9  ***************************************************************************/
10 
11 /***************************************************************************
12  * *
13  * This program is free software; you can redistribute it and/or modify *
14  * it under the terms of the GNU General Public License as published by *
15  * the Free Software Foundation; either version 2 of the License, or *
16  * (at your option) any later version. *
17  * *
18  * This program is distributed in the hope that it will be useful, *
19  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
20  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
21  * GNU General Public License for more details. *
22  * *
23  * You should have received a copy of the GNU General Public License *
24  * along with this program; if not, write to the Free Software *
25  * Foundation, Inc., 51 Franklin Street, Fifth Floor, *
26  * Boston, MA 02110-1301 USA *
27  * *
28  ***************************************************************************/
29 #ifndef TRANSLATE_CURVE_TOOL_H
30 #define TRANSLATE_CURVE_TOOL_H
31 
32 #include "PlotToolInterface.h"
33 #include <QObject>
34 #include <qwt_double_rect.h>
35 
36 class ApplicationWindow;
37 class QwtPlotCurve;
38 
40 class TranslateCurveTool : public QObject, public PlotToolInterface
41 {
42  Q_OBJECT
43  public:
54  TranslateCurveTool(Graph *graph, ApplicationWindow *app, Direction dir, const QObject *status_target=NULL, const char *status_slot="");
55 
56  virtual int rtti() const {return PlotToolInterface::Rtti_TranslateCurveTool;};
57  signals:
62  void statusText(const QString&);
63  public slots:
65  void selectCurvePoint(QwtPlotCurve *curve, int point_index);
67  void selectDestination(const QwtDoublePoint &point);
68  private:
71  QwtPlotCurve *d_selected_curve;
72  QwtDoublePoint d_curve_point;
74 };
75 
76 #endif // TRANSLATE_CURVE_TOOL_H
virtual int rtti() const
Definition: TranslateCurveTool.h:56
ApplicationWindow * d_app
Definition: TranslateCurveTool.h:73
A 2D-plotting widget.
Definition: Graph.h:123
PlotToolInterface * d_sub_tool
Definition: TranslateCurveTool.h:70
void statusText(const QString &)
Emitted whenever a new message should be presented to the user.
QwtDoublePoint d_curve_point
Definition: TranslateCurveTool.h:72
Plot tool for translating curves.
Definition: TranslateCurveTool.h:40
Definition: PlotToolInterface.h:70
QtiPlot&#39;s main window.
Definition: ApplicationWindow.h:133
Definition: TranslateCurveTool.h:44
Direction
Definition: TranslateCurveTool.h:44
void selectDestination(const QwtDoublePoint &point)
Select the coordinates where the base point should end up (modulo projection on d_dir direction)...
Definition: TranslateCurveTool.cpp:98
Definition: TranslateCurveTool.h:44
Definition: PlotToolInterface.h:60
Direction d_dir
Definition: TranslateCurveTool.h:69
QwtPlotCurve * d_selected_curve
Definition: TranslateCurveTool.h:71
TranslateCurveTool(Graph *graph, ApplicationWindow *app, Direction dir, const QObject *status_target=NULL, const char *status_slot="")
Standard constructor.
Definition: TranslateCurveTool.cpp:41
void selectCurvePoint(QwtPlotCurve *curve, int point_index)
Select curve to translate, using the specified point as base point.
Definition: TranslateCurveTool.cpp:57