ImageMarker.h

Go to the documentation of this file.
00001 /***************************************************************************
00002     File                 : ImageMarker.h
00003     Project              : QtiPlot
00004     --------------------------------------------------------------------
00005     Copyright            : (C) 2007 by Ion Vasilief, Knut Franke
00006     Email (use @ for *)  : ion_vasilief*yahoo.fr, knut.franke*gmx.de
00007     Description          : Draw images on a QwtPlot.
00008 
00009  ***************************************************************************/
00010 
00011 /***************************************************************************
00012  *                                                                         *
00013  *  This program is free software; you can redistribute it and/or modify   *
00014  *  it under the terms of the GNU General Public License as published by   *
00015  *  the Free Software Foundation; either version 2 of the License, or      *
00016  *  (at your option) any later version.                                    *
00017  *                                                                         *
00018  *  This program is distributed in the hope that it will be useful,        *
00019  *  but WITHOUT ANY WARRANTY; without even the implied warranty of         *
00020  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the          *
00021  *  GNU General Public License for more details.                           *
00022  *                                                                         *
00023  *   You should have received a copy of the GNU General Public License     *
00024  *   along with this program; if not, write to the Free Software           *
00025  *   Foundation, Inc., 51 Franklin Street, Fifth Floor,                    *
00026  *   Boston, MA  02110-1301  USA                                           *
00027  *                                                                         *
00028  ***************************************************************************/
00029 #ifndef IMAGEMARKER_H
00030 #define IMAGEMARKER_H
00031 
00032 #include <qwt_plot.h>
00033 #include "PlotEnrichement.h"
00034 
00035 #include <QPixmap>
00036 
00064 class ImageMarker: public PlotEnrichement
00065 {
00066 public:
00068     ImageMarker(const QString& fn);
00069 
00071     QRect rect() const;
00073     void setRect(int x, int y, int w, int h);
00074 
00076     virtual QwtDoubleRect boundingRect() const;
00078     void setBoundingRect(double left, double top, double right, double bottom);
00079 
00080     double right(){return d_x_right;};
00081     double bottom(){return d_y_bottom;};
00082 
00084     QSize size() {return rect().size();};
00086     void setSize(const QSize& size);
00088     void setSize(int w, int h){setSize(QSize(w, h));};
00089 
00091     QPoint origin() const { return rect().topLeft(); };
00093     void setOrigin(const QPoint &p);
00094 
00096     void setFileName(const QString& fn) { d_file_name = fn; };
00098     QString fileName(){return d_file_name;};
00099 
00101     QPixmap pixmap() const {return d_pic;};
00102 
00103     void updateBoundingRect();
00104 
00105 private:
00107     void draw(QPainter *p, const QwtScaleMap &xMap, const QwtScaleMap &yMap, const QRect &r) const;
00109     QPoint d_pos;
00111     QPixmap d_pic;
00113     QSize d_size;
00115     QString d_file_name;
00117     double d_x_right;
00119     double d_y_bottom;
00120 };
00121 
00122 #endif

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