28#include <QPainterPath>
75 sipType = sipType_QgsHighlight;
113 QColor
color()
const {
return mColor; }
119 void setColor(
const QColor &color );
132 void setFillColor(
const QColor &fillColor );
138 int width()
const {
return mWidth; }
145 void setWidth(
int width );
154 double buffer()
const {
return mBuffer; }
173 void updatePosition()
override;
180 void applyDefaultStyle();
183 void paint( QPainter *p )
override;
189 void updateTransformedGeometry();
199 void setSymbol( QgsSymbol *symbol,
const QgsRenderContext &context,
const QColor &color,
const QColor &fillColor );
200 double getSymbolWidth(
const QgsRenderContext &context,
double width,
Qgis::RenderUnit unit );
202 std::unique_ptr<QgsFeatureRenderer> createRenderer( QgsRenderContext &context,
const QColor &color,
const QColor &fillColor );
203 void paintPoint( QgsRenderContext &context,
const QgsPoint *point,
double size,
Qgis::RenderUnit sizeUnit, PointSymbol symbol );
205 void paintPolygon( QPainter *p,
const QgsPolygonXY &polygon );
206 QgsRenderContext createRenderContext();
213 QgsGeometry mOriginalGeometry;
214 QgsGeometry mGeometry;
215 QPointer<QgsMapLayer> mLayer;
218 double mMinWidth = 0;
219 QgsRenderContext mRenderContext;
224 double mPointSizeRadiusMM = 1.5;
225 PointSymbol mPointSymbol = PointSymbol::Square;
RenderUnit
Rendering size units.
Abstract base class for all 2D vector feature renderers.
The feature class encapsulates a single feature including its unique ID, geometry and a list of field...
A geometry is the spatial representation of a feature.
friend class QgsMapToolAddFeature
QgsMapLayer * layer() const
Returns the layer for which this highlight has been created.
double buffer() const
Returns the line/stroke buffer size (in millimeters).
QgsHighlight(QgsMapCanvas *mapCanvas, const QgsGeometry &geom, QgsMapLayer *layer)
Constructor for QgsHighlight.
void setBuffer(double buffer)
Sets the line/stroke buffer size (in millimeters).
friend class QgsUpdateGpsDetailsAction
int width() const
Returns the stroke width.
QColor fillColor() const
Returns the fill color.
void setMinWidth(double width)
Sets the minimum line/stroke width (in millimeters).
void setFillColor(const QColor &fillColor)
Fill color for the highlight.
void setWidth(int width)
Set stroke width.
void setColor(const QColor &color)
Set line/stroke to color, polygon fill to color with alpha = 63.
QgsMapCanvasItem(QgsMapCanvas *mapCanvas)
protected constructor: cannot be constructed directly
Map canvas is a class for displaying all GIS data types on a canvas.
Base class for all map layer types.
Abstract base class for all rendered symbols.
Represents a vector layer which manages a vector based dataset.
#define SIP_CONVERT_TO_SUBCLASS_CODE(code)
QVector< QgsPolylineXY > QgsPolygonXY
Polygon: first item of the list is outer ring, inner rings (if any) start from second item.
QVector< QgsPointXY > QgsPolylineXY
Polyline as represented as a vector of two-dimensional points.