00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef QGSMAPCANVASMAP_H
00018 #define QGSMAPCANVASMAP_H
00019
00020 #include <QGraphicsRectItem>
00021 #include <QPixmap>
00022
00023
00024 class QgsMapRenderer;
00025 class QgsMapCanvas;
00026
00030 class GUI_EXPORT QgsMapCanvasMap : public QGraphicsRectItem
00031 {
00032 public:
00033
00035 QgsMapCanvasMap( QgsMapCanvas* canvas );
00036
00038 void resize( QSize size );
00039
00040 void enableAntiAliasing( bool flag ) { mAntiAliasing = flag; }
00041
00042 void useImageToRender( bool flag ) { mUseQImageToRender = flag; }
00043
00045 void render();
00046
00047 void setBackgroundColor( const QColor& color ) { mBgColor = color; }
00048
00049 void setPanningOffset( const QPoint& point );
00050
00051
00052
00053 QPixmap& pixmap() { return mPixmap; }
00054
00055 QPaintDevice& paintDevice();
00056
00057 void paint( QPainter* p, const QStyleOptionGraphicsItem*, QWidget* );
00058
00059 QRectF boundingRect() const;
00060
00063 void updateContents();
00064
00065 private:
00066
00068 bool mAntiAliasing;
00069
00071 bool mUseQImageToRender;
00072
00073 QPixmap mPixmap;
00074 QImage mImage;
00075
00076
00077 QgsMapCanvas* mCanvas;
00078
00079 QColor mBgColor;
00080
00081 QPoint mOffset;
00082 };
00083
00084 #endif