QtiPlot  0.9.8.2
ScreenPickerTool.h
Go to the documentation of this file.
1 /***************************************************************************
2  File : ScreenPickerTool.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 selecting arbitrary points.
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 SCREEN_PICKER_TOOL_H
30 #define SCREEN_PICKER_TOOL_H
31 
32 #include <PlotToolInterface.h>
33 #include <DoubleSpinBox.h>
34 
35 #include <QObject>
36 #include <QPointer>
37 #include <QLabel>
38 #include <QSpinBox>
39 
40 #include <qwt_double_rect.h>
41 #include <qwt_plot_marker.h>
42 #include <qwt_plot_picker.h>
43 
44 class ApplicationWindow;
45 class Table;
46 class Matrix;
47 class DataCurve;
48 
54 class ScreenPickerTool : public QwtPlotPicker, public PlotToolInterface
55 {
56  Q_OBJECT
57  public:
59  ScreenPickerTool(Graph *graph, const QObject *status_target=NULL, const char *status_slot="");
60  virtual ~ScreenPickerTool();
61  virtual void append(const QwtDoublePoint &pos);
63 
64  double xValue(){return d_selection_marker.xValue();};
65  double yValue(){return d_selection_marker.yValue();};
66 
67  signals:
72  void statusText(const QString&);
73  protected:
74  virtual bool eventFilter(QObject *obj, QEvent *event);
75  virtual void append(const QPoint &point);
76  QwtPlotMarker d_selection_marker;
78 };
79 
84 {
85  Q_OBJECT
86  public:
87  DrawPointTool(ApplicationWindow *app, Graph *graph, const QObject *status_target=NULL, const char *status_slot="");
88  virtual int rtti() const { return Rtti_DrawDataPoints;};
89 
90  protected:
91  virtual bool eventFilter(QObject *obj, QEvent *event);
92  void appendPoint(const QwtDoublePoint &point);
96 };
97 
102 {
103  Q_OBJECT
104  public:
105  ImageProfilesTool(ApplicationWindow *app, Graph *graph, Matrix *m, Table *horTable, Table *verTable);
106  void connectPlotLayers();
107 
109 
110  virtual ~ImageProfilesTool();
111  virtual void append(const QwtDoublePoint &pos);
112  virtual int rtti() const { return Rtti_ImageProfilesTool;};
113 
114  int averagePixels(){return averageBox->value();}
115  void setAveragePixels(int pixels);
116 
117  QPointer<Matrix> matrix(){return d_matrix;};
118  QPointer<Table> horizontalTable(){return d_hor_table;};
119  QPointer<Table> verticalTable(){return d_ver_table;};
120 
121  private slots:
122  void modifiedMatrix(Matrix *);
123  void updateCursorPosition();
124  void updateCursorWidth(int width);
125 
126  private:
127  void setCursorWidth(int width);
128 
129  protected:
131  QPointer<Matrix> d_matrix;
132  QPointer<Table> d_hor_table, d_ver_table;
134  QSpinBox *averageBox;
135  QLabel *zLabel;
136  QWidget *d_box;
137 };
138 
139 #endif // ifndef SCREEN_PICKER_TOOL_H