ImageMarker.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
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);
00095 void setOrigin(int x, int y){setOrigin(QPoint(x, y));};
00096
00098 void setFileName(const QString& fn) { d_file_name = fn; };
00100 QString fileName(){return d_file_name;};
00101
00103 QPixmap pixmap() const {return d_pic;};
00104
00105 void updateBoundingRect();
00106
00107 private:
00109 void draw(QPainter *p, const QwtScaleMap &xMap, const QwtScaleMap &yMap, const QRect &r) const;
00111 QPoint d_pos;
00113 QPixmap d_pic;
00115 QSize d_size;
00117 QString d_file_name;
00119 double d_x_right;
00121 double d_y_bottom;
00122 };
00123
00124 #endif