TranslateCurveTool.h
Go to the documentation of this file.
/***************************************************************************
File : TranslateCurveTool.h
Project : QtiPlot
--------------------------------------------------------------------
Copyright : (C) 2006,2007 by Ion Vasilief, Knut Franke
Email (use @ for *) : ion_vasilief*yahoo.fr, knut.franke*gmx.de
Description : Plot tool for translating curves.
***************************************************************************/
/***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the Free Software *
* Foundation, Inc., 51 Franklin Street, Fifth Floor, *
* Boston, MA 02110-1301 USA *
* *
***************************************************************************/
#ifndef TRANSLATE_CURVE_TOOL_H
#define TRANSLATE_CURVE_TOOL_H
#include "PlotToolInterface.h"
#include <QObject>
#include <qwt_double_rect.h>
class ApplicationWindow;
class QwtPlotCurve;
class TranslateCurveTool : public QObject, public PlotToolInterface
{
Q_OBJECT
public:
enum Direction { Vertical, Horizontal };
TranslateCurveTool(Graph *graph, ApplicationWindow *app, Direction dir, const QObject *status_target=NULL, const char *status_slot="");
virtual int rtti() const {return PlotToolInterface::Rtti_TranslateCurveTool;};
signals:
void statusText(const QString&);
public slots:
void selectCurvePoint(QwtPlotCurve *curve, int point_index);
void selectDestination(const QwtDoublePoint &point);
private:
Direction d_dir;
PlotToolInterface *d_sub_tool;
QwtPlotCurve *d_selected_curve;
QwtDoublePoint d_curve_point;
ApplicationWindow *d_app;
};
#endif // TRANSLATE_CURVE_TOOL_H
TranslateCurveTool::rtti
virtual int rtti() const
Definition: TranslateCurveTool.h:56
TranslateCurveTool::d_app
ApplicationWindow * d_app
Definition: TranslateCurveTool.h:73
Graph
A 2D-plotting widget.
Definition: Graph.h:123
TranslateCurveTool::d_sub_tool
PlotToolInterface * d_sub_tool
Definition: TranslateCurveTool.h:70
TranslateCurveTool::statusText
void statusText(const QString &)
Emitted whenever a new message should be presented to the user.
TranslateCurveTool::d_curve_point
QwtDoublePoint d_curve_point
Definition: TranslateCurveTool.h:72
TranslateCurveTool
Plot tool for translating curves.
Definition: TranslateCurveTool.h:40
PlotToolInterface::Rtti_TranslateCurveTool
Definition: PlotToolInterface.h:70
ApplicationWindow
QtiPlot&#39;s main window.
Definition: ApplicationWindow.h:133
TranslateCurveTool::Horizontal
Definition: TranslateCurveTool.h:44
TranslateCurveTool::Direction
Direction
Definition: TranslateCurveTool.h:44
TranslateCurveTool::selectDestination
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
TranslateCurveTool::Vertical
Definition: TranslateCurveTool.h:44
PlotToolInterface.h
PlotToolInterface
Definition: PlotToolInterface.h:60
TranslateCurveTool::d_dir
Direction d_dir
Definition: TranslateCurveTool.h:69
TranslateCurveTool::d_selected_curve
QwtPlotCurve * d_selected_curve
Definition: TranslateCurveTool.h:71
TranslateCurveTool::TranslateCurveTool
TranslateCurveTool(Graph *graph, ApplicationWindow *app, Direction dir, const QObject *status_target=NULL, const char *status_slot="")
Standard constructor.
Definition: TranslateCurveTool.cpp:41
TranslateCurveTool::selectCurvePoint
void selectCurvePoint(QwtPlotCurve *curve, int point_index)
Select curve to translate, using the specified point as base point.
Definition: TranslateCurveTool.cpp:57