PixmapWidget.h

00001 /* -- 2007-05-07 -- 
00002  *  ardev - an augmented reality library for robot developers
00003  *  Copyright 2005-2007 - Toby Collett (ardev _at_ plan9.net.nz)
00004  *
00005  *  This library is free software; you can redistribute it and/or
00006  *  modify it under the terms of the GNU Lesser General Public
00007  *  License as published by the Free Software Foundation; either
00008  *  version 2.1 of the License, or (at your option) any later version.
00009  *
00010  *  This library is distributed in the hope that it will be useful,
00011  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00012  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
00013  *  Lesser General Public License for more details.
00014  *
00015  *  You should have received a copy of the GNU Lesser General Public
00016  *  License along with this library; if not, write to the Free Software
00017  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 
00018  *
00019  */
00020 #ifndef PIXMAPWIDGET_H
00021 #define PIXMAPWIDGET_H
00022 
00023 #include <QWidget>
00024 #include <QLabel>
00025 #include <QPixmap>
00026 #include <QString>
00027 
00028 #include <list>
00029 
00030 #include <libthjc/geometry.h>
00031 
00032 class PixmapWidget : public QLabel
00033 {
00034         Q_OBJECT
00035         
00036 public:
00037         PixmapWidget(QWidget *parent=0 );
00038         ~PixmapWidget();
00039 
00040         void setImage(const QImage & Im);
00041         void setPoints(std::list<Point2D> aPoints) {mPoints=aPoints;repaint();};
00042         void clearPoints() {mPoints.clear();repaint();};
00043 
00044 public slots:
00045         void setZoomFactor( float );
00046         
00047 signals:
00048         void zoomFactorChanged( float );
00049 
00050 protected:
00051         void paintEvent( QPaintEvent* );
00052         void wheelEvent( QWheelEvent* );
00053 
00054 private:
00055         QPixmap m_pm;
00056         float zoomFactor;
00057 
00058         std::list<Point2D> mPoints;
00059 };
00060 
00061 #endif // PIXMAPWIDGET_H

SourceForge.net Logo Generated on Sat May 12 15:25:43 2007 for ardev by doxygen 1.5.1