ScreenPickerTool.h
Go to the documentation of this file.
/***************************************************************************
File : ScreenPickerTool.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 selecting arbitrary points.
***************************************************************************/
/***************************************************************************
* *
* 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 SCREEN_PICKER_TOOL_H
#define SCREEN_PICKER_TOOL_H
#include <PlotToolInterface.h>
#include <DoubleSpinBox.h>
#include <QObject>
#include <QPointer>
#include <QLabel>
#include <QSpinBox>
#include <qwt_double_rect.h>
#include <qwt_plot_marker.h>
#include <qwt_plot_picker.h>
class ApplicationWindow;
class Table;
class Matrix;
class DataCurve;
class ScreenPickerTool : public QwtPlotPicker, public PlotToolInterface
{
Q_OBJECT
public:
enum MoveRestriction { NoRestriction, Vertical, Horizontal };
ScreenPickerTool(Graph *graph, const QObject *status_target=NULL, const char *status_slot="");
virtual ~ScreenPickerTool();
virtual void append(const QwtDoublePoint &pos);
void setMoveRestriction(ScreenPickerTool::MoveRestriction r){d_move_restriction = r;};
double xValue(){return d_selection_marker.xValue();};
double yValue(){return d_selection_marker.yValue();};
signals:
void statusText(const QString&);
protected:
virtual bool eventFilter(QObject *obj, QEvent *event);
virtual void append(const QPoint &point);
QwtPlotMarker d_selection_marker;
MoveRestriction d_move_restriction;
};
class DrawPointTool : public ScreenPickerTool
{
Q_OBJECT
public:
DrawPointTool(ApplicationWindow *app, Graph *graph, const QObject *status_target=NULL, const char *status_slot="");
virtual int rtti() const { return Rtti_DrawDataPoints;};
protected:
virtual bool eventFilter(QObject *obj, QEvent *event);
void appendPoint(const QwtDoublePoint &point);
DataCurve *d_curve;
Table *d_table;
ApplicationWindow *d_app;
};
class ImageProfilesTool : public ScreenPickerTool
{
Q_OBJECT
public:
ImageProfilesTool(ApplicationWindow *app, Graph *graph, Matrix *m, Table *horTable, Table *verTable);
void connectPlotLayers();
ImageProfilesTool* clone(Graph *g);
virtual ~ImageProfilesTool();
virtual void append(const QwtDoublePoint &pos);
virtual int rtti() const { return Rtti_ImageProfilesTool;};
int averagePixels(){return averageBox->value();}
void setAveragePixels(int pixels);
QPointer<Matrix> matrix(){return d_matrix;};
QPointer<Table> horizontalTable(){return d_hor_table;};
QPointer<Table> verticalTable(){return d_ver_table;};
private slots:
void modifiedMatrix(Matrix *);
void updateCursorPosition();
void updateCursorWidth(int width);
private:
void setCursorWidth(int width);
protected:
ApplicationWindow *d_app;
QPointer<Matrix> d_matrix;
QPointer<Table> d_hor_table, d_ver_table;
DoubleSpinBox *horSpinBox, *vertSpinBox;
QSpinBox *averageBox;
QLabel *zLabel;
QWidget *d_box;
};
#endif // ifndef SCREEN_PICKER_TOOL_H
DrawPointTool::d_curve
DataCurve * d_curve
Definition: ScreenPickerTool.h:93
ScreenPickerTool::d_selection_marker
QwtPlotMarker d_selection_marker
Definition: ScreenPickerTool.h:76
ScreenPickerTool::append
virtual void append(const QwtDoublePoint &pos)
Definition: ScreenPickerTool.cpp:71
ImageProfilesTool::matrix
QPointer< Matrix > matrix()
Definition: ScreenPickerTool.h:117
PlotToolInterface::Rtti_DrawDataPoints
Definition: PlotToolInterface.h:74
Graph
A 2D-plotting widget.
Definition: Graph.h:123
ImageProfilesTool::append
virtual void append(const QwtDoublePoint &pos)
Definition: ScreenPickerTool.cpp:432
ImageProfilesTool::d_matrix
QPointer< Matrix > d_matrix
Definition: ScreenPickerTool.h:131
ImageProfilesTool::clone
ImageProfilesTool * clone(Graph *g)
Definition: ScreenPickerTool.cpp:408
ImageProfilesTool::setCursorWidth
void setCursorWidth(int width)
Definition: ScreenPickerTool.cpp:341
ImageProfilesTool::d_app
ApplicationWindow * d_app
Definition: ScreenPickerTool.h:130
DrawPointTool::d_table
Table * d_table
Definition: ScreenPickerTool.h:94
ScreenPickerTool::NoRestriction
Definition: ScreenPickerTool.h:58
DoubleSpinBox.h
ImageProfilesTool::d_ver_table
QPointer< Table > d_ver_table
Definition: ScreenPickerTool.h:132
DrawPointTool::DrawPointTool
DrawPointTool(ApplicationWindow *app, Graph *graph, const QObject *status_target=NULL, const char *status_slot="")
Definition: ScreenPickerTool.cpp:144
ImageProfilesTool::ImageProfilesTool
ImageProfilesTool(ApplicationWindow *app, Graph *graph, Matrix *m, Table *horTable, Table *verTable)
Definition: ScreenPickerTool.cpp:225
ScreenPickerTool::~ScreenPickerTool
virtual ~ScreenPickerTool()
Definition: ScreenPickerTool.cpp:59
ImageProfilesTool
Definition: ScreenPickerTool.h:101
ScreenPickerTool::yValue
double yValue()
Definition: ScreenPickerTool.h:65
ScreenPickerTool::ScreenPickerTool
ScreenPickerTool(Graph *graph, const QObject *status_target=NULL, const char *status_slot="")
Definition: ScreenPickerTool.cpp:43
ScreenPickerTool::statusText
void statusText(const QString &)
ImageProfilesTool::zLabel
QLabel * zLabel
Definition: ScreenPickerTool.h:135
ImageProfilesTool::averagePixels
int averagePixels()
Definition: ScreenPickerTool.h:114
DoubleSpinBox
A QDoubleSpinBox allowing to customize numbers display with respect to locale settings.
Definition: DoubleSpinBox.h:39
ImageProfilesTool::rtti
virtual int rtti() const
Definition: ScreenPickerTool.h:112
ImageProfilesTool::connectPlotLayers
void connectPlotLayers()
Definition: ScreenPickerTool.cpp:302
ScreenPickerTool::xValue
double xValue()
Definition: ScreenPickerTool.h:64
ImageProfilesTool::averageBox
QSpinBox * averageBox
Definition: ScreenPickerTool.h:134
ApplicationWindow
QtiPlot&#39;s main window.
Definition: ApplicationWindow.h:133
ImageProfilesTool::horizontalTable
QPointer< Table > horizontalTable()
Definition: ScreenPickerTool.h:118
ImageProfilesTool::verticalTable
QPointer< Table > verticalTable()
Definition: ScreenPickerTool.h:119
DrawPointTool::d_app
ApplicationWindow * d_app
Definition: ScreenPickerTool.h:95
ImageProfilesTool::modifiedMatrix
void modifiedMatrix(Matrix *)
Definition: ScreenPickerTool.cpp:360
ScreenPickerTool::d_move_restriction
MoveRestriction d_move_restriction
Definition: ScreenPickerTool.h:77
DrawPointTool::eventFilter
virtual bool eventFilter(QObject *obj, QEvent *event)
Definition: ScreenPickerTool.cpp:192
ScreenPickerTool::setMoveRestriction
void setMoveRestriction(ScreenPickerTool::MoveRestriction r)
Definition: ScreenPickerTool.h:62
Matrix
Matrix worksheet class.
Definition: Matrix.h:57
DataCurve
Definition: PlotCurve.h:96
ImageProfilesTool::d_box
QWidget * d_box
Definition: ScreenPickerTool.h:136
ImageProfilesTool::updateCursorPosition
void updateCursorPosition()
Definition: ScreenPickerTool.cpp:325
ImageProfilesTool::updateCursorWidth
void updateCursorWidth(int width)
Definition: ScreenPickerTool.cpp:352
ScreenPickerTool::MoveRestriction
MoveRestriction
Definition: ScreenPickerTool.h:58
ImageProfilesTool::~ImageProfilesTool
virtual ~ImageProfilesTool()
Definition: ScreenPickerTool.cpp:540
ScreenPickerTool::eventFilter
virtual bool eventFilter(QObject *obj, QEvent *event)
Definition: ScreenPickerTool.cpp:115
DrawPointTool::rtti
virtual int rtti() const
Definition: ScreenPickerTool.h:88
PlotToolInterface.h
PlotToolInterface
Definition: PlotToolInterface.h:60
PlotToolInterface::Rtti_ImageProfilesTool
Definition: PlotToolInterface.h:75
ImageProfilesTool::vertSpinBox
DoubleSpinBox * vertSpinBox
Definition: ScreenPickerTool.h:133
Table
MDI window providing a spreadsheet table with column logic.
Definition: Table.h:57
ScreenPickerTool::Vertical
Definition: ScreenPickerTool.h:58
ImageProfilesTool::setAveragePixels
void setAveragePixels(int pixels)
Definition: ScreenPickerTool.cpp:333
ImageProfilesTool::d_hor_table
QPointer< Table > d_hor_table
Definition: ScreenPickerTool.h:132
DrawPointTool::appendPoint
void appendPoint(const QwtDoublePoint &point)
Definition: ScreenPickerTool.cpp:152
ScreenPickerTool
Definition: ScreenPickerTool.h:54
DrawPointTool
Definition: ScreenPickerTool.h:83
ImageProfilesTool::horSpinBox
DoubleSpinBox * horSpinBox
Definition: ScreenPickerTool.h:133
ScreenPickerTool::Horizontal
Definition: ScreenPickerTool.h:58