QGIS API Documentation  master-6227475
src/gui/qgsmapcanvasmap.h
Go to the documentation of this file.
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 
00051     QPaintDevice& paintDevice();
00052 
00053     void paint( QPainter* p, const QStyleOptionGraphicsItem*, QWidget* );
00054 
00055     QRectF boundingRect() const;
00056 
00059     void updateContents();
00060 
00061   private:
00062 
00064     bool mAntiAliasing;
00065 
00067     bool mUseQImageToRender;
00068 
00069     QPixmap mPixmap;
00070     QImage mImage;
00071 
00072     //QgsMapRenderer* mRender;
00073     QgsMapCanvas* mCanvas;
00074 
00075     QColor mBgColor;
00076 
00077     QPoint mOffset;
00078 };
00079 
00080 #endif
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines