| QGIS API Documentation
    3.22.4-Białowieża (ce8e65e95e)
    | 
A rubberband class for QgsAbstractGeometry (considering curved geometries). More...
#include <qgsgeometryrubberband.h>

| Public Types | |
| enum | IconType { ICON_NONE , ICON_CROSS , ICON_X , ICON_BOX , ICON_CIRCLE , ICON_FULL_BOX } | 
| Public Member Functions | |
| QgsGeometryRubberBand (QgsMapCanvas *mapCanvas, QgsWkbTypes::GeometryType geomType=QgsWkbTypes::LineGeometry) | |
| ~QgsGeometryRubberBand () override | |
| const QgsAbstractGeometry * | geometry () | 
| Returns a pointer to the geometry.  More... | |
| void | moveVertex (QgsVertexId id, const QgsPoint &newPos) | 
| Moves vertex to new position (in map coordinates)  More... | |
| void | setBrushStyle (Qt::BrushStyle brushStyle) | 
| Sets brush style.  More... | |
| void | setFillColor (const QColor &c) | 
| Sets fill color for vertex markers.  More... | |
| virtual void | setGeometry (QgsAbstractGeometry *geom) | 
| Sets geometry (takes ownership). Geometry is expected to be in map coordinates.  More... | |
| void | setIconType (IconType iconType) | 
| Sets vertex marker icon type.  More... | |
| void | setLineStyle (Qt::PenStyle penStyle) | 
| Sets pen style.  More... | |
| void | setStrokeColor (const QColor &c) | 
| Sets stroke color for vertex markers.  More... | |
| void | setStrokeWidth (int width) | 
| Sets stroke width.  More... | |
| void | setVertexDrawingEnabled (bool isVerticesDrawn) | 
| Sets whether the vertices are drawn.  More... | |
|  Public Member Functions inherited from QgsMapCanvasItem | |
| QRectF | boundingRect () const override | 
| QgsRectangle | rect () const | 
| returns canvas item rectangle in map units  More... | |
| void | setRect (const QgsRectangle &r, bool resetRotation=true) | 
| sets canvas item rectangle in map units  More... | |
| QPointF | toCanvasCoordinates (const QgsPointXY &point) const | 
| transformation from map coordinates to screen coordinates  More... | |
| QgsPointXY | toMapCoordinates (QPoint point) const | 
| transformation from screen coordinates to map coordinates  More... | |
| virtual void | updatePosition () | 
| called on changed extent or resize event to update position of the item  More... | |
| Protected Member Functions | |
| QgsWkbTypes::GeometryType | geometryType () const | 
| Returns which geometry is handled by the rubber band, polygon or line.  More... | |
| void | paint (QPainter *painter) override | 
| function to be implemented by derived classes  More... | |
| void | setGeometryType (const QgsWkbTypes::GeometryType &geometryType) | 
| Sets which geometry is handled by the rubber band, polygon or line.  More... | |
|  Protected Member Functions inherited from QgsMapCanvasItem | |
| QgsMapCanvasItem (QgsMapCanvas *mapCanvas) | |
| protected constructor: cannot be constructed directly  More... | |
| ~QgsMapCanvasItem () override | |
| void | paint (QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget=nullptr) override | 
| bool | setRenderContextVariables (QPainter *p, QgsRenderContext &context) const | 
| Sets render context parameters.  More... | |
| void | updateCanvas () | 
| schedules map canvas for repaint  More... | |
| Additional Inherited Members | |
|  Protected Attributes inherited from QgsMapCanvasItem | |
| QSizeF | mItemSize | 
| cached size of the item (to return in boundingRect())  More... | |
| QgsMapCanvas * | mMapCanvas = nullptr | 
| pointer to map canvas  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 rubberband class for QgsAbstractGeometry (considering curved geometries).
Definition at line 48 of file qgsgeometryrubberband.h.
Definition at line 61 of file qgsgeometryrubberband.h.
| QgsGeometryRubberBand::QgsGeometryRubberBand | ( | QgsMapCanvas * | mapCanvas, | 
| QgsWkbTypes::GeometryType | geomType = QgsWkbTypes::LineGeometry | ||
| ) | 
Definition at line 25 of file qgsgeometryrubberband.cpp.
| 
 | override | 
Definition at line 32 of file qgsgeometryrubberband.cpp.
| 
 | inline | 
Returns a pointer to the geometry.
Definition at line 101 of file qgsgeometryrubberband.h.
| 
 | protected | 
Returns which geometry is handled by the rubber band, polygon or line.
Definition at line 74 of file qgsgeometryrubberband.cpp.
| void QgsGeometryRubberBand::moveVertex | ( | QgsVertexId | id, | 
| const QgsPoint & | newPos | ||
| ) | 
Moves vertex to new position (in map coordinates)
Definition at line 130 of file qgsgeometryrubberband.cpp.
| 
 | overrideprotectedvirtual | 
function to be implemented by derived classes
Implements QgsMapCanvasItem.
Definition at line 36 of file qgsgeometryrubberband.cpp.
| void QgsGeometryRubberBand::setBrushStyle | ( | Qt::BrushStyle | brushStyle | ) | 
Sets brush style.
Definition at line 159 of file qgsgeometryrubberband.cpp.
| void QgsGeometryRubberBand::setFillColor | ( | const QColor & | c | ) | 
Sets fill color for vertex markers.
Definition at line 139 of file qgsgeometryrubberband.cpp.
| 
 | virtual | 
Sets geometry (takes ownership). Geometry is expected to be in map coordinates.
Definition at line 120 of file qgsgeometryrubberband.cpp.
| 
 | protected | 
Sets which geometry is handled by the rubber band, polygon or line.
Definition at line 79 of file qgsgeometryrubberband.cpp.
| 
 | inline | 
Sets vertex marker icon type.
Definition at line 115 of file qgsgeometryrubberband.h.
| void QgsGeometryRubberBand::setLineStyle | ( | Qt::PenStyle | penStyle | ) | 
Sets pen style.
Definition at line 154 of file qgsgeometryrubberband.cpp.
| void QgsGeometryRubberBand::setStrokeColor | ( | const QColor & | c | ) | 
Sets stroke color for vertex markers.
Definition at line 144 of file qgsgeometryrubberband.cpp.
| void QgsGeometryRubberBand::setStrokeWidth | ( | int | width | ) | 
Sets stroke width.
Definition at line 149 of file qgsgeometryrubberband.cpp.
| void QgsGeometryRubberBand::setVertexDrawingEnabled | ( | bool | isVerticesDrawn | ) | 
Sets whether the vertices are drawn.
Definition at line 164 of file qgsgeometryrubberband.cpp.