Quantum GIS API Documentation
1.7.4
|
00001 /*************************************************************************** 00002 qgsmapcanvasmap.h - draws the map in map canvas 00003 ---------------------- 00004 begin : February 2006 00005 copyright : (C) 2006 by Martin Dobias 00006 email : wonder.sk at gmail dot com 00007 *************************************************************************** 00008 * * 00009 * This program is free software; you can redistribute it and/or modify * 00010 * it under the terms of the GNU General Public License as published by * 00011 * the Free Software Foundation; either version 2 of the License, or * 00012 * (at your option) any later version. * 00013 * * 00014 ***************************************************************************/ 00015 /* $Id$ */ 00016 00017 #ifndef QGSMAPCANVASMAP_H 00018 #define QGSMAPCANVASMAP_H 00019 00020 #include <QGraphicsRectItem> 00021 #include <QPixmap> 00022 00023 #include <qgis.h> 00024 00025 class QgsMapRenderer; 00026 class QgsMapCanvas; 00027 00031 class GUI_EXPORT QgsMapCanvasMap : public QGraphicsRectItem 00032 { 00033 public: 00034 00036 QgsMapCanvasMap( QgsMapCanvas* canvas ); 00037 00039 void resize( QSize size ); 00040 00041 void enableAntiAliasing( bool flag ) { mAntiAliasing = flag; } 00042 00043 void useImageToRender( bool flag ) { mUseQImageToRender = flag; } 00044 00046 void render(); 00047 00048 void setBackgroundColor( const QColor& color ) { mBgColor = color; } 00049 00050 void setPanningOffset( const QPoint& point ); 00051 00053 Q_DECL_DEPRECATED 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 //QgsMapRenderer* mRender; 00077 QgsMapCanvas* mCanvas; 00078 00079 QColor mBgColor; 00080 00081 QPoint mOffset; 00082 }; 00083 00084 #endif