#include <qgsmapcanvasitem.h>
Inheritance diagram for QgsMapCanvasItem:


Definition at line 30 of file qgsmapcanvasitem.h.
Public Member Functions | |
| virtual void | updatePosition () |
| called on changed extent or resize event to update position of the item | |
| virtual QRectF | boundingRect () const |
| default implementation for canvas items | |
| void | setPanningOffset (const QPoint &point) |
| sets current offset, to be called from QgsMapCanvas | |
| QgsRectangle | rect () const |
| returns canvas item rectangle | |
| void | setRect (const QgsRectangle &r) |
| sets canvas item rectangle | |
| QgsPoint | toMapCoordinates (const QPoint &point) |
| transformation from screen coordinates to map coordinates | |
| QPointF | toCanvasCoordinates (const QgsPoint &point) |
| transformation from map coordinates to screen coordinates | |
Protected Member Functions | |
| QgsMapCanvasItem (QgsMapCanvas *mapCanvas) | |
| protected constructor: cannot be constructed directly | |
| virtual | ~QgsMapCanvasItem () |
| virtual void | paint (QPainter *painter)=0 |
| function to be implemented by derived classes | |
| virtual void | paint (QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget=0) |
| paint function called by map canvas | |
| void | updateCanvas () |
| schedules map canvas for repaint | |
Protected Attributes | |
| QgsMapCanvas * | mMapCanvas |
| pointer to map canvas | |
| QgsRectangle | mRect |
| canvas item rectangle (in map coordinates) | |
| QPoint | mPanningOffset |
| offset from normal position due current panning operation, used when converting map coordinates to move map canvas items | |
| QSizeF | mItemSize |
| cached size of the item (to return in boundingRect()) | |
| QgsMapCanvasItem::QgsMapCanvasItem | ( | QgsMapCanvas * | mapCanvas | ) | [protected] |
protected constructor: cannot be constructed directly
Definition at line 28 of file qgsmapcanvasitem.cpp.
| QgsMapCanvasItem::~QgsMapCanvasItem | ( | ) | [protected, virtual] |
Definition at line 34 of file qgsmapcanvasitem.cpp.
| virtual void QgsMapCanvasItem::paint | ( | QPainter * | painter | ) | [protected, pure virtual] |
function to be implemented by derived classes
Implemented in QgsRubberBand, and QgsVertexMarker.
Referenced by paint().
| void QgsMapCanvasItem::paint | ( | QPainter * | painter, | |
| const QStyleOptionGraphicsItem * | option, | |||
| QWidget * | widget = 0 | |||
| ) | [protected, virtual] |
paint function called by map canvas
Definition at line 39 of file qgsmapcanvasitem.cpp.
References paint().
| void QgsMapCanvasItem::updateCanvas | ( | ) | [protected] |
| void QgsMapCanvasItem::updatePosition | ( | ) | [virtual] |
called on changed extent or resize event to update position of the item
Reimplemented in QgsVertexMarker.
Definition at line 104 of file qgsmapcanvasitem.cpp.
| QRectF QgsMapCanvasItem::boundingRect | ( | ) | const [virtual] |
default implementation for canvas items
Reimplemented in QgsVertexMarker.
Definition at line 91 of file qgsmapcanvasitem.cpp.
References mItemSize.
| void QgsMapCanvasItem::setPanningOffset | ( | const QPoint & | point | ) |
sets current offset, to be called from QgsMapCanvas
Definition at line 111 of file qgsmapcanvasitem.cpp.
References mPanningOffset.
Referenced by QgsMapCanvas::moveCanvasContents().
| QgsRectangle QgsMapCanvasItem::rect | ( | ) | const |
returns canvas item rectangle
Definition at line 60 of file qgsmapcanvasitem.cpp.
References mRect.
Referenced by setRect().
| void QgsMapCanvasItem::setRect | ( | const QgsRectangle & | r | ) |
sets canvas item rectangle
Definition at line 66 of file qgsmapcanvasitem.cpp.
References QgsRectangle::isEmpty(), mItemSize, mRect, rect(), toCanvasCoordinates(), QgsRectangle::xMaximum(), QgsRectangle::xMinimum(), QgsRectangle::yMaximum(), and QgsRectangle::yMinimum().
Referenced by updatePosition(), and QgsRubberBand::updateRect().
| QgsPoint QgsMapCanvasItem::toMapCoordinates | ( | const QPoint & | point | ) |
transformation from screen coordinates to map coordinates
Definition at line 46 of file qgsmapcanvasitem.cpp.
References QgsMapCanvas::getCoordinateTransform(), mMapCanvas, mPanningOffset, and QgsMapToPixel::toMapCoordinates().
| QPointF QgsMapCanvasItem::toCanvasCoordinates | ( | const QgsPoint & | point | ) |
transformation from map coordinates to screen coordinates
Definition at line 52 of file qgsmapcanvasitem.cpp.
References QgsMapCanvas::getCoordinateTransform(), mMapCanvas, mPanningOffset, QgsMapToPixel::transformInPlace(), QgsPoint::x(), and QgsPoint::y().
Referenced by QgsRubberBand::paint(), QgsVertexMarker::setCenter(), and setRect().
QgsMapCanvas* QgsMapCanvasItem::mMapCanvas [protected] |
pointer to map canvas
Definition at line 77 of file qgsmapcanvasitem.h.
Referenced by QgsRubberBand::setToGeometry(), toCanvasCoordinates(), and toMapCoordinates().
QgsRectangle QgsMapCanvasItem::mRect [protected] |
canvas item rectangle (in map coordinates)
Definition at line 80 of file qgsmapcanvasitem.h.
Referenced by rect(), setRect(), and updatePosition().
QPoint QgsMapCanvasItem::mPanningOffset [protected] |
offset from normal position due current panning operation, used when converting map coordinates to move map canvas items
Definition at line 84 of file qgsmapcanvasitem.h.
Referenced by setPanningOffset(), toCanvasCoordinates(), and toMapCoordinates().
QSizeF QgsMapCanvasItem::mItemSize [protected] |
cached size of the item (to return in boundingRect())
Definition at line 87 of file qgsmapcanvasitem.h.
Referenced by boundingRect(), and setRect().
1.5.1