/
qgsmapcanvasitem.sip
52 lines (33 loc) · 1.34 KB
/
qgsmapcanvasitem.sip
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
class QgsMapCanvasItem : QGraphicsItem
{
%TypeHeaderCode
#include <qgsmapcanvasitem.h>
%End
protected:
//! protected constructor: cannot be constructed directly
QgsMapCanvasItem(QgsMapCanvas* mapCanvas /TransferThis/);
virtual ~QgsMapCanvasItem();
//! function to be implemented by derived classes
virtual void paint(QPainter * painter) = 0;
//! paint function called by map canvas
virtual void paint(QPainter * painter,
const QStyleOptionGraphicsItem * option,
QWidget * widget = 0);
//! schedules map canvas for repaint
void updateCanvas();
public:
//! called on changed extent or resize event to update position of the item
virtual void updatePosition();
//! default implementation for canvas items
virtual QRectF boundingRect() const;
//! sets current offset, to be called from QgsMapCanvas
void setPanningOffset(const QPoint& point);
//! returns canvas item rectangle
QgsRect rect() const;
//! sets canvas item rectangle
void setRect(const QgsRect& r);
//! transformation from screen coordinates to map coordinates
QgsPoint toMapCoordinates(const QPoint& point);
//! transformation from map coordinates to screen coordinates
QPointF toCanvasCoordinates(const QgsPoint& point);
};