Quantum GIS API Documentation
1.8
|
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 00016 #ifndef QGSMAPCANVASMAP_H 00017 #define QGSMAPCANVASMAP_H 00018 00019 #include <QGraphicsRectItem> 00020 #include <QPixmap> 00021 00022 #include <qgis.h> 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 00052 Q_DECL_DEPRECATED QPixmap& pixmap() { return mPixmap; } 00053 00054 QPaintDevice& paintDevice(); 00055 00056 void paint( QPainter* p, const QStyleOptionGraphicsItem*, QWidget* ); 00057 00058 QRectF boundingRect() const; 00059 00062 void updateContents(); 00063 00064 private: 00065 00067 bool mAntiAliasing; 00068 00070 bool mUseQImageToRender; 00071 00072 QPixmap mPixmap; 00073 QImage mImage; 00074 00075 //QgsMapRenderer* mRender; 00076 QgsMapCanvas* mCanvas; 00077 00078 QColor mBgColor; 00079 00080 QPoint mOffset; 00081 }; 00082 00083 #endif