QGIS API Documentation
3.8.0-Zanzibar (11aff65)
|
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... | |
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... | |
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 | |
void | paint (QPainter *painter) override |
function to be implemented by derived classes 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 35 of file qgsgeometryrubberband.h.
Definition at line 38 of file qgsgeometryrubberband.h.
QgsGeometryRubberBand::QgsGeometryRubberBand | ( | QgsMapCanvas * | mapCanvas, |
QgsWkbTypes::GeometryType | geomType = QgsWkbTypes::LineGeometry |
||
) |
Definition at line 24 of file qgsgeometryrubberband.cpp.
|
override |
Definition at line 31 of file qgsgeometryrubberband.cpp.
|
inline |
Returns a pointer to the geometry.
Definition at line 78 of file qgsgeometryrubberband.h.
void QgsGeometryRubberBand::moveVertex | ( | QgsVertexId | id, |
const QgsPoint & | newPos | ||
) |
Moves vertex to new position (in map coordinates)
Definition at line 121 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 150 of file qgsgeometryrubberband.cpp.
void QgsGeometryRubberBand::setFillColor | ( | const QColor & | c | ) |
Sets fill color for vertex markers.
Definition at line 130 of file qgsgeometryrubberband.cpp.
void QgsGeometryRubberBand::setGeometry | ( | QgsAbstractGeometry * | geom | ) |
Sets geometry (takes ownership). Geometry is expected to be in map coordinates.
Definition at line 110 of file qgsgeometryrubberband.cpp.
|
inline |
Sets vertex marker icon type.
Definition at line 92 of file qgsgeometryrubberband.h.
void QgsGeometryRubberBand::setLineStyle | ( | Qt::PenStyle | penStyle | ) |
Sets pen style.
Definition at line 145 of file qgsgeometryrubberband.cpp.
void QgsGeometryRubberBand::setStrokeColor | ( | const QColor & | c | ) |
Sets stroke color for vertex markers.
Definition at line 135 of file qgsgeometryrubberband.cpp.
void QgsGeometryRubberBand::setStrokeWidth | ( | int | width | ) |
Sets stroke width.
Definition at line 140 of file qgsgeometryrubberband.cpp.