15#ifndef QGSELLIPSESYMBOLLAYER_H
16#define QGSELLIPSESYMBOLLAYER_H
18#define DEFAULT_ELLIPSE_JOINSTYLE Qt::MiterJoin
24#include <QPainterPath>
58 static QList< QgsEllipseSymbolLayer::Shape > availableShapes();
76 Qgis::SymbolLayerFlags
flags() const override;
81 Q_DECL_DEPRECATED
void toSld( QDomDocument &doc, QDomElement &element, const QVariantMap &props = QVariantMap() ) const override
SIP_DEPRECATED;
83 Q_DECL_DEPRECATED
void writeSldMarker( QDomDocument &doc, QDomElement &element, const QVariantMap &props ) const override
SIP_DEPRECATED;
139 void setSize(
double size )
override;
141 void setSymbolWidth(
double w );
144 void setSymbolHeight(
double h );
251 Shape mShape = Circle;
252 double mSymbolWidth = 4;
255 double mSymbolHeight = 3;
259 Qt::PenStyle mStrokeStyle = Qt::SolidLine;
261 Qt::PenCapStyle mPenCapStyle = Qt::SquareCap;
262 double mStrokeWidth = 0;
266 QPainterPath mPainterPath;
284 QSizeF calculateSize(
QgsSymbolRenderContext &context,
double *scaledWidth =
nullptr,
double *scaledHeight =
nullptr );
285 void calculateOffsetAndRotation(
QgsSymbolRenderContext &context,
double scaledWidth,
double scaledHeight,
bool &hasDataDefinedRotation, QPointF &offset,
double &angle )
const;
Provides global constants and enumerations for use throughout the application.
RenderUnit
Rendering size units.
@ Millimeters
Millimeters.
Exports QGIS layers to the DXF format.
A symbol layer for rendering objects with major and minor axis (e.g.
void setPenCapStyle(Qt::PenCapStyle style)
Sets the marker's stroke cap style (e.g., flat, round, etc).
bool writeDxf(QgsDxfExport &e, double mmMapUnitScaleFactor, const QString &layerName, QgsSymbolRenderContext &context, QPointF shift=QPointF(0.0, 0.0)) const override
write as DXF
void setStrokeWidth(double w)
void setSymbolHeightMapUnitScale(const QgsMapUnitScale &scale)
void setSymbolWidthMapUnitScale(const QgsMapUnitScale &scale)
Qgis::RenderUnit symbolWidthUnit() const
Returns the units for the symbol's width.
const QgsMapUnitScale & strokeWidthMapUnitScale() const
QVariantMap properties() const override
Should be reimplemented by subclasses to return a string map that contains the configuration informat...
Qgis::RenderUnit strokeWidthUnit() const
Returns the units for the symbol's stroke width.
void renderPoint(QPointF point, QgsSymbolRenderContext &context) override
Renders a marker at the specified point.
double strokeWidth() const
void setStrokeColor(const QColor &c) override
Sets the stroke color for the symbol layer.
void setStrokeStyle(Qt::PenStyle strokeStyle)
static QgsEllipseSymbolLayer::Shape decodeShape(const QString &name, bool *ok=nullptr)
Attempts to decode a string representation of a shape name to the corresponding shape.
void setStrokeWidthUnit(Qgis::RenderUnit unit)
Sets the units for the symbol's stroke width.
Shape
Marker symbol shapes.
@ ThirdCircle
Third Circle.
@ Cross
Stroke-only cross.
@ QuarterCircle
Quarter Circle.
@ HalfArc
Stroke-only half arc.
@ Arrow
Stroke-only arrow.
@ RightHalfTriangle
Right half of a triangle.
@ LeftHalfTriangle
Left half of a triangle.
QColor fillColor() const override
Returns the fill color for the symbol layer.
QgsEllipseSymbolLayer::Shape shape() const
Returns the shape for the rendered ellipse marker symbol.
void setFillColor(const QColor &c) override
Sets the fill color for the symbol layer.
void setShape(QgsEllipseSymbolLayer::Shape shape)
Sets the rendered ellipse marker shape.
const QgsMapUnitScale & symbolHeightMapUnitScale() const
Qt::PenStyle strokeStyle() const
static QgsSymbolLayer * create(const QVariantMap &properties=QVariantMap())
Creates the symbol layer.
static QgsSymbolLayer * createFromSld(QDomElement &element)
Qgis::SymbolLayerFlags flags() const override
Returns flags which control the symbol layer's behavior.
const QgsMapUnitScale & symbolWidthMapUnitScale() const
Q_DECL_DEPRECATED void toSld(QDomDocument &doc, QDomElement &element, const QVariantMap &props=QVariantMap()) const override
Saves the symbol layer as SLD.
Q_DECL_DEPRECATED QString symbolName() const
Returns the shape name for the rendered ellipse marker symbol.
Q_DECL_DEPRECATED void setSymbolName(const QString &name)
Sets the rendered ellipse marker shape using a symbol name.
static QString encodeShape(QgsEllipseSymbolLayer::Shape shape)
Encodes a shape to its string representation.
double symbolWidth() const
void setStrokeWidthMapUnitScale(const QgsMapUnitScale &scale)
void setSymbolHeightUnit(Qgis::RenderUnit unit)
Sets the units for the symbol's height.
void stopRender(QgsSymbolRenderContext &context) override
Called after a set of rendering operations has finished on the supplied render context.
QString layerType() const override
Returns a string that represents this layer type.
QColor strokeColor() const override
Returns the stroke color for the symbol layer.
void setPenJoinStyle(Qt::PenJoinStyle style)
Set stroke join style.
void setSymbolWidthUnit(Qgis::RenderUnit unit)
Sets the units for the symbol's width.
void startRender(QgsSymbolRenderContext &context) override
Called before a set of rendering operations commences on the supplied render context.
Qgis::RenderUnit symbolHeightUnit() const
Returns the units for the symbol's height.
Qt::PenJoinStyle penJoinStyle() const
Gets stroke join style.
~QgsEllipseSymbolLayer() override
Qt::PenCapStyle penCapStyle() const
Returns the marker's stroke cap style (e.g., flat, round, etc).
double symbolHeight() const
Q_DECL_DEPRECATED void writeSldMarker(QDomDocument &doc, QDomElement &element, const QVariantMap &props) const override
Writes the symbol layer definition as a SLD XML element.
QgsEllipseSymbolLayer * clone() const override
Shall be reimplemented by subclasses to create a deep copy of the instance.
Handles parsing and evaluation of expressions (formerly called "search strings").
The feature class encapsulates a single feature including its unique ID, geometry and a list of field...
Struct for storing maximum and minimum scales for measurements in map units.
virtual void setSize(double size)
Sets the symbol size.
QgsMarkerSymbolLayer(const QgsMarkerSymbolLayer &other)
virtual QRectF bounds(QPointF point, QgsSymbolRenderContext &context)=0
Returns the approximate bounding box of the marker symbol layer, taking into account any data defined...
Qgis::RenderUnit outputUnit() const override
Returns the units to use for sizes and widths within the symbol layer.
QgsMapUnitScale mapUnitScale() const override
void setOutputUnit(Qgis::RenderUnit unit) override
Sets the units to use for sizes and widths within the symbol layer.
void setMapUnitScale(const QgsMapUnitScale &scale) override
Holds SLD export options and other information related to SLD export of a QGIS layer style.
virtual void setColor(const QColor &color)
Sets the "representative" color for the symbol layer.
virtual QColor color() const
Returns the "representative" color of the symbol layer.
virtual bool usesMapUnits() const
Returns true if the symbol layer has any components which use map unit based sizes.
QgsSymbolLayer(const QgsSymbolLayer &other)
Encapsulates the context in which a symbol is being rendered.
As part of the API refactoring and improvements which landed in the Processing API was substantially reworked from the x version This was done in order to allow much of the underlying Processing framework to be ported into c
#define DEFAULT_ELLIPSE_JOINSTYLE