SciDAVis  1.D4
LineProfileTool.h
Go to the documentation of this file.
1 /***************************************************************************
2  File : LineProfileTool.h
3  Project : SciDAVis
4  --------------------------------------------------------------------
5  Copyright : (C) 2006,2007 by Ion Vasilief,
6  Tilman Benkert, Knut Franke
7  Email (use @ for *) : ion_vasilief*yahoo.fr, thzs*gmx.net,
8  knut.franke*gmx.de
9  Description : Plot tool for calculating intensity profiles of
10  image markers.
11 
12  ***************************************************************************/
13 
14 /***************************************************************************
15  * *
16  * This program is free software; you can redistribute it and/or modify *
17  * it under the terms of the GNU General Public License as published by *
18  * the Free Software Foundation; either version 2 of the License, or *
19  * (at your option) any later version. *
20  * *
21  * This program is distributed in the hope that it will be useful, *
22  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
23  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
24  * GNU General Public License for more details. *
25  * *
26  * You should have received a copy of the GNU General Public License *
27  * along with this program; if not, write to the Free Software *
28  * Foundation, Inc., 51 Franklin Street, Fifth Floor, *
29  * Boston, MA 02110-1301 USA *
30  * *
31  ***************************************************************************/
32 #ifndef LINE_PROFILE_TOOL_H
33 #define LINE_PROFILE_TOOL_H
34 
35 #include "PlotToolInterface.h"
36 #include "core/column/Column.h"
37 
38 #include <QWidget>
39 
40 class QPoint;
41 class QImage;
42 class ImageMarker;
43 
63 class LineProfileTool : public QWidget, public PlotToolInterface
64 {
65  Q_OBJECT
66 
67  public:
69  LineProfileTool(Graph *graph, int average_pixels);
70  virtual RTTI rtti() const { return LineProfile; }
71  void calculateLineProfile(const QPoint &start, const QPoint &end);
72 
73  signals:
78  void statusText(const QString&);
79  void createTablePlot(const QString&,const QString&,QList<Column*>);
80 
81  protected:
82  int averageImagePixel(const QImage &image, int px, int py, bool moreHorizontal);
83  void addLineMarker(const QPoint &start, const QPoint &end);
86  virtual void paintEvent(QPaintEvent *e);
91  virtual void mousePressEvent(QMouseEvent *e);
94  virtual void mouseMoveEvent(QMouseEvent *e);
97  virtual void mouseReleaseEvent(QMouseEvent *e);
98 
99  private:
106  QPoint d_op_start;
108  QPoint d_op_dp;
109 };
110 
111 #endif // ifndef LINE_PROFILE_TOOL_H
112