28 #include <QDomDocument> 29 #include <QDomElement> 32 : mSymbolName( QStringLiteral(
"circle" ) )
33 , mStrokeColor( QColor( 35, 35, 35 ) )
36 mPen.setColor( mStrokeColor );
37 mPen.setStyle( mStrokeStyle );
38 mPen.setJoinStyle( mPenJoinStyle );
41 mBrush.setStyle( Qt::SolidPattern );
49 if ( properties.contains( QStringLiteral(
"symbol_name" ) ) )
51 layer->
setSymbolName( properties[ QStringLiteral(
"symbol_name" )] );
53 if ( properties.contains( QStringLiteral(
"symbol_width" ) ) )
55 layer->
setSymbolWidth( properties[QStringLiteral(
"symbol_width" )].toDouble() );
57 if ( properties.contains( QStringLiteral(
"symbol_width_unit" ) ) )
61 if ( properties.contains( QStringLiteral(
"symbol_width_map_unit_scale" ) ) )
65 if ( properties.contains( QStringLiteral(
"symbol_height" ) ) )
67 layer->
setSymbolHeight( properties[QStringLiteral(
"symbol_height" )].toDouble() );
69 if ( properties.contains( QStringLiteral(
"symbol_height_unit" ) ) )
73 if ( properties.contains( QStringLiteral(
"symbol_height_map_unit_scale" ) ) )
77 if ( properties.contains( QStringLiteral(
"angle" ) ) )
79 layer->
setAngle( properties[QStringLiteral(
"angle" )].toDouble() );
81 if ( properties.contains( QStringLiteral(
"outline_style" ) ) )
85 else if ( properties.contains( QStringLiteral(
"line_style" ) ) )
89 if ( properties.contains( QStringLiteral(
"joinstyle" ) ) )
93 if ( properties.contains( QStringLiteral(
"outline_width" ) ) )
95 layer->
setStrokeWidth( properties[QStringLiteral(
"outline_width" )].toDouble() );
97 else if ( properties.contains( QStringLiteral(
"line_width" ) ) )
99 layer->
setStrokeWidth( properties[QStringLiteral(
"line_width" )].toDouble() );
101 if ( properties.contains( QStringLiteral(
"outline_width_unit" ) ) )
105 else if ( properties.contains( QStringLiteral(
"line_width_unit" ) ) )
109 if ( properties.contains( QStringLiteral(
"outline_width_map_unit_scale" ) ) )
113 if ( properties.contains( QStringLiteral(
"fill_color" ) ) )
118 else if ( properties.contains( QStringLiteral(
"color" ) ) )
122 if ( properties.contains( QStringLiteral(
"outline_color" ) ) )
126 else if ( properties.contains( QStringLiteral(
"line_color" ) ) )
130 if ( properties.contains( QStringLiteral(
"size" ) ) )
132 layer->
setSize( properties[QStringLiteral(
"size" )].toDouble() );
134 if ( properties.contains( QStringLiteral(
"size_unit" ) ) )
138 if ( properties.contains( QStringLiteral(
"size_map_unit_scale" ) ) )
142 if ( properties.contains( QStringLiteral(
"offset" ) ) )
146 if ( properties.contains( QStringLiteral(
"offset_unit" ) ) )
150 if ( properties.contains( QStringLiteral(
"offset_map_unit_scale" ) ) )
154 if ( properties.contains( QStringLiteral(
"horizontal_anchor_point" ) ) )
158 if ( properties.contains( QStringLiteral(
"vertical_anchor_point" ) ) )
171 double scaledWidth = mSymbolWidth;
172 double scaledHeight = mSymbolHeight;
179 if ( exprVal.isValid() )
181 double width = exprVal.toDouble( &ok );
185 mPen.setWidthF( width );
191 if ( exprVal.isValid() )
198 if ( exprVal.isValid() )
214 if ( exprVal.isValid() )
216 symbolName = exprVal.toString();
218 preparePath( symbolName, context, &scaledWidth, &scaledHeight, context.
feature() );
223 bool hasDataDefinedRotation =
false;
226 calculateOffsetAndRotation( context, scaledWidth, scaledHeight, hasDataDefinedRotation, offset, angle );
235 transform.translate( point.x() + offset.x(), point.y() + offset.y() );
238 transform.rotate( angle );
242 p->setBrush( mBrush );
243 p->drawPath( transform.map( mPainterPath ) );
250 bool &hasDataDefinedRotation,
252 double &
angle )
const 256 markerOffset( context, scaledWidth, scaledHeight, mSymbolWidthUnit, mSymbolHeightUnit, offsetX, offsetY, mSymbolWidthMapUnitScale, mSymbolHeightMapUnitScale );
257 offset = QPointF( offsetX, offsetY );
262 bool usingDataDefinedRotation =
false;
267 usingDataDefinedRotation = ok;
271 if ( hasDataDefinedRotation )
296 return QStringLiteral(
"EllipseMarker" );
304 preparePath( mSymbolName, context );
306 mPen.setColor( mStrokeColor );
307 mPen.setStyle( mStrokeStyle );
308 mPen.setJoinStyle( mPenJoinStyle );
310 mBrush.setColor(
mColor );
349 QDomElement symbolizerElem = doc.createElement( QStringLiteral(
"se:PointSymbolizer" ) );
350 if ( !props.value( QStringLiteral(
"uom" ), QString() ).isEmpty() )
351 symbolizerElem.setAttribute( QStringLiteral(
"uom" ), props.value( QStringLiteral(
"uom" ), QString() ) );
352 element.appendChild( symbolizerElem );
363 QDomElement graphicElem = doc.createElement( QStringLiteral(
"se:Graphic" ) );
364 element.appendChild( graphicElem );
373 QString angleFunc = props.
value( QStringLiteral(
"angle" ), QString() );
374 if ( angleFunc.isEmpty() )
376 if ( ddRotation && ddRotation.
isActive() )
381 angleFunc = QString::number(
mAngle );
383 else if ( ddRotation && ddRotation.
isActive() )
387 angleFunc = QStringLiteral(
"%1 + %2" ).arg( angleFunc, ddRotation.
asExpression() );
393 double angle = angleFunc.toDouble( &ok );
397 angleFunc = QStringLiteral(
"%1 + %2" ).arg( angleFunc ).arg(
mAngle );
402 angleFunc = QString::number( angle +
mAngle );
412 double widthHeightFactor = mSymbolWidth / mSymbolHeight;
414 graphicElem.appendChild( factorElem );
421 QDomElement graphicElem = element.firstChildElement( QStringLiteral(
"Graphic" ) );
422 if ( graphicElem.isNull() )
425 QString name = QStringLiteral(
"circle" );
428 double widthHeightFactor = 1.0;
432 for ( QgsStringMap::iterator it = vendorOptions.begin(); it != vendorOptions.end(); ++it )
434 if ( it.key() == QLatin1String(
"widthHeightFactor" ) )
437 double v = it.value().toDouble( &ok );
439 widthHeightFactor = v;
446 QString uom = element.attribute( QStringLiteral(
"uom" ) );
455 double d = angleFunc.toDouble( &ok );
476 map[QStringLiteral(
"symbol_name" )] = mSymbolName;
477 map[QStringLiteral(
"symbol_width" )] = QString::number( mSymbolWidth );
480 map[QStringLiteral(
"symbol_height" )] = QString::number( mSymbolHeight );
483 map[QStringLiteral(
"angle" )] = QString::number(
mAngle );
485 map[QStringLiteral(
"outline_width" )] = QString::number( mStrokeWidth );
494 map[QStringLiteral(
"size" )] = QString::number(
mSize );
502 QSizeF QgsEllipseSymbolLayer::calculateSize(
QgsSymbolRenderContext &context,
double *scaledWidth,
double *scaledHeight )
513 width = mSymbolWidth;
517 *scaledWidth = width;
529 height = mSymbolHeight;
533 *scaledHeight = height;
536 return QSizeF( width, height );
541 mPainterPath = QPainterPath();
543 QSizeF
size = calculateSize( context, scaledWidth, scaledHeight );
545 if (
symbolName == QLatin1String(
"circle" ) )
547 mPainterPath.addEllipse( QRectF( -size.width() / 2.0, -size.height() / 2.0, size.width(), size.height() ) );
549 else if (
symbolName == QLatin1String(
"semi_circle" ) )
551 mPainterPath.arcTo( -size.width() / 2.0, -size.height() / 2.0, size.width(), size.height(), 0, 180 );
552 mPainterPath.lineTo( 0, 0 );
554 else if (
symbolName == QLatin1String(
"rectangle" ) )
556 mPainterPath.addRect( QRectF( -size.width() / 2.0, -size.height() / 2.0, size.width(), size.height() ) );
558 else if (
symbolName == QLatin1String(
"diamond" ) )
560 mPainterPath.moveTo( -size.width() / 2.0, 0 );
561 mPainterPath.lineTo( 0, size.height() / 2.0 );
562 mPainterPath.lineTo( size.width() / 2.0, 0 );
563 mPainterPath.lineTo( 0, -size.height() / 2.0 );
564 mPainterPath.lineTo( -size.width() / 2.0, 0 );
566 else if (
symbolName == QLatin1String(
"cross" ) )
568 mPainterPath.moveTo( 0, -size.height() / 2.0 );
569 mPainterPath.lineTo( 0, size.height() / 2.0 );
570 mPainterPath.moveTo( -size.width() / 2.0, 0 );
571 mPainterPath.lineTo( size.width() / 2.0, 0 );
573 else if (
symbolName == QLatin1String(
"triangle" ) )
575 mPainterPath.moveTo( 0, -size.height() / 2.0 );
576 mPainterPath.lineTo( -size.width() / 2.0, size.height() / 2.0 );
577 mPainterPath.lineTo( size.width() / 2.0, size.height() / 2.0 );
578 mPainterPath.lineTo( 0, -size.height() / 2.0 );
580 else if (
symbolName == QLatin1String(
"left_half_triangle" ) )
582 mPainterPath.moveTo( 0, size.height() / 2.0 );
583 mPainterPath.lineTo( size.width() / 2.0, size.height() / 2.0 );
584 mPainterPath.lineTo( 0, -size.height() / 2.0 );
585 mPainterPath.lineTo( 0, size.height() / 2.0 );
587 else if (
symbolName == QLatin1String(
"right_half_triangle" ) )
589 mPainterPath.moveTo( -size.width() / 2.0, size.height() / 2.0 );
590 mPainterPath.lineTo( 0, size.height() / 2.0 );
591 mPainterPath.lineTo( 0, -size.height() / 2.0 );
592 mPainterPath.lineTo( -size.width() / 2.0, size.height() / 2.0 );
599 mSymbolWidthUnit = unit;
600 mSymbolHeightUnit = unit;
601 mStrokeWidthUnit = unit;
607 if ( mSymbolWidthUnit != unit || mSymbolHeightUnit != unit || mStrokeWidthUnit != unit )
617 mSymbolWidthMapUnitScale = scale;
618 mSymbolHeightMapUnitScale = scale;
619 mStrokeWidthMapUnitScale = scale;
625 mSymbolWidthMapUnitScale == mSymbolHeightMapUnitScale &&
626 mSymbolHeightMapUnitScale == mStrokeWidthMapUnitScale )
628 return mSymbolWidthMapUnitScale;
635 QSizeF
size = calculateSize( context );
637 bool hasDataDefinedRotation =
false;
640 calculateOffsetAndRotation( context, size.width(), size.height(), hasDataDefinedRotation,
offset,
angle );
645 transform.translate( point.x() + offset.x(), point.y() + offset.y() );
648 transform.rotate( angle );
650 double penWidth = 0.0;
656 if ( exprVal.isValid() )
670 if ( exprVal.isValid() && exprVal.toString() == QLatin1String(
"no" ) )
679 QRectF symbolBounds = transform.mapRect( QRectF( -size.width() / 2.0,
680 -size.height() / 2.0,
685 symbolBounds.adjust( -penWidth / 2.0, -penWidth / 2.0,
686 penWidth / 2.0, penWidth / 2.0 );
703 symbolWidth *= mmMapUnitScaleFactor;
715 symbolHeight *= mmMapUnitScaleFactor;
740 QColor oc = mStrokeColor;
759 QPointF off( offsetX, offsetY );
762 double rotation = 0.0;
772 rotation = -rotation;
777 t.translate( shift.x() + offsetX, shift.y() + offsetY );
780 t.rotate( rotation );
782 double halfWidth = symbolWidth / 2.0;
783 double halfHeight = symbolHeight / 2.0;
785 if ( symbolName == QLatin1String(
"circle" ) )
789 QgsPoint pt( t.map( QPointF( 0, 0 ) ) );
796 double stepsize = 2 * M_PI / 40;
797 for (
int i = 0; i < 39; ++i )
799 double angle = stepsize * i;
800 double x = halfWidth * std::cos( angle );
801 double y = halfHeight * std::sin( angle );
802 line <<
QgsPoint( t.map( QPointF( x, y ) ) );
805 line << line.at( 0 );
807 if ( mBrush.style() != Qt::NoBrush )
809 if ( mPen.style() != Qt::NoPen )
810 e.
writePolyline( line, layerName, QStringLiteral(
"CONTINUOUS" ), oc, strokeWidth );
813 else if ( symbolName == QLatin1String(
"rectangle" ) )
816 p <<
QgsPoint( t.map( QPointF( -halfWidth, -halfHeight ) ) )
817 <<
QgsPoint( t.map( QPointF( halfWidth, -halfHeight ) ) )
818 <<
QgsPoint( t.map( QPointF( halfWidth, halfHeight ) ) )
819 <<
QgsPoint( t.map( QPointF( -halfWidth, halfHeight ) ) );
822 if ( mBrush.style() != Qt::NoBrush )
824 if ( mPen.style() != Qt::NoPen )
825 e.
writePolyline( p, layerName, QStringLiteral(
"CONTINUOUS" ), oc, strokeWidth );
828 else if ( symbolName == QLatin1String(
"cross" ) && mPen.style() != Qt::NoPen )
831 <<
QgsPoint( t.map( QPointF( -halfWidth, 0 ) ) )
832 <<
QgsPoint( t.map( QPointF( halfWidth, 0 ) ) ),
833 layerName, QStringLiteral(
"CONTINUOUS" ), oc,
strokeWidth );
835 <<
QgsPoint( t.map( QPointF( 0, halfHeight ) ) )
836 <<
QgsPoint( t.map( QPointF( 0, -halfHeight ) ) ),
837 layerName, QStringLiteral(
"CONTINUOUS" ), oc,
strokeWidth );
840 else if ( symbolName == QLatin1String(
"triangle" ) )
843 p <<
QgsPoint( t.map( QPointF( -halfWidth, -halfHeight ) ) )
844 <<
QgsPoint( t.map( QPointF( halfWidth, -halfHeight ) ) )
845 <<
QgsPoint( t.map( QPointF( 0, halfHeight ) ) );
847 if ( mBrush.style() != Qt::NoBrush )
849 if ( mPen.style() != Qt::NoPen )
850 e.
writePolyline( p, layerName, QStringLiteral(
"CONTINUOUS" ), oc, strokeWidth );
void setOffset(QPointF offset)
Sets the marker's offset, which is the horizontal and vertical displacement which the rendered marker...
static void wellKnownMarkerToSld(QDomDocument &doc, QDomElement &element, const QString &name, const QColor &color, const QColor &strokeColor, Qt::PenStyle strokeStyle, double strokeWidth=-1, double size=-1)
QgsMapUnitScale mapUnitScale() const override
QColor valueAsColor(int key, const QgsExpressionContext &context, const QColor &defaultColor=QColor(), bool *ok=nullptr) const
Calculates the current value of the property with the specified key and interprets it as a color...
void setOffsetUnit(QgsUnitTypes::RenderUnit unit)
Sets the units for the symbol's offset.
QString asExpression() const
Returns an expression string representing the state of the property, or an empty string if the proper...
void setStrokeWidthMapUnitScale(const QgsMapUnitScale &scale)
static QDomElement createVendorOptionElement(QDomDocument &doc, const QString &name, const QString &value)
QgsUnitTypes::RenderUnit outputUnit() const override
Returns the units to use for sizes and widths within the symbol layer.
double valueAsDouble(int key, const QgsExpressionContext &context, double defaultValue=0.0, bool *ok=nullptr) const
Calculates the current value of the property with the specified key and interprets it as a double...
void writePolyline(const QgsPointSequence &line, const QString &layer, const QString &lineStyleName, const QColor &color, double width=-1)
Draw dxf primitives (LWPOLYLINE)
void setFillColor(const QColor &c) override
Set fill color.
void startRender(QgsSymbolRenderContext &context) override
bool qgsDoubleNear(double a, double b, double epsilon=4 *std::numeric_limits< double >::epsilon())
Compare two doubles (but allow some difference)
double mLineAngle
Line rotation angle (see setLineAngle() for details)
QgsUnitTypes::RenderUnit mSizeUnit
Marker size unit.
static QPointF decodePoint(const QString &string)
Decodes a QSizeF from a string.
void copyPaintEffect(QgsSymbolLayer *destLayer) const
Copies paint effect of this layer to another symbol layer.
QString layerType() const override
Returns a string that represents this layer type.
static QgsSymbolLayer * create(const QgsStringMap &properties=QgsStringMap())
void setOutputUnit(QgsUnitTypes::RenderUnit unit) override
Sets the units to use for sizes and widths within the symbol layer.
static QString encodeMapUnitScale(const QgsMapUnitScale &mapUnitScale)
static void createDisplacementElement(QDomDocument &doc, QDomElement &element, QPointF offset)
A geometry is the spatial representation of a feature.
void setOffsetMapUnitScale(const QgsMapUnitScale &scale)
Sets the map unit scale for the symbol's offset.
void restoreOldDataDefinedProperties(const QgsStringMap &stringMap)
Restores older data defined properties from string map.
static double sizeInPixelsFromSldUom(const QString &uom, double size)
Returns the size scaled in pixels according to the uom attribute.
void setPenJoinStyle(Qt::PenJoinStyle style)
Set stroke join style.
QVariant value(const QgsExpressionContext &context, const QVariant &defaultValue=QVariant(), bool *ok=nullptr) const
Calculates the current value of the property, including any transforms which are set for the property...
QPointF mOffset
Marker offset.
void setSymbolWidthUnit(QgsUnitTypes::RenderUnit unit)
Sets the units for the symbol's width.
The feature class encapsulates a single feature including its id, geometry and a list of field/values...
static bool rotationFromSldElement(QDomElement &element, QString &rotationFunc)
void toSld(QDomDocument &doc, QDomElement &element, const QgsStringMap &props) const override
QColor strokeColor() const override
Gets stroke color.
QMap< QString, QString > QgsStringMap
Rotation of symbol may be changed during rendering and symbol should not be cached.
static QString encodePoint(QPointF point)
Encodes a QPointF to a string.
Name, eg shape name for simple markers.
static Qt::PenJoinStyle decodePenJoinStyle(const QString &str)
void setStrokeWidth(double w)
bool isActive(int key) const override
Returns true if the collection contains an active property with the specified key.
void writePolygon(const QgsRingSequence &polygon, const QString &layer, const QString &hatchPattern, const QColor &color)
Draw dxf filled polygon (HATCH)
double mapRotation() const
Returns current map rotation in degrees.
static QString encodeColor(const QColor &color)
virtual void setColor(const QColor &color)
The fill color.
QVariant value(int key, const QgsExpressionContext &context, const QVariant &defaultValue=QVariant()) const override
Returns the calculated value of the property with the specified key from within the collection...
void setOriginalValueVariable(const QVariant &value)
Sets the original value variable value for data defined symbology.
static QString encodePenStyle(Qt::PenStyle style)
Perform transforms between map coordinates and device coordinates.
static double rescaleUom(double size, QgsUnitTypes::RenderUnit unit, const QgsStringMap &props)
Rescales the given size based on the uomScale found in the props, if any is found, otherwise returns the value un-modified.
Qt::PenStyle strokeStyle() const
double angle() const
Returns the rotation angle for the marker, in degrees clockwise from north.
QgsUnitTypes::RenderUnit mOffsetUnit
Offset units.
A symbol layer for rendering objects with major and minor axis (e.g.
static QgsStringMap getVendorOptionList(QDomElement &element)
QgsStringMap properties() const override
Should be reimplemented by subclasses to return a string map that contains the configuration informat...
double size() const
Returns the symbol size.
void writeSldMarker(QDomDocument &doc, QDomElement &element, const QgsStringMap &props) const override
Writes the symbol layer definition as a SLD XML element.
void stopRender(QgsSymbolRenderContext &context) override
void setSymbolName(const QString &name)
QgsPropertyCollection & dataDefinedProperties()
Returns a reference to the symbol layer's property collection, used for data defined overrides...
void setSize(double size)
Sets the symbol size.
void setHorizontalAnchorPoint(HorizontalAnchorPoint h)
Sets the horizontal anchor point for positioning the symbol.
void setStrokeWidthUnit(QgsUnitTypes::RenderUnit unit)
Sets the units for the symbol's stroke width.
void setSizeMapUnitScale(const QgsMapUnitScale &scale)
Sets the map unit scale for the symbol's size.
virtual QColor color() const
The fill color.
static void createRotationElement(QDomDocument &doc, QDomElement &element, const QString &rotationFunc)
double mAngle
Marker rotation angle, in degrees clockwise from north.
void writeFilledCircle(const QString &layer, const QColor &color, const QgsPoint &pt, double radius)
Write filled circle (as hatch)
bool writeDxf(QgsDxfExport &e, double mmMapUnitScaleFactor, const QString &layerName, QgsSymbolRenderContext &context, QPointF shift=QPointF(0.0, 0.0)) const override
write as DXF
static QgsSymbolLayer * createFromSld(QDomElement &element)
void setMapUnitScale(const QgsMapUnitScale &scale) override
void markerOffset(QgsSymbolRenderContext &context, double &offsetX, double &offsetY) const
Calculates the required marker offset, including both the symbol offset and any displacement required...
void setSymbolHeightMapUnitScale(const QgsMapUnitScale &scale)
QgsMapUnitScale mSizeMapUnitScale
Marker size map unit scale.
static Q_INVOKABLE QgsUnitTypes::RenderUnit decodeRenderUnit(const QString &string, bool *ok=nullptr)
Decodes a render unit from a string.
A store for object properties.
double symbolWidth() const
QgsRenderContext & renderContext()
Returns a reference to the context's render context.
QgsMapUnitScale mapUnitScale() const override
QRectF bounds(QPointF point, QgsSymbolRenderContext &context) override
Returns the approximate bounding box of the marker symbol layer, taking into account any data defined...
Point geometry type, with support for z-dimension and m-values.
static Qt::PenStyle decodePenStyle(const QString &str)
void renderPoint(QPointF point, QgsSymbolRenderContext &context) override
Renders a marker at the specified point.
HorizontalAnchorPoint
Symbol horizontal anchor points.
VerticalAnchorPoint
Symbol vertical anchor points.
static void createGeometryElement(QDomDocument &doc, QDomElement &element, const QString &geomFunc)
static Q_INVOKABLE QString encodeUnit(QgsUnitTypes::DistanceUnit unit)
Encodes a distance unit to a string.
void setSymbolHeightUnit(QgsUnitTypes::RenderUnit unit)
Sets the units for the symbol's height.
QgsExpressionContext & expressionContext()
Gets the expression context.
QVector< QgsPoint > QgsPointSequence
QVector< QgsPointSequence > QgsRingSequence
void setSizeUnit(QgsUnitTypes::RenderUnit unit)
Sets the units for the symbol's size.
QString valueAsString(int key, const QgsExpressionContext &context, const QString &defaultString=QString(), bool *ok=nullptr) const
Calculates the current value of the property with the specified key and interprets it as a string...
Stroke style (eg solid, dashed)
double convertToPainterUnits(double size, QgsUnitTypes::RenderUnit unit, const QgsMapUnitScale &scale=QgsMapUnitScale()) const
Converts a size from the specified units to painter units (pixels).
QPainter * painter()
Returns the destination QPainter for the render operation.
const QgsMapToPixel & mapToPixel() const
void setStrokeStyle(Qt::PenStyle strokeStyle)
void setStrokeColor(const QColor &c) override
Set stroke color.
double symbolHeight() const
Struct for storing maximum and minimum scales for measurements in map units.
void setMapUnitScale(const QgsMapUnitScale &scale) override
double strokeWidth() const
void setSymbolHeight(double h)
const QgsFeature * feature() const
Current feature being rendered - may be null.
QgsUnitTypes::RenderUnit outputUnit() const override
Returns the units to use for sizes and widths within the symbol layer.
HorizontalAnchorPoint mHorizontalAnchorPoint
Horizontal anchor point.
static bool wellKnownMarkerFromSld(QDomElement &element, QString &name, QColor &color, QColor &strokeColor, Qt::PenStyle &strokeStyle, double &strokeWidth, double &size)
QString symbolName() const
void setAngle(double angle)
Sets the rotation angle for the marker.
static QgsMapUnitScale decodeMapUnitScale(const QString &str)
QColor fillColor() const override
Gets fill color.
bool hasActiveProperties() const override
Returns true if the collection has any active properties, or false if all properties within the colle...
QgsMapUnitScale mOffsetMapUnitScale
Offset map unit scale.
QgsWkbTypes::GeometryType type
VerticalAnchorPoint mVerticalAnchorPoint
Vertical anchor point.
QgsEllipseSymbolLayer * clone() const override
Shall be reimplemented by subclasses to create a deep copy of the instance.
void setSymbolWidth(double w)
static QPointF _rotatedOffset(QPointF offset, double angle)
Adjusts a marker offset to account for rotation.
QPointF offset() const
Returns the marker's offset, which is the horizontal and vertical displacement which the rendered mar...
void setOutputUnit(QgsUnitTypes::RenderUnit unit) override
Sets the units to use for sizes and widths within the symbol layer.
void setSymbolWidthMapUnitScale(const QgsMapUnitScale &scale)
static QString encodePenJoinStyle(Qt::PenJoinStyle style)
QgsPropertyCollection mDataDefinedProperties
bool isActive() const
Returns whether the property is currently active.
QgsProperty property(int key) const override
Returns a matching property from the collection, if one exists.
RenderUnit
Rendering size units.
static QColor decodeColor(const QString &str)
void copyDataDefinedProperties(QgsSymbolLayer *destLayer) const
Copies all data defined properties of this layer to another symbol layer.
void setVerticalAnchorPoint(VerticalAnchorPoint v)
Sets the vertical anchor point for positioning the symbol.
QgsSymbol::RenderHints renderHints() const
Returns the rendering hint flags for the symbol.
void startRender(QgsSymbolRenderContext &context) override