LineProfileTool.h

Go to the documentation of this file.
00001 /***************************************************************************
00002     File                 : LineProfileTool.h
00003     Project              : QtiPlot
00004     --------------------------------------------------------------------
00005     Copyright            : (C) 2006,2007 by Ion Vasilief, Knut Franke
00006     Email (use @ for *)  : ion_vasilief*yahoo.fr, knut.franke*gmx.de
00007     Description          : Plot tool for calculating intensity profiles of
00008                            image markers.
00009 
00010  ***************************************************************************/
00011 
00012 /***************************************************************************
00013  *                                                                         *
00014  *  This program is free software; you can redistribute it and/or modify   *
00015  *  it under the terms of the GNU General Public License as published by   *
00016  *  the Free Software Foundation; either version 2 of the License, or      *
00017  *  (at your option) any later version.                                    *
00018  *                                                                         *
00019  *  This program is distributed in the hope that it will be useful,        *
00020  *  but WITHOUT ANY WARRANTY; without even the implied warranty of         *
00021  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the          *
00022  *  GNU General Public License for more details.                           *
00023  *                                                                         *
00024  *   You should have received a copy of the GNU General Public License     *
00025  *   along with this program; if not, write to the Free Software           *
00026  *   Foundation, Inc., 51 Franklin Street, Fifth Floor,                    *
00027  *   Boston, MA  02110-1301  USA                                           *
00028  *                                                                         *
00029  ***************************************************************************/
00030 #ifndef LINE_PROFILE_TOOL_H
00031 #define LINE_PROFILE_TOOL_H
00032 
00033 #include "PlotToolInterface.h"
00034 
00035 #include <QWidget>
00036 
00037 class QPoint;
00038 class QImage;
00039 class ImageMarker;
00040 class ApplicationWindow;
00041 
00061 class LineProfileTool : public QWidget, public PlotToolInterface
00062 {
00063     Q_OBJECT
00064 
00065     public:
00067         LineProfileTool(Graph *graph, ApplicationWindow *app, int average_pixels);
00068         void calculateLineProfile(const QPoint &start, const QPoint &end);
00069 
00070         virtual int rtti() const {return PlotToolInterface::Rtti_LineProfileTool;};
00071 
00072     signals:
00077         void statusText(const QString&);
00078 
00079     protected:
00080         int averageImagePixel(const QImage &image, int px, int py, bool moreHorizontal);
00081         void addLineMarker(const QPoint &start, const QPoint &end);
00084         virtual void paintEvent(QPaintEvent *e);
00089         virtual void mousePressEvent(QMouseEvent *e);
00092         virtual void mouseMoveEvent(QMouseEvent *e);
00095         virtual void mouseReleaseEvent(QMouseEvent *e);
00096 
00097     private:
00098         ApplicationWindow *d_app;
00100         int d_average_pixels;
00102         ImageMarker *d_target;
00105         QPoint d_op_start;
00107         QPoint d_op_dp;
00108 };
00109 
00110 #endif // ifndef LINE_PROFILE_TOOL_H
00111 

Generated on Thu Feb 7 13:59:27 2008 for QtiPlot by  doxygen 1.5.4