QGIS API Documentation
3.14.0-Pi (9f7028fd23)
|
Go to the documentation of this file.
15 #ifndef QGSRUBBERBAND_H
16 #define QGSRUBBERBAND_H
27 #include <QSvgRenderer>
60 sipType = sipType_QgsRubberBand;
67 Q_PROPERTY( QColor fillColor READ fillColor WRITE setFillColor )
68 Q_PROPERTY( QColor strokeColor READ strokeColor WRITE setStrokeColor )
70 Q_PROPERTY( QColor secondaryStrokeColor READ secondaryStrokeColor WRITE setSecondaryStrokeColor )
71 Q_PROPERTY(
int width READ width WRITE setWidth )
141 void setColor(
const QColor &color );
148 void setFillColor(
const QColor &color );
160 void setStrokeColor(
const QColor &color );
173 void setSecondaryStrokeColor(
const QColor &color );
184 void setWidth(
int width );
189 int width()
const {
return mPen.width(); }
195 void setIcon( IconType icon );
204 void setSvgIcon(
const QString &path, QPoint drawOffset );
225 void setLineStyle( Qt::PenStyle penStyle );
230 void setBrushStyle( Qt::BrushStyle brushStyle );
248 void addPoint(
const QgsPointXY &p,
bool doUpdate =
true,
int geometryIndex = 0,
int ringIndex = 0 );
258 void closePoints(
bool doUpdate =
true,
int geometryIndex = 0,
int ringIndex = 0 );
267 void removePoint(
int index = 0,
bool doUpdate =
true,
int geometryIndex = 0,
int ringIndex = 0 );
272 void removeLastPoint(
int geometryIndex = 0,
bool doUpdate =
true,
int ringIndex = 0 );
278 void movePoint(
const QgsPointXY &p,
int geometryIndex = 0,
int ringIndex = 0 );
284 void movePoint(
int index,
const QgsPointXY &p,
int geometryIndex = 0,
int ringIndex = 0 );
291 int partSize(
int geometryIndex )
const;
318 void setToCanvasRectangle( QRect rect );
348 void setTranslationOffset(
double dx,
double dy );
360 int numberOfVertices()
const;
371 const QgsPointXY *getPoint(
int i,
int j = 0,
int ringIndex = 0 )
const;
387 void paint( QPainter *p )
override;
394 void drawShape( QPainter *p,
const QVector<QPointF> &pts );
401 void drawShape( QPainter *p,
const QVector<QPolygonF> &rings );
415 IconType mIconType = ICON_CIRCLE;
416 std::unique_ptr<QSvgRenderer> mSvgRenderer;
422 QVector< QVector< QVector <QgsPointXY> > > mPoints;
424 double mTranslationOffsetX = 0.0;
425 double mTranslationOffsetY = 0.0;
int width() const
Returns the current width of the line or stroke width for polygon.
int iconSize() const
Returns the current icon size of the point icons.
@ ICON_CIRCLE
A circle is used to highlight points (○)
const QgsCoordinateReferenceSystem & crs
@ ICON_BOX
A box is used to highlight points (□)
@ ICON_NONE
No icon is used.
QSize iconSize(bool dockableToolbar)
Returns the user-preferred size of a window's toolbar icons.
@ ICON_FULL_DIAMOND
A diamond is used to highlight points (◆)
virtual void updatePosition()
called on changed extent or resize event to update position of the item
#define SIP_CONVERT_TO_SUBCLASS_CODE(code)
virtual void paint(QPainter *painter)=0
function to be implemented by derived classes
QColor fillColor() const
Returns the current fill color.
@ ICON_X
A cross is used to highlight points (x)
@ ICON_FULL_BOX
A full box is used to highlight points (■)
GeometryType
The geometry types are used to group QgsWkbTypes::Type in a coarse way.
@ ICON_CROSS
A cross is used to highlight points (+)
IconType icon() const
Returns the current icon type to highlight point geometries.
QColor secondaryStrokeColor() const
Returns the current secondary stroke color.
@ ICON_DIAMOND
A diamond is used to highlight points (◇)
QColor strokeColor() const
Returns the current stroke color.