QGIS API Documentation
2.8.2-Wien
|
An abstract class for items that can be placed on the map canvas. More...
#include <qgsmapcanvasitem.h>
Public Member Functions | |
virtual QRectF | boundingRect () const override |
default implementation for canvas items | |
QgsRectangle | rect () const |
returns canvas item rectangle in map units | |
Q_DECL_DEPRECATED void | setPanningOffset (const QPoint &point) |
sets current offset, to be called from QgsMapCanvas | |
void | setRect (const QgsRectangle &r, bool resetRotation=true) |
sets canvas item rectangle in map units | |
QPointF | toCanvasCoordinates (const QgsPoint &point) const |
transformation from map coordinates to screen coordinates | |
QgsPoint | toMapCoordinates (const QPoint &point) const |
transformation from screen coordinates to map coordinates | |
virtual void | updatePosition () |
called on changed extent or resize event to update position of the item |
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) override |
paint function called by map canvas | |
bool | setRenderContextVariables (QPainter *p, QgsRenderContext &context) const |
Sets render context parameters. | |
void | updateCanvas () |
schedules map canvas for repaint |
Protected Attributes | |
QSizeF | mItemSize |
cached size of the item (to return in boundingRect()) | |
QgsMapCanvas * | mMapCanvas |
pointer to map canvas | |
QPoint | mPanningOffset |
offset from normal position due current panning operation, used when converting map coordinates to move map canvas items | |
QgsRectangle | mRect |
cached canvas item rectangle in map coordinates encodes position (xmin,ymax) and size (width/height) used to re-position and re-size the item on zoom/pan while waiting for the renderer to complete. | |
double | mRectRotation |
An abstract class for items that can be placed on the map canvas.
Definition at line 30 of file qgsmapcanvasitem.h.
|
protected |
protected constructor: cannot be constructed directly
Definition at line 29 of file qgsmapcanvasitem.cpp.
|
protectedvirtual |
Definition at line 40 of file qgsmapcanvasitem.cpp.
|
overridevirtual |
default implementation for canvas items
Reimplemented in QgsAnnotationItem, and QgsVertexMarker.
Definition at line 109 of file qgsmapcanvasitem.cpp.
|
protectedpure virtual |
function to be implemented by derived classes
Implemented in QgsRubberBand, QgsHighlight, QgsVertexMarker, QgsMapCanvasMap, QgsTextAnnotationItem, QgsHtmlAnnotationItem, QgsFormAnnotationItem, and QgsSvgAnnotationItem.
|
overrideprotectedvirtual |
paint function called by map canvas
Reimplemented in QgsHtmlAnnotationItem, and QgsFormAnnotationItem.
Definition at line 45 of file qgsmapcanvasitem.cpp.
QgsRectangle QgsMapCanvasItem::rect | ( | ) | const |
returns canvas item rectangle in map units
Definition at line 71 of file qgsmapcanvasitem.cpp.
void QgsMapCanvasItem::setPanningOffset | ( | const QPoint & | point | ) |
sets current offset, to be called from QgsMapCanvas
Reimplemented in QgsMapCanvasMap.
Definition at line 147 of file qgsmapcanvasitem.cpp.
void QgsMapCanvasItem::setRect | ( | const QgsRectangle & | r, |
bool | resetRotation = true |
||
) |
sets canvas item rectangle in map units
Definition at line 77 of file qgsmapcanvasitem.cpp.
|
protected |
Sets render context parameters.
p | painter for rendering |
context | out: configured context |
Definition at line 122 of file qgsmapcanvasitem.cpp.
QPointF QgsMapCanvasItem::toCanvasCoordinates | ( | const QgsPoint & | point | ) | const |
transformation from map coordinates to screen coordinates
Definition at line 64 of file qgsmapcanvasitem.cpp.
QgsPoint QgsMapCanvasItem::toMapCoordinates | ( | const QPoint & | point | ) | const |
transformation from screen coordinates to map coordinates
Definition at line 58 of file qgsmapcanvasitem.cpp.
|
protected |
schedules map canvas for repaint
Definition at line 115 of file qgsmapcanvasitem.cpp.
|
virtual |
called on changed extent or resize event to update position of the item
Reimplemented in QgsRubberBand, QgsHighlight, QgsVertexMarker, and QgsAnnotationItem.
Definition at line 139 of file qgsmapcanvasitem.cpp.
|
protected |
cached size of the item (to return in boundingRect())
Definition at line 103 of file qgsmapcanvasitem.h.
|
protected |
pointer to map canvas
Definition at line 83 of file qgsmapcanvasitem.h.
|
protected |
offset from normal position due current panning operation, used when converting map coordinates to move map canvas items
Definition at line 100 of file qgsmapcanvasitem.h.
|
protected |
cached canvas item rectangle in map coordinates encodes position (xmin,ymax) and size (width/height) used to re-position and re-size the item on zoom/pan while waiting for the renderer to complete.
NOTE: does not include rotation information, so cannot be used to correctly present pre-rendered map on rotation change
Definition at line 93 of file qgsmapcanvasitem.h.
|
protected |
Definition at line 95 of file qgsmapcanvasitem.h.