QGIS API Documentation
2.18.21-Las Palmas (9fba24a)
|
A class for drawing transient features (e.g. More...
#include <qgsrubberband.h>
Public Types | |
enum | IconType { ICON_NONE, ICON_CROSS, ICON_X, ICON_BOX, ICON_CIRCLE, ICON_FULL_BOX } |
Icons. More... | |
Public Member Functions | |
QgsRubberBand (QgsMapCanvas *mapCanvas, QGis::GeometryType geometryType=QGis::Line) | |
Creates a new RubberBand. More... | |
Q_DECL_DEPRECATED | QgsRubberBand (QgsMapCanvas *mapCanvas, bool isPolygon) |
Creates a new RubberBand. More... | |
~QgsRubberBand () | |
void | addGeometry (const QgsGeometry *geom, QgsVectorLayer *layer) |
Add the geometry of an existing feature to a rubberband This is useful for multi feature highlighting. More... | |
void | addPoint (const QgsPoint &p, bool doUpdate=true, int geometryIndex=0) |
Add a vertex to the rubberband and update canvas. More... | |
QgsGeometry * | asGeometry () |
Returns the rubberband as a Geometry. More... | |
void | closePoints (bool doUpdate=true, int geometryIndex=0) |
Ensures that a polygon geometry is closed and that the last vertex equals the first vertex. More... | |
const QgsPoint * | getPoint (int i, int j=0) const |
Return vertex. More... | |
void | movePoint (const QgsPoint &p, int geometryIndex=0) |
Moves the rubber band point specified by index. More... | |
void | movePoint (int index, const QgsPoint &p, int geometryIndex=0) |
Moves the rubber band point specified by index. More... | |
int | numberOfVertices () const |
Returns count of vertices in all lists of mPoint. More... | |
int | partSize (int geometryIndex) const |
Returns number of vertices in feature part. More... | |
void | removeLastPoint (int geometryIndex=0, bool doUpdate=true) |
Removes the last point. More... | |
void | removePoint (int index=0, bool doUpdate=true, int geometryIndex=0) |
Remove a vertex from the rubberband and (optionally) update canvas. More... | |
void | reset (QGis::GeometryType geometryType=QGis::Line) |
Clears all the geometries in this rubberband. More... | |
Q_DECL_DEPRECATED void | reset (bool isPolygon) |
void | setBorderColor (const QColor &color) |
Set the border color for the rubberband. More... | |
void | setBrushStyle (Qt::BrushStyle brushStyle) |
Set the style of the brush. More... | |
void | setColor (const QColor &color) |
Set the color for the rubberband. More... | |
void | setFillColor (const QColor &color) |
Set the fill color for the rubberband. More... | |
void | setIcon (IconType icon) |
Set the icon type to highlight point geometries. More... | |
void | setIconSize (int iconSize) |
Set the size of the point icons. More... | |
void | setLineStyle (Qt::PenStyle penStyle) |
Set the style of the line. More... | |
void | setToCanvasRectangle (QRect rect) |
Sets this rubber band to a map canvas rectangle. More... | |
void | setToGeometry (const QgsGeometry *geom, QgsVectorLayer *layer) |
Sets this rubber band to the geometry of an existing feature. More... | |
void | setTranslationOffset (double dx, double dy) |
Adds translation to original coordinates (all in map coordinates) More... | |
void | setWidth (int width) |
Set the width of the line. More... | |
int | size () const |
Returns number of geometries. More... | |
virtual void | updatePosition () override |
called on changed extent or resize event to update position of the item More... | |
Public Member Functions inherited from QgsMapCanvasItem | |
virtual QRectF | boundingRect () const override |
default implementation for canvas items More... | |
QgsRectangle | rect () const |
returns canvas item rectangle in map units More... | |
Q_DECL_DEPRECATED void | setPanningOffset (QPoint point) |
sets current offset, to be called from QgsMapCanvas More... | |
void | setRect (const QgsRectangle &r, bool resetRotation=true) |
sets canvas item rectangle in map units More... | |
QPointF | toCanvasCoordinates (const QgsPoint &point) const |
transformation from map coordinates to screen coordinates More... | |
QgsPoint | toMapCoordinates (QPoint point) const |
transformation from screen coordinates to map coordinates More... | |
Public Member Functions inherited from QGraphicsItem | |
QGraphicsItem (QGraphicsItem *parent) | |
virtual | ~QGraphicsItem () |
bool | acceptDrops () const |
Qt::MouseButtons | acceptedMouseButtons () const |
bool | acceptHoverEvents () const |
bool | acceptsHoverEvents () const |
bool | acceptTouchEvents () const |
virtual void | advance (int phase) |
virtual QRectF | boundingRect () const=0 |
QRegion | boundingRegion (const QTransform &itemToDeviceTransform) const |
qreal | boundingRegionGranularity () const |
CacheMode | cacheMode () const |
QList< QGraphicsItem * > | childItems () const |
QList< QGraphicsItem * > | children () const |
QRectF | childrenBoundingRect () const |
void | clearFocus () |
QPainterPath | clipPath () const |
virtual bool | collidesWithItem (const QGraphicsItem *other, Qt::ItemSelectionMode mode) const |
virtual bool | collidesWithPath (const QPainterPath &path, Qt::ItemSelectionMode mode) const |
QList< QGraphicsItem * > | collidingItems (Qt::ItemSelectionMode mode) const |
QGraphicsItem * | commonAncestorItem (const QGraphicsItem *other) const |
virtual bool | contains (const QPointF &point) const |
QCursor | cursor () const |
QVariant | data (int key) const |
QTransform | deviceTransform (const QTransform &viewportTransform) const |
qreal | effectiveOpacity () const |
void | ensureVisible (const QRectF &rect, int xmargin, int ymargin) |
void | ensureVisible (qreal x, qreal y, qreal w, qreal h, int xmargin, int ymargin) |
bool | filtersChildEvents () const |
GraphicsItemFlags | flags () const |
QGraphicsItem * | focusItem () const |
QGraphicsItem * | focusProxy () const |
void | grabKeyboard () |
void | grabMouse () |
QGraphicsEffect * | graphicsEffect () const |
QGraphicsItemGroup * | group () const |
bool | handlesChildEvents () const |
bool | hasCursor () const |
bool | hasFocus () const |
void | hide () |
Qt::InputMethodHints | inputMethodHints () const |
void | installSceneEventFilter (QGraphicsItem *filterItem) |
bool | isActive () const |
bool | isAncestorOf (const QGraphicsItem *child) const |
bool | isBlockedByModalPanel (QGraphicsItem **blockingPanel) const |
bool | isClipped () const |
bool | isEnabled () const |
bool | isObscured () const |
bool | isObscured (const QRectF &rect) const |
bool | isObscured (qreal x, qreal y, qreal w, qreal h) const |
virtual bool | isObscuredBy (const QGraphicsItem *item) const |
bool | isPanel () const |
bool | isSelected () const |
bool | isUnderMouse () const |
bool | isVisible () const |
bool | isVisibleTo (const QGraphicsItem *parent) const |
bool | isWidget () const |
bool | isWindow () const |
QTransform | itemTransform (const QGraphicsItem *other, bool *ok) const |
QPointF | mapFromItem (const QGraphicsItem *item, const QPointF &point) const |
QPolygonF | mapFromItem (const QGraphicsItem *item, const QRectF &rect) const |
QPolygonF | mapFromItem (const QGraphicsItem *item, const QPolygonF &polygon) const |
QPainterPath | mapFromItem (const QGraphicsItem *item, const QPainterPath &path) const |
QPointF | mapFromItem (const QGraphicsItem *item, qreal x, qreal y) const |
QPolygonF | mapFromItem (const QGraphicsItem *item, qreal x, qreal y, qreal w, qreal h) const |
QPointF | mapFromParent (const QPointF &point) const |
QPolygonF | mapFromParent (const QRectF &rect) const |
QPolygonF | mapFromParent (const QPolygonF &polygon) const |
QPainterPath | mapFromParent (const QPainterPath &path) const |
QPointF | mapFromParent (qreal x, qreal y) const |
QPolygonF | mapFromParent (qreal x, qreal y, qreal w, qreal h) const |
QPolygonF | mapFromScene (const QPolygonF &polygon) const |
QPointF | mapFromScene (const QPointF &point) const |
QPolygonF | mapFromScene (const QRectF &rect) const |
QPainterPath | mapFromScene (const QPainterPath &path) const |
QPointF | mapFromScene (qreal x, qreal y) const |
QPolygonF | mapFromScene (qreal x, qreal y, qreal w, qreal h) const |
QRectF | mapRectFromItem (const QGraphicsItem *item, const QRectF &rect) const |
QRectF | mapRectFromItem (const QGraphicsItem *item, qreal x, qreal y, qreal w, qreal h) const |
QRectF | mapRectFromParent (const QRectF &rect) const |
QRectF | mapRectFromParent (qreal x, qreal y, qreal w, qreal h) const |
QRectF | mapRectFromScene (qreal x, qreal y, qreal w, qreal h) const |
QRectF | mapRectFromScene (const QRectF &rect) const |
QRectF | mapRectToItem (const QGraphicsItem *item, const QRectF &rect) const |
QRectF | mapRectToItem (const QGraphicsItem *item, qreal x, qreal y, qreal w, qreal h) const |
QRectF | mapRectToParent (const QRectF &rect) const |
QRectF | mapRectToParent (qreal x, qreal y, qreal w, qreal h) const |
QRectF | mapRectToScene (const QRectF &rect) const |
QRectF | mapRectToScene (qreal x, qreal y, qreal w, qreal h) const |
QPointF | mapToItem (const QGraphicsItem *item, const QPointF &point) const |
QPolygonF | mapToItem (const QGraphicsItem *item, const QRectF &rect) const |
QPolygonF | mapToItem (const QGraphicsItem *item, const QPolygonF &polygon) const |
QPainterPath | mapToItem (const QGraphicsItem *item, const QPainterPath &path) const |
QPointF | mapToItem (const QGraphicsItem *item, qreal x, qreal y) const |
QPolygonF | mapToItem (const QGraphicsItem *item, qreal x, qreal y, qreal w, qreal h) const |
QPointF | mapToParent (const QPointF &point) const |
QPolygonF | mapToParent (const QRectF &rect) const |
QPainterPath | mapToParent (const QPainterPath &path) const |
QPointF | mapToParent (qreal x, qreal y) const |
QPolygonF | mapToParent (qreal x, qreal y, qreal w, qreal h) const |
QPolygonF | mapToParent (const QPolygonF &polygon) const |
QPolygonF | mapToScene (const QRectF &rect) const |
QPainterPath | mapToScene (const QPainterPath &path) const |
QPointF | mapToScene (qreal x, qreal y) const |
QPolygonF | mapToScene (qreal x, qreal y, qreal w, qreal h) const |
QPolygonF | mapToScene (const QPolygonF &polygon) const |
QPointF | mapToScene (const QPointF &point) const |
QMatrix | matrix () const |
void | moveBy (qreal dx, qreal dy) |
qreal | opacity () const |
virtual QPainterPath | opaqueArea () const |
virtual void | paint (QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget)=0 |
QGraphicsItem * | panel () const |
PanelModality | panelModality () const |
QGraphicsItem * | parentItem () const |
QGraphicsObject * | parentObject () const |
QGraphicsWidget * | parentWidget () const |
QPointF | pos () const |
void | removeSceneEventFilter (QGraphicsItem *filterItem) |
void | resetMatrix () |
void | resetTransform () |
void | rotate (qreal angle) |
qreal | rotation () const |
void | scale (qreal sx, qreal sy) |
qreal | scale () const |
QGraphicsScene * | scene () const |
QRectF | sceneBoundingRect () const |
QMatrix | sceneMatrix () const |
QPointF | scenePos () const |
QTransform | sceneTransform () const |
void | scroll (qreal dx, qreal dy, const QRectF &rect) |
void | setAcceptDrops (bool on) |
void | setAcceptedMouseButtons (QFlags< Qt::MouseButton > buttons) |
void | setAcceptHoverEvents (bool enabled) |
void | setAcceptsHoverEvents (bool enabled) |
void | setAcceptTouchEvents (bool enabled) |
void | setActive (bool active) |
void | setBoundingRegionGranularity (qreal granularity) |
void | setCacheMode (CacheMode mode, const QSize &logicalCacheSize) |
void | setCursor (const QCursor &cursor) |
void | setData (int key, const QVariant &value) |
void | setEnabled (bool enabled) |
void | setFiltersChildEvents (bool enabled) |
void | setFlag (GraphicsItemFlag flag, bool enabled) |
void | setFlags (QFlags< QGraphicsItem::GraphicsItemFlag > flags) |
void | setFocus (Qt::FocusReason focusReason) |
void | setFocusProxy (QGraphicsItem *item) |
void | setGraphicsEffect (QGraphicsEffect *effect) |
void | setGroup (QGraphicsItemGroup *group) |
void | setHandlesChildEvents (bool enabled) |
void | setInputMethodHints (QFlags< Qt::InputMethodHint > hints) |
void | setMatrix (const QMatrix &matrix, bool combine) |
void | setOpacity (qreal opacity) |
void | setPanelModality (PanelModality panelModality) |
void | setParentItem (QGraphicsItem *newParent) |
void | setPos (const QPointF &pos) |
void | setPos (qreal x, qreal y) |
void | setRotation (qreal angle) |
void | setScale (qreal factor) |
void | setSelected (bool selected) |
void | setToolTip (const QString &toolTip) |
void | setTransform (const QTransform &matrix, bool combine) |
void | setTransformations (const QList< QGraphicsTransform * > &transformations) |
void | setTransformOriginPoint (qreal x, qreal y) |
void | setTransformOriginPoint (const QPointF &origin) |
void | setVisible (bool visible) |
void | setX (qreal x) |
void | setY (qreal y) |
void | setZValue (qreal z) |
virtual QPainterPath | shape () const |
void | shear (qreal sh, qreal sv) |
void | show () |
void | stackBefore (const QGraphicsItem *sibling) |
QGraphicsObject * | toGraphicsObject () |
const QGraphicsObject * | toGraphicsObject () const |
QString | toolTip () const |
QGraphicsItem * | topLevelItem () const |
QGraphicsWidget * | topLevelWidget () const |
QTransform | transform () const |
QList< QGraphicsTransform * > | transformations () const |
QPointF | transformOriginPoint () const |
void | translate (qreal dx, qreal dy) |
virtual int | type () const |
void | ungrabKeyboard () |
void | ungrabMouse () |
void | unsetCursor () |
void | update (qreal x, qreal y, qreal width, qreal height) |
void | update (const QRectF &rect) |
QGraphicsWidget * | window () const |
qreal | x () const |
qreal | y () const |
qreal | zValue () const |
Protected Member Functions | |
virtual void | paint (QPainter *p) override |
void | updateRect () |
recalculates needed rectangle More... | |
Protected Member Functions inherited from QgsMapCanvasItem | |
QgsMapCanvasItem (QgsMapCanvas *mapCanvas) | |
protected constructor: cannot be constructed directly More... | |
virtual | ~QgsMapCanvasItem () |
virtual void | paint (QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget=nullptr) override |
paint function called by map canvas More... | |
bool | setRenderContextVariables (QPainter *p, QgsRenderContext &context) const |
Sets render context parameters. More... | |
void | updateCanvas () |
schedules map canvas for repaint More... | |
Protected Member Functions inherited from QGraphicsItem | |
virtual void | contextMenuEvent (QGraphicsSceneContextMenuEvent *event) |
virtual void | dragEnterEvent (QGraphicsSceneDragDropEvent *event) |
virtual void | dragLeaveEvent (QGraphicsSceneDragDropEvent *event) |
virtual void | dragMoveEvent (QGraphicsSceneDragDropEvent *event) |
virtual void | dropEvent (QGraphicsSceneDragDropEvent *event) |
virtual void | focusInEvent (QFocusEvent *event) |
virtual void | focusOutEvent (QFocusEvent *event) |
virtual void | hoverEnterEvent (QGraphicsSceneHoverEvent *event) |
virtual void | hoverLeaveEvent (QGraphicsSceneHoverEvent *event) |
virtual void | hoverMoveEvent (QGraphicsSceneHoverEvent *event) |
virtual void | inputMethodEvent (QInputMethodEvent *event) |
virtual QVariant | inputMethodQuery (Qt::InputMethodQuery query) const |
virtual QVariant | itemChange (GraphicsItemChange change, const QVariant &value) |
virtual void | keyPressEvent (QKeyEvent *event) |
virtual void | keyReleaseEvent (QKeyEvent *event) |
virtual void | mouseDoubleClickEvent (QGraphicsSceneMouseEvent *event) |
virtual void | mouseMoveEvent (QGraphicsSceneMouseEvent *event) |
virtual void | mousePressEvent (QGraphicsSceneMouseEvent *event) |
virtual void | mouseReleaseEvent (QGraphicsSceneMouseEvent *event) |
void | prepareGeometryChange () |
virtual bool | sceneEvent (QEvent *event) |
virtual bool | sceneEventFilter (QGraphicsItem *watched, QEvent *event) |
void | updateMicroFocus () |
virtual void | wheelEvent (QGraphicsSceneWheelEvent *event) |
Additional Inherited Members | |
Public Attributes inherited from QGraphicsItem | |
typedef | GraphicsItemFlags |
Protected Attributes inherited from QgsMapCanvasItem | |
QSizeF | mItemSize |
cached size of the item (to return in boundingRect()) More... | |
QgsMapCanvas * | mMapCanvas |
pointer to map canvas More... | |
QPoint | mPanningOffset |
offset from normal position due current panning operation, used when converting map coordinates to move map canvas items More... | |
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. More... | |
double | mRectRotation |
A class for drawing transient features (e.g.
The QgsRubberBand class provides a transparent overlay widget for tracking the mouse while drawing polylines or polygons.
digitising lines) on the map. It may be used
Definition at line 32 of file qgsrubberband.h.
Icons.
Definition at line 37 of file qgsrubberband.h.
QgsRubberBand::QgsRubberBand | ( | QgsMapCanvas * | mapCanvas, |
QGis::GeometryType | geometryType = QGis::Line |
||
) |
Creates a new RubberBand.
mapCanvas | The map canvas to draw onto. It's CRS will be used map points onto screen coordinates. |
geometryType | Defines how the data should be drawn onto the screen. (Use QGis::Line, QGis::Polygon or QGis::Point) |
Definition at line 30 of file qgsrubberband.cpp.
QgsRubberBand::QgsRubberBand | ( | QgsMapCanvas * | mapCanvas, |
bool | isPolygon | ||
) |
Creates a new RubberBand.
mapCanvas | The map canvas to draw onto. It's CRS will be used map points onto screen coordinates. |
isPolygon | true: draw as (multi-)polygon, false draw as (multi-)linestring |
Definition at line 47 of file qgsrubberband.cpp.
QgsRubberBand::~QgsRubberBand | ( | ) |
Definition at line 73 of file qgsrubberband.cpp.
void QgsRubberBand::addGeometry | ( | const QgsGeometry * | geom, |
QgsVectorLayer * | layer | ||
) |
Add the geometry of an existing feature to a rubberband This is useful for multi feature highlighting.
As of 2.0, this method does not change the GeometryType any more. You need to set the GeometryType of the rubberband explicitly by calling reset or setToGeometry with appropriate arguments. setToGeometry is also to be preferred for backwards-compatibility.
geom | the geometry object. Will be treated as a collection of vertices. |
layer | the layer containing the feature, used for coord transformation to map crs. In case of 0 pointer, the coordinates are not going to be transformed. |
Definition at line 294 of file qgsrubberband.cpp.
void QgsRubberBand::addPoint | ( | const QgsPoint & | p, |
bool | doUpdate = true , |
||
int | geometryIndex = 0 |
||
) |
Add a vertex to the rubberband and update canvas.
The rendering of the vertex depends on the current GeometryType and icon. If adding more points consider using update=false for better performance
p | The vertex/point to add |
doUpdate | Should the map canvas be updated immediately? |
geometryIndex | The index of the feature part (in case of multipart geometries) |
Add a point to the shape being created.
Definition at line 155 of file qgsrubberband.cpp.
QgsGeometry * QgsRubberBand::asGeometry | ( | ) |
Returns the rubberband as a Geometry.
Definition at line 645 of file qgsrubberband.cpp.
void QgsRubberBand::closePoints | ( | bool | doUpdate = true , |
int | geometryIndex = 0 |
||
) |
Ensures that a polygon geometry is closed and that the last vertex equals the first vertex.
doUpdate | set to true to update the map canvas immediately |
geometryIndex | index of the feature part (in case of multipart geometries) |
Definition at line 191 of file qgsrubberband.cpp.
const QgsPoint * QgsRubberBand::getPoint | ( | int | i, |
int | j = 0 |
||
) | const |
Return vertex.
i | The geometry index |
j | The vertex index within geometry i |
Definition at line 637 of file qgsrubberband.cpp.
void QgsRubberBand::movePoint | ( | const QgsPoint & | p, |
int | geometryIndex = 0 |
||
) |
Moves the rubber band point specified by index.
Note that if the rubber band is not used to track the last mouse position, the first point of the rubber band has two vertices
Update the line between the last added point and the mouse position.
Definition at line 246 of file qgsrubberband.cpp.
void QgsRubberBand::movePoint | ( | int | index, |
const QgsPoint & | p, | ||
int | geometryIndex = 0 |
||
) |
Moves the rubber band point specified by index.
Note that if the rubber band is not used to track the last mouse position, the first point of the rubber band has two vertices
Definition at line 264 of file qgsrubberband.cpp.
int QgsRubberBand::numberOfVertices | ( | ) | const |
Returns count of vertices in all lists of mPoint.
Definition at line 622 of file qgsrubberband.cpp.
|
overrideprotectedvirtual |
Draw the shape in response to an update event.
Implements QgsMapCanvasItem.
Definition at line 470 of file qgsrubberband.cpp.
int QgsRubberBand::partSize | ( | int | geometryIndex | ) | const |
Returns number of vertices in feature part.
geometryIndex | The index of the feature part (in case of multipart geometries) |
Definition at line 616 of file qgsrubberband.cpp.
void QgsRubberBand::removeLastPoint | ( | int | geometryIndex = 0 , |
bool | doUpdate = true |
||
) |
Removes the last point.
Most useful in connection with undo operations
Definition at line 238 of file qgsrubberband.cpp.
void QgsRubberBand::removePoint | ( | int | index = 0 , |
bool | doUpdate = true , |
||
int | geometryIndex = 0 |
||
) |
Remove a vertex from the rubberband and (optionally) update canvas.
index | The index of the vertex/point to remove, negative indexes start at end |
doUpdate | Should the map canvas be updated immediately? |
geometryIndex | The index of the feature part (in case of multipart geometries) |
Definition at line 212 of file qgsrubberband.cpp.
void QgsRubberBand::reset | ( | QGis::GeometryType | geometryType = QGis::Line | ) |
Clears all the geometries in this rubberband.
Sets the representation type according to geometryType.
geometryType | Defines how the data should be drawn onto the screen. (Use QGis::Line, QGis::Polygon or QGis::Point) |
Remove all points from the shape being created.
Definition at line 136 of file qgsrubberband.cpp.
void QgsRubberBand::reset | ( | bool | isPolygon | ) |
Sets the representation type according to isPolygon.
isPolygon | true: draw as (multi-)polygon, false draw as (multi-)linestring |
Definition at line 144 of file qgsrubberband.cpp.
void QgsRubberBand::setBorderColor | ( | const QColor & | color | ) |
Set the border color for the rubberband.
color | The color used to render this rubberband |
Set the outline
Definition at line 98 of file qgsrubberband.cpp.
void QgsRubberBand::setBrushStyle | ( | Qt::BrushStyle | brushStyle | ) |
Set the style of the brush.
Definition at line 128 of file qgsrubberband.cpp.
void QgsRubberBand::setColor | ( | const QColor & | color | ) |
Set the color for the rubberband.
color | The color used to render this rubberband |
Set the outline and fill color.
Definition at line 80 of file qgsrubberband.cpp.
void QgsRubberBand::setFillColor | ( | const QColor & | color | ) |
Set the fill color for the rubberband.
color | The color used to render this rubberband |
Set the fill color.
Definition at line 89 of file qgsrubberband.cpp.
void QgsRubberBand::setIcon | ( | IconType | icon | ) |
Set the icon type to highlight point geometries.
icon | The icon to visualize point geometries |
Definition at line 113 of file qgsrubberband.cpp.
void QgsRubberBand::setIconSize | ( | int | iconSize | ) |
Set the size of the point icons.
Definition at line 118 of file qgsrubberband.cpp.
void QgsRubberBand::setLineStyle | ( | Qt::PenStyle | penStyle | ) |
Set the style of the line.
Definition at line 123 of file qgsrubberband.cpp.
void QgsRubberBand::setToCanvasRectangle | ( | QRect | rect | ) |
Sets this rubber band to a map canvas rectangle.
rect | rectangle in canvas coordinates |
Definition at line 447 of file qgsrubberband.cpp.
void QgsRubberBand::setToGeometry | ( | const QgsGeometry * | geom, |
QgsVectorLayer * | layer | ||
) |
Sets this rubber band to the geometry of an existing feature.
This is useful for feature highlighting. In contrast to addGeometry, this method does also change the geometry type of the rubberband.
geom | the geometry object |
layer | the layer containing the feature, used for coord transformation to map crs. In case of 0 pointer, the coordinates are not going to be transformed. |
Definition at line 282 of file qgsrubberband.cpp.
void QgsRubberBand::setTranslationOffset | ( | double | dx, |
double | dy | ||
) |
Adds translation to original coordinates (all in map coordinates)
dx | x translation |
dy | y translation |
Definition at line 604 of file qgsrubberband.cpp.
void QgsRubberBand::setWidth | ( | int | width | ) |
Set the width of the line.
Outline width for polygon.
width | The width for any lines painted for this rubberband |
Set the outline width.
Definition at line 108 of file qgsrubberband.cpp.
int QgsRubberBand::size | ( | ) | const |
Returns number of geometries.
Definition at line 611 of file qgsrubberband.cpp.
|
overridevirtual |
called on changed extent or resize event to update position of the item
Reimplemented from QgsMapCanvasItem.
Definition at line 594 of file qgsrubberband.cpp.
|
protected |
recalculates needed rectangle
Definition at line 549 of file qgsrubberband.cpp.