15#ifndef QGSRUBBERBAND_H
16#define QGSRUBBERBAND_H
28#include <QSvgRenderer>
65 sipType = sipType_QgsRubberBand;
76 Q_PROPERTY( QColor fillColor READ fillColor WRITE setFillColor )
77 Q_PROPERTY( QColor strokeColor READ strokeColor WRITE setStrokeColor )
78 Q_PROPERTY(
int iconSize READ iconSize WRITE setIconSize )
79 Q_PROPERTY( QColor secondaryStrokeColor READ secondaryStrokeColor WRITE setSecondaryStrokeColor )
80 Q_PROPERTY(
int width READ width WRITE setWidth )
149 void setColor(
const QColor &color );
155 void setFillColor(
const QColor &color );
166 void setStrokeColor(
const QColor &color );
178 void setSecondaryStrokeColor(
const QColor &color );
189 void setWidth(
double width );
194 int width()
const {
return mPen.width(); }
200 void setIcon( IconType icon );
209 void setSvgIcon(
const QString &path, QPoint drawOffset );
220 void setIconSize(
double iconSize );
230 void setLineStyle( Qt::PenStyle penStyle );
235 void setBrushStyle( Qt::BrushStyle brushStyle );
253 void addPoint(
const QgsPointXY &p,
bool doUpdate =
true,
int geometryIndex = 0,
int ringIndex = 0 );
262 void closePoints(
bool doUpdate =
true,
int geometryIndex = 0,
int ringIndex = 0 );
271 void removePoint(
int index = 0,
bool doUpdate =
true,
int geometryIndex = 0,
int ringIndex = 0 );
276 void removeLastPoint(
int geometryIndex = 0,
bool doUpdate =
true,
int ringIndex = 0 );
282 void movePoint(
const QgsPointXY &p,
int geometryIndex = 0,
int ringIndex = 0 );
288 void movePoint(
int index,
const QgsPointXY &p,
int geometryIndex = 0,
int ringIndex = 0 );
295 int partSize(
int geometryIndex )
const;
322 void setToCanvasRectangle( QRect rect );
364 void setTranslationOffset(
double dx,
double dy );
376 int numberOfVertices()
const;
387 const QgsPointXY *getPoint(
int i,
int j = 0,
int ringIndex = 0 )
const;
395 void updatePosition()
override;
425 void paint( QPainter *p )
override;
432 void drawShape( QPainter *p,
const QVector<QPointF> &pts );
439 void drawShape( QPainter *p,
const QVector<QPolygonF> &rings );
450 double mIconSize = 5;
453 IconType mIconType = ICON_CIRCLE;
454 std::unique_ptr<QSvgRenderer> mSvgRenderer;
457 std::unique_ptr<QgsSymbol> mSymbol;
462 QVector<QVector<QVector<QgsPointXY>>> mPoints;
464 double mTranslationOffsetX = 0.0;
465 double mTranslationOffsetY = 0.0;
GeometryType
The geometry types are used to group Qgis::WkbType in a coarse way.
This class represents a coordinate reference system (CRS).
A geometry is the spatial representation of a feature.
An abstract class for items that can be placed on the map canvas.
Map canvas is a class for displaying all GIS data types on a canvas.
Base class for all map layer types.
A class to represent a 2D point.
A class for drawing transient features (e.g.
~QgsRubberBand() override
double iconSize() const
Returns the current icon size of the point icons.
QColor fillColor() const
Returns the current fill color.
IconType icon() const
Returns the current icon type to highlight point geometries.
@ ICON_X
A cross is used to highlight points (x)
@ ICON_FULL_DIAMOND
A diamond is used to highlight points (◆)
@ ICON_FULL_BOX
A full box is used to highlight points (■)
@ ICON_NONE
No icon is used.
@ ICON_CROSS
A cross is used to highlight points (+)
@ ICON_CIRCLE
A circle is used to highlight points (○)
@ ICON_DIAMOND
A diamond is used to highlight points (◇)
@ ICON_BOX
A box is used to highlight points (□)
QColor secondaryStrokeColor() const
Returns the current secondary stroke color.
int width() const
Returns the current width of the line or stroke width for polygon.
QColor strokeColor() const
Returns the current stroke color.
Abstract base class for all rendered symbols.
Represents a vector layer which manages a vector based data sets.
#define SIP_CONVERT_TO_SUBCLASS_CODE(code)
const QgsCoordinateReferenceSystem & crs