24
24
#include <QMouseEvent>
25
25
#include <QWheelEvent>
27
#include <QStringList>
30
30
class QgsMapCanvas;
32
32
class QgsPanningWidget; // defined in .cpp
34
class QgsMapOverviewCanvas : public QWidget
36
* A widget that displays an overview map.
38
class GUI_EXPORT QgsMapOverviewCanvas : public QWidget
39
QgsMapOverviewCanvas(QWidget * parent = 0, QgsMapCanvas* mapCanvas = NULL);
43
QgsMapOverviewCanvas( QWidget * parent = 0, QgsMapCanvas* mapCanvas = NULL );
41
45
~QgsMapOverviewCanvas();
43
47
//! used for overview canvas to reflect changed extent in main map canvas
44
void reflectChangedExtent();
48
void drawExtentRect();
46
50
//! renders overview and updates panning widget
49
53
//! changes background color
50
void setbgColor(const QColor& color);
54
void setBackgroundColor( const QColor& color );
52
56
//! updates layer set for overview
53
void setLayerSet(std::deque<QString>& layerSet);
55
void enableAntiAliasing(bool flag) { mAntiAliasing = flag; }
57
void updateFullExtent();
57
void setLayerSet( const QStringList& layerSet );
59
QStringList& layerSet();
61
void enableAntiAliasing( bool flag ) { mAntiAliasing = flag; }
63
void updateFullExtent( const QgsRectangle& rect );
67
void hasCrsTransformEnabled( bool flag );
69
void destinationSrsChanged();
61
73
//! Overridden paint event
62
void paintEvent(QPaintEvent * pe);
74
void paintEvent( QPaintEvent * pe );
64
76
//! Overridden resize event
65
void resizeEvent(QResizeEvent * e);
77
void resizeEvent( QResizeEvent * e );
67
79
//! Overridden mouse move event
68
void mouseMoveEvent(QMouseEvent * e);
80
void mouseMoveEvent( QMouseEvent * e );
70
82
//! Overridden mouse press event
71
void mousePressEvent(QMouseEvent * e);
83
void mousePressEvent( QMouseEvent * e );
73
85
//! Overridden mouse release event
74
void mouseReleaseEvent(QMouseEvent * e);
86
void mouseReleaseEvent( QMouseEvent * e );
76
88
//! called when panning to reflect mouse movement
77
void updatePanningWidget(const QPoint& pos);
89
void updatePanningWidget( const QPoint& pos );
79
91
//! widget for panning map in overview
80
92
QgsPanningWidget* mPanningWidget;
82
94
//! position of cursor inside panning widget
83
95
QPoint mPanningCursorOffset;
85
97
//! main map canvas - used to get/set extent
86
98
QgsMapCanvas* mMapCanvas;
88
100
//! for rendering overview
89
QgsMapRender* mMapRender;
101
QgsMapRenderer* mMapRenderer;
91
103
//! pixmap where the map is stored
94
106
//! background color