QGIS API Documentation
3.26.3-Buenos Aires (65e4edfdad)
|
Go to the documentation of this file.
15 #ifndef QGSRUBBERBAND_H
16 #define QGSRUBBERBAND_H
28 #include <QSvgRenderer>
63 sipType = sipType_QgsRubberBand;
75 Q_PROPERTY( QColor fillColor READ fillColor WRITE setFillColor )
76 Q_PROPERTY( QColor strokeColor READ strokeColor WRITE setStrokeColor )
78 Q_PROPERTY( QColor secondaryStrokeColor READ secondaryStrokeColor WRITE setSecondaryStrokeColor )
79 Q_PROPERTY(
int width READ width WRITE setWidth )
150 void setColor(
const QColor &color );
157 void setFillColor(
const QColor &color );
169 void setStrokeColor(
const QColor &color );
182 void setSecondaryStrokeColor(
const QColor &color );
193 void setWidth(
int width );
198 int width()
const {
return mPen.width(); }
204 void setIcon( IconType icon );
213 void setSvgIcon(
const QString &path, QPoint drawOffset );
234 void setLineStyle( Qt::PenStyle penStyle );
239 void setBrushStyle( Qt::BrushStyle brushStyle );
257 void addPoint(
const QgsPointXY &p,
bool doUpdate =
true,
int geometryIndex = 0,
int ringIndex = 0 );
267 void closePoints(
bool doUpdate =
true,
int geometryIndex = 0,
int ringIndex = 0 );
276 void removePoint(
int index = 0,
bool doUpdate =
true,
int geometryIndex = 0,
int ringIndex = 0 );
281 void removeLastPoint(
int geometryIndex = 0,
bool doUpdate =
true,
int ringIndex = 0 );
287 void movePoint(
const QgsPointXY &p,
int geometryIndex = 0,
int ringIndex = 0 );
293 void movePoint(
int index,
const QgsPointXY &p,
int geometryIndex = 0,
int ringIndex = 0 );
300 int partSize(
int geometryIndex )
const;
327 void setToCanvasRectangle( QRect rect );
370 void setTranslationOffset(
double dx,
double dy );
382 int numberOfVertices()
const;
393 const QgsPointXY *getPoint(
int i,
int j = 0,
int ringIndex = 0 )
const;
432 void paint( QPainter *p )
override;
439 void drawShape( QPainter *p,
const QVector<QPointF> &pts );
446 void drawShape( QPainter *p,
const QVector<QPolygonF> &rings );
460 IconType mIconType = ICON_CIRCLE;
461 std::unique_ptr<QSvgRenderer> mSvgRenderer;
464 std::unique_ptr< QgsSymbol > mSymbol;
469 QVector< QVector< QVector <QgsPointXY> > > mPoints;
471 double mTranslationOffsetX = 0.0;
472 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 (○)
A class for drawing transient features (e.g. digitizing lines) on the map.
const QgsCoordinateReferenceSystem & crs
Map canvas is a class for displaying all GIS data types on a canvas.
@ ICON_BOX
A box is used to highlight points (□)
Abstract base class for all rendered symbols.
@ 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
An abstract class for items that can be placed on the map canvas.
QColor fillColor() const
Returns the current fill color.
@ ICON_X
A cross is used to highlight points (x)
This class represents a coordinate reference system (CRS).
@ ICON_FULL_BOX
A full box is used to highlight points (■)
A class to represent a 2D point.
GeometryType
The geometry types are used to group QgsWkbTypes::Type in a coarse way.
A geometry is the spatial representation of a feature.
@ ICON_CROSS
A cross is used to highlight points (+)
Represents a vector layer which manages a vector based data sets.
Base class for all map layer types. This is the base class for all map layer types (vector,...
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.