40void QgsSymbolLayer::initPropertyDefinitions()
42 if ( !sPropertyDefinitions.isEmpty() )
45 QString origin = QStringLiteral(
"symbol" );
134 lSubSymbol->startFeatureRender( feature, context );
140 lSubSymbol->stopFeatureRender( feature, context );
159 Q_UNUSED( mmMapUnitScaleFactor )
160 Q_UNUSED( layerName )
202 return QVector<qreal>();
207 return Qt::SolidLine;
235 : mType( other.mType )
236 , mEnabled( other.mEnabled )
237 , mUserFlags( other.mUserFlags )
238 , mLocked( other.mLocked )
239 , mColor( other.mColor )
240 , mRenderingPass( other.mRenderingPass )
242 , mDataDefinedProperties( other.mDataDefinedProperties )
243 , mPaintEffect( other.mPaintEffect ? other.mPaintEffect->clone() : nullptr )
244 , mFields( other.mFields )
245 , mClipPath( other.mClipPath )
252 , mId( QUuid::createUuid().toString() )
318 QgsSymbolLayer::initPropertyDefinitions();
319 return sPropertyDefinitions;
364 if ( !baseName.isEmpty() )
366 prefix.append( QStringLiteral(
"%1_dd_" ).arg( baseName ) );
369 if ( !map.contains( QStringLiteral(
"%1expression" ).arg( prefix ) ) )
375 bool active = ( map.value( QStringLiteral(
"%1active" ).arg( prefix ), QStringLiteral(
"1" ) ) != QLatin1String(
"0" ) );
376 QString expression = map.value( QStringLiteral(
"%1expression" ).arg( prefix ) ).toString();
377 bool useExpression = ( map.value( QStringLiteral(
"%1useexpr" ).arg( prefix ), QStringLiteral(
"1" ) ) != QLatin1String(
"0" ) );
378 QString field = map.value( QStringLiteral(
"%1field" ).arg( prefix ), QString() ).toString();
389 static const QMap < QString, int > OLD_PROPS
464 QVariantMap::const_iterator propIt = stringMap.constBegin();
465 for ( ; propIt != stringMap.constEnd(); ++propIt )
467 std::unique_ptr<QgsProperty> prop;
468 QString propertyName;
470 if ( propIt.key().endsWith( QLatin1String(
"_dd_expression" ) ) )
475 propertyName = propIt.key().left( propIt.key().length() - 14 );
477 prop = std::make_unique<QgsProperty>(
propertyFromMap( stringMap, propertyName ) );
479 else if ( propIt.key().endsWith( QLatin1String(
"_expression" ) ) )
484 propertyName = propIt.key().left( propIt.key().length() - 11 );
489 if ( !prop || !OLD_PROPS.contains( propertyName ) )
492 int key = OLD_PROPS.value( propertyName );
497 if ( propertyName == QLatin1String(
"width" ) )
499 else if ( propertyName == QLatin1String(
"color" ) )
554 , mAngle( other.mAngle )
555 , mLineAngle( other.mLineAngle )
556 , mSize( other.mSize )
557 , mSizeUnit( other.mSizeUnit )
558 , mSizeMapUnitScale( other.mSizeMapUnitScale )
559 , mOffset( other.mOffset )
560 , mOffsetUnit( other.mOffsetUnit )
561 , mOffsetMapUnitScale( other.mOffsetMapUnitScale )
562 , mScaleMethod( other.mScaleMethod )
563 , mHorizontalAnchorPoint( other.mHorizontalAnchorPoint )
564 , mVerticalAnchorPoint( other.mVerticalAnchorPoint )
587 std::unique_ptr< QgsEffectPainter > effectPainter;
588 if ( effect && effect->
enabled() )
589 effectPainter = std::make_unique< QgsEffectPainter >( context.
renderContext(), effect );
591 for ( QPointF point : std::as_const( points ) )
594 effectPainter.reset();
675 offsetX += anchorPointCorrectionX;
679 offsetX -= anchorPointCorrectionX;
685 offsetY += anchorPointCorrectionY;
689 offsetY -= anchorPointCorrectionY;
696 double c = std::cos(
angle ), s = std::sin(
angle );
702 if ( str.compare( QLatin1String(
"left" ), Qt::CaseInsensitive ) == 0 )
706 else if ( str.compare( QLatin1String(
"right" ), Qt::CaseInsensitive ) == 0 )
718 if ( str.compare( QLatin1String(
"top" ), Qt::CaseInsensitive ) == 0 )
722 else if ( str.compare( QLatin1String(
"bottom" ), Qt::CaseInsensitive ) == 0 )
791 std::unique_ptr< QgsEffectPainter > effectPainter;
792 if ( effect && effect->
enabled() )
793 effectPainter = std::make_unique< QgsEffectPainter >( context.
renderContext(), effect );
795 for (
const QList< QPolygonF > &line : points )
798 effectPainter.reset();
806 std::unique_ptr< QgsExpressionContextScopePopper > scopePopper;
835 for (
const QPolygonF &ring : std::as_const( *rings ) )
871 std::unique_ptr< QgsEffectPainter > effectPainter;
872 if ( effect && effect->
enabled() )
873 effectPainter = std::make_unique< QgsEffectPainter >( context.
renderContext(), effect );
875 for (
const QList< QPolygonF > &poly : polys )
877 QVector< QPolygonF > rings;
878 for (
int i = 1; i < poly.size(); ++i )
879 rings << poly.at( i );
883 effectPainter.reset();
901 if ( points.size() <= 5 &&
904 ( p->renderHints() & QPainter::Antialiasing ) )
906 p->setRenderHint( QPainter::Antialiasing,
false );
907 p->drawRect( points.boundingRect() );
908 p->setRenderHint( QPainter::Antialiasing,
true );
914 if ( !rings && p->pen().style() == Qt::NoPen )
917 p->drawPolygon( points );
923 path.addPolygon( points );
927 for (
auto it = rings->constBegin(); it != rings->constEnd(); ++it )
929 QPolygonF ring = *it;
930 path.addPolygon( ring );
940 QDomElement symbolizerElem = doc.createElement( QStringLiteral(
"se:PointSymbolizer" ) );
941 if ( !props.value( QStringLiteral(
"uom" ), QString() ).toString().isEmpty() )
942 symbolizerElem.setAttribute( QStringLiteral(
"uom" ), props.value( QStringLiteral(
"uom" ), QString() ).toString() );
943 element.appendChild( symbolizerElem );
992 foundGeometries =
false;
993 const QVector<QgsGeometry> clipGeometries = rect
996 if ( !clipGeometries.empty() )
998 foundGeometries =
true;
1005#if GEOS_VERSION_MAJOR==3 && GEOS_VERSION_MINOR<10
1026 if ( !maskGeom.
isNull() )
1032 return QPainterPath();
1039 bool foundGeometries =
false;
1052 else if ( rect.isValid() )
1055 bool foundGeometries =
false;
1056 const QPainterPath clipPath =
generateClipPath( context,
id(), &rect, foundGeometries );
1057 if ( !clipPath.isEmpty() )
1059 context.
painter()->setClipPath( clipPath, context.
painter()->clipPath().isEmpty() ? Qt::ReplaceClip : Qt::IntersectClip );
1066 const QList<QgsSymbolLayer *> layers = lSubSymbol->symbolLayers();
1068 res = sl->installMasks( context,
true ) || res;
1083 const QList<QgsSymbolLayer *> layers = lSubSymbol->symbolLayers();
1085 sl->removeMasks( context,
true );
The Qgis class provides global constants for use throughout the application.
@ AntialiasingSimplification
The geometries can be rendered with 'AntiAliasing' disabled because of it is '1-pixel size'.
@ ScaleDiameter
Calculate scale by the diameter.
@ ScaleArea
Calculate scale by the area.
QFlags< SymbolLayerFlag > SymbolLayerFlags
Symbol layer flags.
QFlags< SymbolLayerUserFlag > SymbolLayerUserFlags
Symbol layer user flags.
RenderUnit
Rendering size units.
@ Millimeters
Millimeters.
@ Unknown
Mixed or unknown units.
@ MetersInMapUnits
Meters value as Map units.
@ RenderSymbolPreview
The render is for a symbol preview only and map based properties may not be available,...
@ Linework
Combines all rings into a set of noded lines and then extracts valid polygons from that linework.
@ Structure
Structured method, first makes all rings valid and then merges shells and subtracts holes from shells...
@ DisableSelectionRecoloring
If present, indicates that the symbol layer should not be recolored when rendering selected features.
static bool isGeneralizableByDeviceBoundingBox(const QgsRectangle &envelope, float mapToPixelTol=1.0f)
Returns whether the device-envelope can be replaced by its BBOX when is applied the specified toleran...
virtual QPainterPath asQPainterPath() const =0
Returns the geometry represented as a QPainterPath.
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.
Exports QGIS layers to the DXF format.
static double mapUnitScaleFactor(double scale, Qgis::RenderUnit symbolUnits, Qgis::DistanceUnit mapUnits, double mapUnitsPerPixel=1.0)
Returns scale factor for conversion to map units.
Qgis::DistanceUnit mapUnits() const
Retrieve map units.
double symbologyScale() const
Returns the reference scale for output.
Single scope for storing variables and functions for use within a QgsExpressionContext.
void addVariable(const QgsExpressionContextScope::StaticVariable &variable)
Adds a variable into the context scope.
static const QString EXPR_GEOMETRY_RING_NUM
Inbuilt variable name for geometry ring number variable.
The feature class encapsulates a single feature including its unique ID, geometry and a list of field...
virtual void renderPolygon(const QPolygonF &points, const QVector< QPolygonF > *rings, QgsSymbolRenderContext &context)=0
Renders the fill symbol layer for the polygon whose outer ring is defined by points,...
void _renderPolygon(QPainter *p, const QPolygonF &points, const QVector< QPolygonF > *rings, QgsSymbolRenderContext &context)
Default method to render polygon.
virtual QImage toTiledPatternImage() const
Renders the symbol layer as an image that can be used as a seamless pattern fill for polygons,...
void drawPreviewIcon(QgsSymbolRenderContext &context, QSize size) override
QgsFillSymbolLayer(const QgsFillSymbolLayer &other)=delete
A geometry is the spatial representation of a feature.
static QgsGeometry fromRect(const QgsRectangle &rect)
Creates a new geometry from a QgsRectangle.
QgsGeometry difference(const QgsGeometry &geometry, const QgsGeometryParameters ¶meters=QgsGeometryParameters()) const
Returns a geometry representing the points making up this geometry that do not make up other.
QgsGeometry makeValid(Qgis::MakeValidMethod method=Qgis::MakeValidMethod::Linework, bool keepCollapsed=false) const
Attempts to make an invalid geometry valid without losing vertices.
const QgsAbstractGeometry * constGet() const
Returns a non-modifiable (const) reference to the underlying abstract geometry primitive.
bool isEmpty() const
Returns true if the geometry is empty (eg a linestring with no vertices, or a collection with no geom...
static QgsGeometry unaryUnion(const QVector< QgsGeometry > &geometries, const QgsGeometryParameters ¶meters=QgsGeometryParameters())
Compute the unary union on a list of geometries.
Does vector analysis using the GEOS library and handles import, export, and exception handling.
QList< QList< QPolygonF > > toQPolygonF(Qgis::SymbolType type, QSizeF size) const
Converts the patch shape to a set of QPolygonF objects representing how the patch should be drawn for...
Qgis::RenderUnit mOffsetUnit
RenderRingFilter
Options for filtering rings when the line symbol layer is being used to render a polygon's rings.
@ ExteriorRingOnly
Render the exterior ring only.
@ InteriorRingsOnly
Render the interior rings only.
@ AllRings
Render both exterior and interior rings.
QgsMapUnitScale mWidthMapUnitScale
RenderRingFilter ringFilter() const
Returns the line symbol layer's ring filter, which controls which rings are rendered when the line sy...
void drawPreviewIcon(QgsSymbolRenderContext &context, QSize size) override
QgsLineSymbolLayer(const QgsLineSymbolLayer &other)=delete
void setOutputUnit(Qgis::RenderUnit unit) override
Sets the units to use for sizes and widths within the symbol layer.
Qgis::RenderUnit outputUnit() const override
Returns the units to use for sizes and widths within the symbol layer.
virtual void renderPolygonStroke(const QPolygonF &points, const QVector< QPolygonF > *rings, QgsSymbolRenderContext &context)
Renders the line symbol layer along the outline of polygon, using the given render context.
Qgis::RenderUnit mWidthUnit
virtual void renderPolyline(const QPolygonF &points, QgsSymbolRenderContext &context)=0
Renders the line symbol layer along the line joining points, using the given render context.
RenderRingFilter mRingFilter
virtual double width() const
Returns the estimated width for the line symbol layer.
double dxfWidth(const QgsDxfExport &e, QgsSymbolRenderContext &context) const override
Gets line width.
QgsMapUnitScale mapUnitScale() const override
void setRingFilter(QgsLineSymbolLayer::RenderRingFilter filter)
Sets the line symbol layer's ring filter, which controls which rings are rendered when the line symbo...
void setMapUnitScale(const QgsMapUnitScale &scale) override
Qgis::RenderUnit widthUnit() const
Returns the units for the line's width.
double mapUnitsPerPixel() const
Returns the current map units per pixel.
Struct for storing maximum and minimum scales for measurements in map units.
Abstract base class for marker symbol layers.
QgsMarkerSymbolLayer(const QgsMarkerSymbolLayer &other)
void drawPreviewIcon(QgsSymbolRenderContext &context, QSize size) override
Qgis::RenderUnit mOffsetUnit
Offset units.
QPointF offset() const
Returns the marker's offset, which is the horizontal and vertical displacement which the rendered mar...
HorizontalAnchorPoint
Symbol horizontal anchor points.
@ Right
Align to right side of symbol.
@ HCenter
Align to horizontal center of symbol.
@ Left
Align to left side of symbol.
Qgis::RenderUnit outputUnit() const override
Returns the units to use for sizes and widths within the symbol layer.
virtual void renderPoint(QPointF point, QgsSymbolRenderContext &context)=0
Renders a marker at the specified point.
QPointF mOffset
Marker offset.
QgsMapUnitScale mapUnitScale() const override
double size() const
Returns the symbol size.
QgsMapUnitScale mOffsetMapUnitScale
Offset map unit scale.
HorizontalAnchorPoint mHorizontalAnchorPoint
Horizontal anchor point.
static QPointF _rotatedOffset(QPointF offset, double angle)
Adjusts a marker offset to account for rotation.
virtual double dxfAngle(QgsSymbolRenderContext &context) const override
Gets angle.
Qgis::ScaleMethod mScaleMethod
Marker size scaling method.
virtual double dxfSize(const QgsDxfExport &e, QgsSymbolRenderContext &context) const override
Gets marker size.
void stopRender(QgsSymbolRenderContext &context) override
Called after a set of rendering operations has finished on the supplied render context.
VerticalAnchorPoint verticalAnchorPoint() const
Returns the vertical anchor point for positioning the symbol.
QgsMapUnitScale mSizeMapUnitScale
Marker size map unit scale.
Qgis::RenderUnit mSizeUnit
Marker size unit.
void setOutputUnit(Qgis::RenderUnit unit) override
Sets the units to use for sizes and widths within the symbol layer.
HorizontalAnchorPoint horizontalAnchorPoint() const
Returns the horizontal anchor point for positioning the symbol.
VerticalAnchorPoint
Symbol vertical anchor points.
@ VCenter
Align to vertical center of symbol.
@ Bottom
Align to bottom of symbol.
@ Top
Align to top of symbol.
void markerOffset(QgsSymbolRenderContext &context, double &offsetX, double &offsetY) const
Calculates the required marker offset, including both the symbol offset and any displacement required...
VerticalAnchorPoint mVerticalAnchorPoint
Vertical anchor point.
void toSld(QDomDocument &doc, QDomElement &element, const QVariantMap &props) const override
Saves the symbol layer as SLD.
virtual void writeSldMarker(QDomDocument &doc, QDomElement &element, const QVariantMap &props) const
Writes the symbol layer definition as a SLD XML element.
double mAngle
Marker rotation angle, in degrees clockwise from north.
void startRender(QgsSymbolRenderContext &context) override
Called before a set of rendering operations commences on the supplied render context.
double angle() const
Returns the rotation angle for the marker, in degrees clockwise from north.
void setMapUnitScale(const QgsMapUnitScale &scale) override
double simplifyTolerance() const
Returns the simplification tolerance (in painter units) to use for on-the-fly simplification of mask ...
static bool isDefaultStack(QgsPaintEffect *effect)
Tests whether a paint effect matches the default effects stack.
Base class for visual effects which can be applied to QPicture drawings.
bool enabled() const
Returns whether the effect is enabled.
QVariant value(int key, const QgsExpressionContext &context, const QVariant &defaultValue=QVariant()) const final
Returns the calculated value of the property with the specified key from within the collection.
void setProperty(int key, const QgsProperty &property)
Adds a property to the collection and takes ownership of it.
bool isActive(int key) const final
Returns true if the collection contains an active property with the specified key.
bool prepare(const QgsExpressionContext &context=QgsExpressionContext()) const final
Prepares the collection against a specified expression context.
bool hasActiveProperties() const final
Returns true if the collection has any active properties, or false if all properties within the colle...
QSet< QString > referencedFields(const QgsExpressionContext &context=QgsExpressionContext(), bool ignoreContext=false) const final
Returns the set of any fields referenced by the active properties from the collection.
Definition for a property.
@ HorizontalAnchor
Horizontal anchor point.
@ Double
Double value (including negative values)
@ VerticalAnchor
Vertical anchor point.
@ Double0To1
Double value between 0-1 (inclusive)
@ FillStyle
Fill style (eg solid, lines)
@ StrokeWidth
Line stroke width.
@ LineStyle
Line style (eg solid/dashed)
@ String
Any string value.
@ PenJoinStyle
Pen join style.
@ IntegerPositive
Positive integer values (including 0)
@ CapStyle
Line cap style (eg round)
@ Rotation
Rotation (value between 0-360 degrees)
@ Size
1D size (eg marker radius, or square marker height/width)
@ ColorWithAlpha
Color with alpha channel.
@ DoublePositive
Positive double value (including 0)
@ DataTypeString
Property requires a string value.
@ DataTypeNumeric
Property requires a numeric value.
A store for object properties.
static QgsProperty fromExpression(const QString &expression, bool isActive=true)
Returns a new ExpressionBasedProperty created from the specified expression.
static QgsProperty fromField(const QString &fieldName, bool isActive=true)
Returns a new FieldBasedProperty created from the specified field name.
A rectangle specified with double values.
QgsRectangle intersect(const QgsRectangle &rect) const
Returns the intersection with the given rectangle.
Contains information about the context of a rendering operation.
QgsVectorSimplifyMethod & vectorSimplifyMethod()
Returns the simplification settings to use when rendering vector layers.
double convertToPainterUnits(double size, Qgis::RenderUnit unit, const QgsMapUnitScale &scale=QgsMapUnitScale(), Qgis::RenderSubcomponentProperty property=Qgis::RenderSubcomponentProperty::Generic) const
Converts a size from the specified units to painter units (pixels).
QPainter * painter()
Returns the destination QPainter for the render operation.
QgsExpressionContext & expressionContext()
Gets the expression context.
QSize outputSize() const
Returns the size of the resulting rendered image, in pixels.
const QgsMapToPixel & mapToPixel() const
Returns the context's map to pixel transform, which transforms between map coordinates and device coo...
QVector< QgsGeometry > symbolLayerClipGeometries(const QString &symbolLayerId) const
Returns clipping geometries to be applied to the symbolLayer before rendering.
Qgis::RenderContextFlags flags() const
Returns combination of flags used for rendering.
const QgsMaskRenderSettings & maskSettings() const
Returns a reference to the mask render settings, which control how masks are drawn and behave during ...
static QgsStyle * defaultStyle(bool initialize=true)
Returns the default application-wide style.
QList< QList< QPolygonF > > defaultPatchAsQPolygonF(Qgis::SymbolType type, QSizeF size) const
Returns the default patch geometry for the given symbol type and size as a set of QPolygonF objects (...
static QPointF toPoint(const QVariant &value, bool *ok=nullptr)
Converts a value to a point.
static QVector< QgsGeometry > collectSymbolLayerClipGeometries(const QgsRenderContext &context, const QString &symbolLayerId, const QRectF &bounds)
Returns a list of the symbol layer clip geometries to be used for the symbol layer with the specified...
static void createGeometryElement(QDomDocument &doc, QDomElement &element, const QString &geomFunc)
static QString encodePoint(QPointF point)
Encodes a QPointF to a string.
virtual bool setSubSymbol(QgsSymbol *symbol)
Sets layer's subsymbol. takes ownership of the passed symbol.
bool shouldRenderUsingSelectionColor(const QgsSymbolRenderContext &context) const
Returns true if the symbol layer should be rendered using the selection color from the render context...
Qgis::SymbolType type() const
virtual void startFeatureRender(const QgsFeature &feature, QgsRenderContext &context)
Called before the layer will be rendered for a particular feature.
virtual QColor fillColor() const
Returns the fill color for the symbol layer.
void setId(const QString &id)
Set symbol layer identifier This id has to be unique in the whole project.
virtual void setStrokeColor(const QColor &color)
Sets the stroke color for the symbol layer.
bool installMasks(QgsRenderContext &context, bool recursive, const QRectF &rect=QRectF())
When rendering, install masks on context painter.
virtual double dxfSize(const QgsDxfExport &e, QgsSymbolRenderContext &context) const
Gets marker size.
virtual double dxfOffset(const QgsDxfExport &e, QgsSymbolRenderContext &context) const
Gets offset.
virtual QColor dxfBrushColor(QgsSymbolRenderContext &context) const
Gets brush/fill color.
void removeMasks(QgsRenderContext &context, bool recursive)
When rendering, remove previously installed masks from context painter if recursive is true masks are...
virtual QSet< QString > usedAttributes(const QgsRenderContext &context) const
Returns the set of attributes referenced by the layer.
void copyDataDefinedProperties(QgsSymbolLayer *destLayer) const
Copies all data defined properties of this layer to another symbol layer.
Property
Data definable properties.
@ SkipMultiples
Skip multiples of.
@ ArrowHeadLength
Arrow head length.
@ GradientType
Gradient fill type.
@ SecondaryColor
Secondary color (eg for gradient fills)
@ File
Filename, eg for svg files.
@ VerticalAnchor
Vertical anchor point.
@ GradientReference2Y
Gradient reference point 2 y.
@ GradientReference1X
Gradient reference point 1 x.
@ OffsetY
Vertical offset.
@ OffsetX
Horizontal offset.
@ GradientReference1Y
Gradient reference point 1 y.
@ ArrowWidth
Arrow tail width.
@ DashPatternOffset
Dash pattern offset,.
@ GradientSpread
Gradient spread mode.
@ OffsetAlongLine
Offset along line.
@ ArrowHeadType
Arrow head type.
@ CustomDash
Custom dash pattern.
@ ShapeburstMaxDistance
Shapeburst fill from edge distance.
@ HorizontalAnchor
Horizontal anchor point.
@ StrokeStyle
Stroke style (eg solid, dashed)
@ Name
Name, eg shape name for simple markers.
@ DistanceY
Vertical distance between points.
@ LineEndColorValue
End line color for interpolated line renderer.
@ DensityArea
Density area.
@ ClipPoints
Whether markers should be clipped to polygon boundaries.
@ ArrowHeadThickness
Arrow head thickness.
@ LineClipping
Line clipping mode.
@ ShapeburstIgnoreRings
Shapeburst ignore rings.
@ Character
Character, eg for font marker symbol layers.
@ ShapeburstUseWholeShape
Shapeburst use whole shape.
@ DisplacementX
Horizontal displacement.
@ ShowMarker
Show markers.
@ CoordinateMode
Gradient coordinate mode.
@ FillStyle
Fill style (eg solid, dots)
@ GradientReference2X
Gradient reference point 2 x.
@ StrokeColor
Stroke color.
@ TrimStart
Trim distance from start of line.
@ ArrowStartWidth
Arrow tail start width.
@ CapStyle
Line cap style.
@ BlurRadius
Shapeburst blur radius.
@ Placement
Line marker placement.
@ MarkerClipping
Marker clipping mode.
@ RandomSeed
Random number seed.
@ LineAngle
Line angle, or angle of hash lines for hash line symbols.
@ JoinStyle
Line join style.
@ RandomOffsetY
Random offset Y.
@ DisplacementY
Vertical displacement.
@ PreserveAspectRatio
Preserve aspect ratio between width and height.
@ LineStartColorValue
Start line color for interpolated line renderer.
@ DistanceX
Horizontal distance between points.
@ AverageAngleLength
Length to average symbol angles over.
@ LineEndWidthValue
End line width for interpolated line renderer.
@ GradientReference1IsCentroid
Gradient reference point 1 is centroid.
@ Interval
Line marker interval.
@ StrokeWidth
Stroke width.
@ GradientReference2IsCentroid
Gradient reference point 2 is centroid.
@ LineStartWidthValue
Start line width for interpolated line renderer.
@ LineDistance
Distance between lines, or length of lines for hash line symbols.
@ RandomOffsetX
Random offset X.
@ TrimEnd
Trim distance from end of line.
@ LayerEnabled
Whether symbol layer is enabled.
void restoreOldDataDefinedProperties(const QVariantMap &stringMap)
Restores older data defined properties from string map.
void setPaintEffect(QgsPaintEffect *effect)
Sets the current paint effect for the layer.
void setRenderingPass(int renderingPass)
Specifies the rendering pass in which this symbol layer should be rendered.
QgsPaintEffect * paintEffect() const
Returns the current paint effect for the layer.
virtual void startRender(QgsSymbolRenderContext &context)=0
Called before a set of rendering operations commences on the supplied render context.
std::unique_ptr< QgsPaintEffect > mPaintEffect
virtual Qt::PenStyle dxfPenStyle() const
Gets pen style.
virtual void setFillColor(const QColor &color)
Sets the fill color for the symbol layer.
virtual void prepareExpressions(const QgsSymbolRenderContext &context)
Prepares all data defined property expressions for evaluation.
void setUserFlags(Qgis::SymbolLayerUserFlags flags)
Sets user-controlled flags which control the symbol layer's behavior.
virtual QColor dxfColor(QgsSymbolRenderContext &context) const
Gets color.
int renderingPass() const
Specifies the rendering pass in which this symbol layer should be rendered.
virtual void stopRender(QgsSymbolRenderContext &context)=0
Called after a set of rendering operations has finished on the supplied render context.
virtual bool isCompatibleWithSymbol(QgsSymbol *symbol) const
Returns if the layer can be used below the specified symbol.
QString id() const
Returns symbol layer identifier This id is unique in the whole project.
virtual void setDataDefinedProperty(Property key, const QgsProperty &property)
Sets a data defined property for the layer.
virtual void setColor(const QColor &color)
Sets the "representative" color for the symbol layer.
virtual QgsSymbol * subSymbol()
Returns the symbol's sub symbol, if present.
Qgis::SymbolLayerUserFlags userFlags() const
Returns user-controlled flags which control the symbol layer's behavior.
virtual QColor color() const
Returns the "representative" color of the symbol layer.
virtual void prepareMasks(const QgsSymbolRenderContext &context)
Prepares all mask internal objects according to what is defined in context This should be called prio...
virtual void stopFeatureRender(const QgsFeature &feature, QgsRenderContext &context)
Called after the layer has been rendered for a particular feature.
static const QgsPropertiesDefinition & propertyDefinitions()
Returns the symbol layer property definitions.
virtual double dxfWidth(const QgsDxfExport &e, QgsSymbolRenderContext &context) const
Gets line width.
virtual QColor strokeColor() const
Returns the stroke color for the symbol layer.
virtual double dxfAngle(QgsSymbolRenderContext &context) const
Gets angle.
Qgis::SymbolLayerUserFlags mUserFlags
User controlled flags.
virtual bool canCauseArtifactsBetweenAdjacentTiles() const
Returns true if the symbol layer rendering can cause visible artifacts across a single feature when t...
virtual ~QgsSymbolLayer()
virtual bool usesMapUnits() const
Returns true if the symbol layer has any components which use map unit based sizes.
virtual bool writeDxf(QgsDxfExport &e, double mmMapUnitScaleFactor, const QString &layerName, QgsSymbolRenderContext &context, QPointF shift=QPointF(0.0, 0.0)) const
write as DXF
void copyPaintEffect(QgsSymbolLayer *destLayer) const
Copies paint effect of this layer to another symbol layer.
virtual Qgis::SymbolLayerFlags flags() const
Returns flags which control the symbol layer's behavior.
QgsPropertyCollection mDataDefinedProperties
virtual QList< QgsSymbolLayerReference > masks() const
Returns masks defined by this symbol layer.
QgsPropertyCollection & dataDefinedProperties()
Returns a reference to the symbol layer's property collection, used for data defined overrides.
virtual Qt::BrushStyle dxfBrushStyle() const
Gets brush/fill style.
virtual QVector< qreal > dxfCustomDashPattern(Qgis::RenderUnit &unit) const
Gets dash pattern.
virtual bool hasDataDefinedProperties() const
Returns true if the symbol layer (or any of its sub-symbols) contains data defined properties.
QgsSymbolLayer(const QgsSymbolLayer &other)
void setDataDefinedProperties(const QgsPropertyCollection &collection)
Sets the symbol layer's property collection, used for data defined overrides.
QgsFields fields() const
Fields of the layer.
bool selected() const
Returns true if symbols should be rendered using the selected symbol coloring and style.
void setOriginalValueVariable(const QVariant &value)
Sets the original value variable value for data defined symbology.
const QgsLegendPatchShape * patchShape() const
Returns the symbol patch shape, to use if rendering symbol preview icons.
QgsRenderContext & renderContext()
Returns a reference to the context's render context.
Abstract base class for all rendered symbols.
Qgis::SymbolType type() const
Returns the symbol's type.
static bool isNull(const QVariant &variant, bool silenceNullWarnings=false)
Returns true if the specified variant should be considered a NULL value.
Qgis::VectorRenderingSimplificationFlags simplifyHints() const
Gets the simplification hints of the vector layer managed.
float threshold() const
Gets the simplification threshold of the vector layer managed.
Contains geos related utilities and functions.
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
QMap< int, QgsPropertyDefinition > QgsPropertiesDefinition
Definition of available properties.
QgsProperty propertyFromMap(const QVariantMap &map, const QString &baseName)
QPainterPath generateClipPath(const QgsRenderContext &renderContext, const QString &id, const QRectF *rect, bool &foundGeometries)
Single variable definition for use within a QgsExpressionContextScope.