QGIS API Documentation
3.16.0-Hannover (43b64b13f3)
|
Go to the documentation of this file.
20 #include <QSvgGenerator>
74 ( !
qgsDoubleNear( scaleFactorX, 0.0 ) ?
"tostring(" + QString::number( scaleFactorX ) +
"*(" + exprString +
"))" : QStringLiteral(
"'0'" ) ) +
76 ( !
qgsDoubleNear( scaleFactorY, 0.0 ) ?
"tostring(" + QString::number( scaleFactorY ) +
"*(" + exprString +
"))" : QStringLiteral(
"'0'" ) ) );
89 for (
int i = 0; i <
mLayers.count(); i++ )
95 else if ( !
mLayers.at( i )->isCompatibleWithSymbol(
this ) )
106 const unsigned int nPoints = curve.
numPoints();
116 const double cw = e.
width() / 10;
117 const double ch = e.
height() / 10;
140 pts.erase( std::remove_if( pts.begin(), pts.end(),
141 [](
const QPointF point )
143 return !std::isfinite( point.x() ) || !std::isfinite( point.y() );
150 const double cw = e.
width() / 10;
151 const double ch = e.
height() / 10;
156 QPointF *ptr = pts.data();
157 for (
int i = 0; i < pts.size(); ++i, ++ptr )
175 if ( correctRingOrientation )
179 std::reverse( poly.begin(), poly.end() );
181 std::reverse( poly.begin(), poly.end() );
188 const double cw = e.
width() / 10;
189 const double ch = e.
height() / 10;
208 poly.erase( std::remove_if( poly.begin(), poly.end(),
209 [](
const QPointF point )
211 return !std::isfinite( point.x() ) || !std::isfinite( point.y() );
218 const double cw = e.
width() / 10;
219 const double ch = e.
height() / 10;
224 QPointF *ptr = poly.data();
225 for (
int i = 0; i < poly.size(); ++i, ++ptr )
230 if ( !poly.empty() && !poly.isClosed() )
231 poly << poly.at( 0 );
242 holes.reserve( ringCount );
243 for (
int idx = 0; idx < ringCount; idx++ )
246 if ( !hole.isEmpty() )
247 holes.append( hole );
264 QgsSymbolLayerList::const_iterator it =
mLayers.constBegin();
268 for ( ; it !=
mLayers.constEnd(); ++it )
270 if ( ( *it )->outputUnit() != unit )
285 QgsSymbolLayerList::const_iterator it =
mLayers.constBegin();
286 if ( it ==
mLayers.constEnd() )
292 for ( ; it !=
mLayers.constEnd(); ++it )
294 if ( ( *it )->mapUnitScale() != scale )
304 const auto constMLayers =
mLayers;
307 layer->setOutputUnit( u );
313 const auto constMLayers =
mLayers;
316 layer->setMapUnitScale( scale );
322 std::unique_ptr< QgsSymbol > s;
349 s = qgis::make_unique< QgsMarkerSymbol >();
352 s = qgis::make_unique< QgsLineSymbol >();
355 s = qgis::make_unique< QgsFillSymbol >();
358 QgsDebugMsg( QStringLiteral(
"unknown layer's geometry type" ) );
397 if ( index < 0 || index >
mLayers.count() )
400 if ( !
layer || !
layer->isCompatibleWithSymbol(
this ) )
410 if ( !
layer || !
layer->isCompatibleWithSymbol(
this ) )
420 if ( index < 0 || index >=
mLayers.count() )
431 if ( index < 0 || index >=
mLayers.count() )
434 return mLayers.takeAt( index );
442 if ( oldLayer ==
layer )
445 if ( !
layer || !
layer->isCompatibleWithSymbol(
this ) )
456 Q_ASSERT_X( !mStarted,
"startRender",
"Rendering has already been started for this symbol instance!" );
466 mSymbolRenderContext->setExpressionContextScope( scope.release() );
468 const auto constMLayers =
mLayers;
474 layer->prepareExpressions( symbolContext );
475 layer->startRender( symbolContext );
481 Q_ASSERT_X( mStarted,
"startRender",
"startRender was not called for this symbol instance!" );
485 if ( mSymbolRenderContext )
487 const auto constMLayers =
mLayers;
493 layer->stopRender( *mSymbolRenderContext );
497 mSymbolRenderContext.reset(
nullptr );
506 const auto constMLayers =
mLayers;
509 if ( !
layer->isLocked() )
516 for ( QgsSymbolLayerList::const_iterator it =
mLayers.begin(); it !=
mLayers.end(); ++it )
519 if ( !( *it )->isLocked() )
520 return ( *it )->color();
522 return QColor( 0, 0, 0 );
528 std::unique_ptr< QgsRenderContext > tempContext;
532 context = tempContext.get();
544 if ( !customContext && expressionContext )
548 else if ( !customContext )
572 const QSizeF targetSize = QSizeF( size.width() - 1, size.height() - 1 );
580 std::unique_ptr< QgsEffectPainter > effectPainter;
581 if ( effect && effect->
enabled() )
582 effectPainter = qgis::make_unique< QgsEffectPainter >( symbolContext.
renderContext(), effect );
584 for (
const QList< QPolygonF > &poly : polys )
586 QVector< QPolygonF > rings;
587 for (
int i = 1; i < poly.size(); ++i )
588 rings << poly.at( i );
592 effectPainter.reset();
597 layer->drawPreviewIcon( symbolContext, size );
605 if ( format.compare( QLatin1String(
"svg" ), Qt::CaseInsensitive ) == 0 )
607 QSvgGenerator generator;
608 generator.setFileName( path );
609 generator.setSize( size );
610 generator.setViewBox( QRect( 0, 0, size.height(), size.height() ) );
612 QPainter painter( &generator );
618 QImage image =
asImage( size );
625 QImage image( size, QImage::Format_ARGB32_Premultiplied );
628 QPainter p( &image );
629 p.setRenderHint( QPainter::Antialiasing );
639 QImage preview( QSize( 100, 100 ), QImage::Format_ARGB32_Premultiplied );
642 QPainter p( &preview );
643 p.setRenderHint( QPainter::Antialiasing );
644 p.translate( 0.5, 0.5 );
648 p.setPen( QPen( Qt::gray ) );
649 p.drawLine( 0, 50, 100, 50 );
650 p.drawLine( 50, 0, 50, 100 );
655 if ( expressionContext )
664 poly << QPointF( 0, 50 ) << QPointF( 99, 50 );
665 static_cast<QgsLineSymbol *
>( this )->renderPolyline( poly,
nullptr, context );
670 polygon << QPointF( 20, 20 ) << QPointF( 80, 20 ) << QPointF( 80, 80 ) << QPointF( 20, 80 ) << QPointF( 20, 20 );
671 static_cast<QgsFillSymbol *
>( this )->renderPolygon( polygon,
nullptr,
nullptr, context );
675 static_cast<QgsMarkerSymbol *
>( this )->renderPoint( QPointF( 50, 50 ),
nullptr, context );
689 t = QStringLiteral(
"MARKER" );
692 t = QStringLiteral(
"LINE" );
695 t = QStringLiteral(
"FILL" );
698 Q_ASSERT(
false &&
"unknown symbol type" );
702 for ( QgsSymbolLayerList::const_iterator it =
mLayers.begin(); it !=
mLayers.end(); ++it )
711 props[ QStringLiteral(
"alpha" )] = QString::number(
opacity() );
712 double scaleFactor = 1.0;
716 for ( QgsSymbolLayerList::const_iterator it =
mLayers.begin(); it !=
mLayers.end(); ++it )
718 ( *it )->toSld( doc, element, props );
725 for ( QgsSymbolLayerList::const_iterator it =
mLayers.begin(); it !=
mLayers.end(); ++it )
728 layer->setLocked( ( *it )->isLocked() );
729 layer->setRenderingPass( ( *it )->renderingPass() );
730 layer->setEnabled( ( *it )->enabled() );
746 if ( effect && effect->
enabled() )
749 generatorLayer->
render( context );
753 generatorLayer->
render( context );
759 QSet<QString> attributes;
760 QgsSymbolLayerList::const_iterator sIt =
mLayers.constBegin();
761 for ( ; sIt !=
mLayers.constEnd(); ++sIt )
765 attributes.unite( ( *sIt )->usedAttributes( context ) );
773 const auto constMLayers =
mLayers;
776 if (
layer->hasDataDefinedProperties() )
801 class ExpressionContextScopePopper
805 ExpressionContextScopePopper() =
default;
807 ~ExpressionContextScopePopper()
819 class GeometryRestorer
823 : mContext( context ),
824 mGeometry( context.geometry() )
829 mContext.setGeometry( mGeometry );
849 GeometryRestorer geomRestorer( context );
851 bool usingSegmentizedGeometry =
false;
859 if ( std::isfinite( boundsOrigin.x() ) && std::isfinite( boundsOrigin.y() ) )
872 if ( !needsSegmentizing )
876 for (
int i = 0; i < collection->numGeometries(); ++i )
880 needsSegmentizing =
true;
887 if ( needsSegmentizing )
895 usingSegmentizedGeometry =
true;
898 mSymbolRenderContext->setGeometryPartCount( segmentizedGeometry.
constGet()->
partCount() );
899 mSymbolRenderContext->setGeometryPartNum( 1 );
902 ExpressionContextScopePopper scopePopper;
903 if ( mSymbolRenderContext->expressionContextScope() )
905 if ( needsExpressionContext )
930 segmentizedGeometry = simplifier.
simplify( segmentizedGeometry );
949 const QgsPoint *originalGeometry =
nullptr;
951 QVector< PointInfo > pointsToRender;
955 QPolygonF renderLine;
956 const QgsCurve *originalGeometry =
nullptr;
958 QVector< LineInfo > linesToRender;
962 QPolygonF renderExterior;
963 QVector< QPolygonF > renderRings;
966 QVector< PolygonInfo > polygonsToRender;
969 getPartGeometry = [&pointsToRender, &linesToRender, &polygonsToRender, &getPartGeometry, &context, &tileMapRendering, &markers, &feature,
this](
const QgsAbstractGeometry * part )
982 QgsDebugMsgLevel( QStringLiteral(
"point can be drawn only with marker symbol!" ), 2 );
987 info.originalGeometry = qgsgeometry_cast< const QgsPoint * >( part );
988 info.renderPoint =
_getPoint( context, *info.originalGeometry );
989 pointsToRender << info;
997 QgsDebugMsgLevel( QStringLiteral(
"linestring can be drawn only with line symbol!" ), 2 );
1002 info.originalGeometry = qgsgeometry_cast<const QgsCurve *>( part );
1004 linesToRender << info;
1012 QVector<QPolygonF> holes;
1015 QgsDebugMsgLevel( QStringLiteral(
"polygon can be drawn only with fill symbol!" ), 2 );
1020 info.originalGeometry = qgsgeometry_cast<const QgsPolygon *>( part );
1021 if ( !info.originalGeometry->exteriorRing() )
1023 QgsDebugMsg( QStringLiteral(
"cannot render polygon with no exterior ring" ) );
1028 polygonsToRender << info;
1034 const QgsMultiPoint *mp = qgsgeometry_cast< const QgsMultiPoint * >( part );
1042 const QgsGeometryCollection *geomCollection = qgsgeometry_cast<const QgsGeometryCollection *>( part );
1045 for (
unsigned int i = 0; i < num; ++i )
1047 if ( context.renderingStopped() )
1050 getPartGeometry( geomCollection->
geometryN( i ) );
1060 QgsDebugMsgLevel( QStringLiteral(
"multi-polygon can be drawn only with fill symbol!" ), 2 );
1065 QVector<QPolygonF> holes;
1072 std::map<double, QList<unsigned int> > thisAreaToPartNum;
1073 for (
unsigned int i = 0; i < num; ++i )
1075 const QgsPolygon *polygon = qgsgeometry_cast<const QgsPolygon *>( geomCollection->
geometryN( i ) );
1083 std::map<double, QList<unsigned int> >::const_reverse_iterator iter = thisAreaToPartNum.rbegin();
1084 for ( ; iter != thisAreaToPartNum.rend(); ++iter )
1086 const QList<unsigned int> &listPartIndex = iter->second;
1087 for (
int idx = 0; idx < listPartIndex.size(); ++idx )
1089 const unsigned i = listPartIndex[idx];
1090 const QgsPolygon *polygon = qgsgeometry_cast<const QgsPolygon *>( geomCollection->
geometryN( i ) );
1091 getPartGeometry( polygon );
1098 QgsDebugMsg( QStringLiteral(
"feature %1: unsupported wkb type %2/%3 for rendering" )
1099 .arg( feature.id() )
1101 .arg( part->wkbType(), 0, 16 ) );
1105 getPartGeometry( segmentizedGeometry.
constGet() );
1108 std::vector< int > layers;
1111 layers.reserve(
mLayers.count() );
1112 for (
int i = 0; i <
mLayers.count(); ++i )
1113 layers.emplace_back( i );
1117 layers.emplace_back(
layer );
1122 if ( needsExpressionContext )
1125 for (
const int symbolLayerIndex : layers )
1131 if ( needsExpressionContext )
1140 int geometryPartNumber = 0;
1141 for (
const PointInfo &point : qgis::as_const( pointsToRender ) )
1143 if ( context.renderingStopped() )
1146 mSymbolRenderContext->setGeometryPartNum( geometryPartNumber + 1 );
1147 if ( needsExpressionContext )
1150 static_cast<QgsMarkerSymbol *
>( this )->renderPoint( point.renderPoint, &feature, context, symbolLayerIndex, selected );
1151 geometryPartNumber++;
1159 if ( linesToRender.empty() )
1162 int geometryPartNumber = 0;
1163 for (
const LineInfo &line : linesToRender )
1165 if ( context.renderingStopped() )
1168 mSymbolRenderContext->setGeometryPartNum( geometryPartNumber + 1 );
1169 if ( needsExpressionContext )
1172 context.setGeometry( line.originalGeometry );
1173 static_cast<QgsLineSymbol *
>( this )->renderPolyline( line.renderLine, &feature, context, symbolLayerIndex, selected );
1174 geometryPartNumber++;
1181 int geometryPartNumber = 0;
1182 for (
const PolygonInfo &info : polygonsToRender )
1184 if ( context.renderingStopped() )
1187 mSymbolRenderContext->setGeometryPartNum( geometryPartNumber + 1 );
1188 if ( needsExpressionContext )
1191 context.setGeometry( info.originalGeometry );
1192 static_cast<QgsFillSymbol *
>( this )->renderPolygon( info.renderExterior, ( !info.renderRings.isEmpty() ? &info.renderRings : nullptr ), &feature, context, symbolLayerIndex, selected );
1193 geometryPartNumber++;
1211 markers.reserve( pointsToRender.size() );
1212 for (
const PointInfo &info : qgis::as_const( pointsToRender ) )
1216 const QRectF bounds =
static_cast<QgsMarkerSymbol *
>( this )->bounds( info.renderPoint, context, feature );
1217 if ( context.hasRenderedFeatureHandlers() )
1225 context.painter()->setPen( Qt::red );
1226 context.painter()->setBrush( QColor( 255, 0, 0, 100 ) );
1227 context.painter()->drawRect( bounds );
1231 if ( drawVertexMarker && !usingSegmentizedGeometry )
1233 markers.append( info.renderPoint );
1241 for (
const LineInfo &info : qgis::as_const( linesToRender ) )
1243 if ( context.hasRenderedFeatureHandlers() && !info.renderLine.empty() )
1249 if ( drawVertexMarker && !usingSegmentizedGeometry )
1251 markers << info.renderLine;
1260 for (
const PolygonInfo &info : qgis::as_const( polygonsToRender ) )
1262 if ( context.hasRenderedFeatureHandlers() && !info.renderExterior.empty() )
1269 if ( drawVertexMarker && !usingSegmentizedGeometry )
1271 markers << info.renderExterior;
1273 for (
const QPolygonF &hole : info.renderRings )
1287 if ( context.hasRenderedFeatureHandlers() && !renderedBoundsGeom.
isNull() )
1290 const QList< QgsRenderedFeatureHandlerInterface * > handlers = context.renderedFeatureHandlers();
1292 handler->handleRenderedFeature( feature, renderedBoundsGeom, featureContext );
1295 if ( drawVertexMarker )
1297 if ( !markers.isEmpty() && !context.renderingStopped() )
1299 const auto constMarkers = markers;
1300 for ( QPointF marker : constMarkers )
1302 renderVertexMarker( marker, context, currentVertexMarkerType, currentVertexMarkerSize );
1317 x = vertexPoint.
x();
1318 y = vertexPoint.
y();
1327 renderVertexMarker( mapPoint, context, currentVertexMarkerType, currentVertexMarkerSize );
1335 return mSymbolRenderContext.get();
1357 const QList< QgsSymbolLayer * > layers =
mLayers;
1381 const QList< QgsSymbolLayer * > layers =
mLayers;
1396 : mRenderContext(
c )
1398 , mMapUnitScale( mapUnitScale )
1399 , mOpacity( opacity )
1400 , mSelected( selected )
1401 , mRenderHints( renderHints )
1404 , mGeometryPartCount( 0 )
1405 , mGeometryPartNum( 0 )
1439 return mExpressionContextScope.get();
1444 mExpressionContextScope.reset( contextScope );
1449 return mPatchShape.get();
1466 layers.append( sl );
1477 layers.append( sl );
1488 layers.append( sl );
1503 double origAngle =
angle();
1504 double angleDiff = symbolAngle - origAngle;
1505 const auto constMLayers =
mLayers;
1521 return markerLayer->
angle();
1528 const auto constMLayers =
mLayers;
1540 const double symbolRotation =
angle();
1569 const double symbolRotation =
angle();
1600 if ( !layerAngleDD || layerAngleDD != symbolDD )
1606 if ( !layerAngleDD || layerAngleDD != rotatedDD )
1616 double origSize =
size();
1618 const auto constMLayers =
mLayers;
1629 markerLayer->
setSize( markerLayer->
size() * s / origSize );
1633 markerLayer->
setOffset( QPointF( markerLayer->
offset().x() * s / origSize,
1634 markerLayer->
offset().y() * s / origSize ) );
1642 const auto constMLayers =
mLayers;
1648 double lsize = markerLayer->
size();
1649 if ( lsize > maxSize )
1665 maxSize = std::max( maxSize, layerSize );
1672 const auto constMLayers =
mLayers;
1688 const auto constMLayers =
mLayers;
1699 if ( unit != markerLayer->
sizeUnit() )
1710 const auto constMLayers =
mLayers;
1723 const auto constMLayers =
mLayers;
1737 const double symbolSize =
size();
1739 const auto constMLayers =
mLayers;
1765 markerLayer->
offset().x() / symbolSize,
1766 markerLayer->
offset().y() / symbolSize, property ) );
1774 const double symbolSize =
size();
1807 if ( !layerSizeDD || layerSizeDD != symbolDD )
1816 if ( !layerSizeDD || layerSizeDD != scaledDD )
1821 if ( layerOffsetDD && layerOffsetDD != scaledOffsetDD )
1830 const auto constMLayers =
mLayers;
1842 const auto constMLayers =
mLayers;
1857 static QPointF nullPoint( 0, 0 );
1863 if ( effect && effect->
enabled() )
1866 p->translate( point );
1867 p.setEffect( effect );
1868 layer->renderPoint( nullPoint, context );
1872 layer->renderPoint( point, context );
1882 if ( layerIdx != -1 )
1890 renderPointUsingLayer( markerLayer, point, symbolContext );
1910 renderPointUsingLayer( markerLayer, point, symbolContext );
1922 const auto constMLayers =
mLayers;
1928 if ( bound.isNull() )
1929 bound =
symbolLayer->bounds( point, symbolContext );
1931 bound = bound.united(
symbolLayer->bounds( point, symbolContext ) );
1962 double origWidth =
width();
1964 const auto constMLayers =
mLayers;
1989 const auto constLLayers =
mLayers;
2002 double maxWidth = 0;
2006 const auto constMLayers =
mLayers;
2013 if (
width > maxWidth )
2023 double maxWidth = 0;
2029 const double layerWidth = lineLayer->
width( context );
2030 maxWidth = std::max( maxWidth, layerWidth );
2037 const double symbolWidth =
width();
2039 const auto constMLayers =
mLayers;
2073 const double symbolWidth =
width();
2078 for ( QgsSymbolLayerList::const_iterator it =
mLayers.begin(); it !=
mLayers.end(); ++it )
2092 const auto constMLayers =
mLayers;
2104 if ( !layerWidthDD || layerWidthDD != symbolDD )
2113 if ( !layerWidthDD || layerWidthDD != scaledDD )
2118 if ( layerOffsetDD && layerOffsetDD != scaledOffsetDD )
2128 QPainter *renderPainter = context.
painter();
2134 if ( layerIdx != -1 )
2142 renderPolylineUsingLayer( lineLayer, points, symbolContext );
2150 const auto constMLayers =
mLayers;
2162 renderPolylineUsingLayer( lineLayer, points, symbolContext );
2179 if ( effect && effect->
enabled() )
2182 p->translate( points.boundingRect().topLeft() );
2183 p.setEffect( effect );
2184 layer->renderPolyline( points.translated( -points.boundingRect().topLeft() ), context );
2188 layer->renderPolyline( points, context );
2222 if ( layerIdx != -1 )
2228 renderPolygonUsingLayer(
symbolLayer, points, rings, symbolContext );
2235 const auto constMLayers =
mLayers;
2245 renderPolygonUsingLayer(
symbolLayer, points, rings, symbolContext );
2259 if ( effect && effect->
enabled() )
2261 QRectF bounds = polygonBounds( points, rings );
2262 QVector<QPolygonF> *translatedRings = translateRings( rings, -bounds.left(), -bounds.top() );
2265 p->translate( bounds.topLeft() );
2266 p.setEffect( effect );
2269 (
static_cast<QgsFillSymbolLayer *
>(
layer ) )->renderPolygon( points.translated( -bounds.topLeft() ), translatedRings, context );
2273 (
static_cast<QgsLineSymbolLayer *
>(
layer ) )->renderPolygonStroke( points.translated( -bounds.topLeft() ), translatedRings, context );
2275 delete translatedRings;
2290 QRectF QgsFillSymbol::polygonBounds(
const QPolygonF &points,
const QVector<QPolygonF> *rings )
const
2292 QRectF bounds = points.boundingRect();
2295 for (
auto it = rings->constBegin(); it != rings->constEnd(); ++it )
2297 bounds = bounds.united( ( *it ).boundingRect() );
2303 QVector<QPolygonF> *QgsFillSymbol::translateRings(
const QVector<QPolygonF> *rings,
double dx,
double dy )
const
2308 QVector<QPolygonF> *translatedRings =
new QVector<QPolygonF>;
2309 translatedRings->reserve( rings->size() );
2310 for (
auto it = rings->constBegin(); it != rings->constEnd(); ++it )
2312 translatedRings->append( ( *it ).translated( dx, dy ) );
2314 return translatedRings;
2331 const auto constMLayers =
mLayers;
Abstract base class for curved geometry type.
void setOriginalValueVariable(const QVariant &value)
Sets the original value variable value for data defined symbology.
Q_DECL_DEPRECATED void setLayer(const QgsVectorLayer *layer)
Expression contexts are used to encapsulate the parameters around which a QgsExpression should be eva...
QgsSymbolLayerList cloneLayers() const
Retrieve a cloned list of all layers that make up this symbol.
static QPolygonF _getPolygonRing(QgsRenderContext &context, const QgsCurve &curve, bool clipToExtent, bool isExteriorRing=false, bool correctRingOrientation=false)
Creates a polygon ring in screen coordinates from a QgsCurve in map coordinates.
void setAngle(double symbolAngle)
Sets the angle for the whole symbol.
bool enabled() const
Returns true if symbol layer is enabled and will be drawn.
QgsFillSymbol(const QgsSymbolLayerList &layers=QgsSymbolLayerList())
Constructor for QgsFillSymbol, with the specified list of initial symbol layers.
void appendScopes(const QList< QgsExpressionContextScope * > &scopes)
Appends a list of scopes to the end of the context.
void setSizeUnit(QgsUnitTypes::RenderUnit unit)
Sets the units for the symbol's size.
QColor color() const
Returns the symbol's color.
static QgsSymbolLayer * create(const QgsStringMap &properties=QgsStringMap())
Creates a new QgsSimpleFillSymbolLayer using the specified properties map containing symbol propertie...
double height() const SIP_HOLDGIL
Returns the height of the rectangle.
void setWidthUnit(QgsUnitTypes::RenderUnit unit)
Sets the units for the line's width.
bool testFlag(Flag flag) const
Check whether a particular flag is enabled.
QList< QList< QPolygonF > > toQPolygonF(QgsSymbol::SymbolType type, QSizeF size) const
Converts the patch shape to a set of QPolygonF objects representing how the patch should be drawn for...
static QString encodeColor(const QColor &color)
static QPolygonF clippedLine(const QgsCurve &curve, const QgsRectangle &clipExtent)
Takes a linestring and clips it to clipExtent.
void setIsGuiPreview(bool preview)
Sets GUI preview mode.
void setDataDefinedAngle(const QgsProperty &property)
Set data defined angle for whole symbol (including all symbol layers).
double convertToPainterUnits(double size, QgsUnitTypes::RenderUnit unit, const QgsMapUnitScale &scale=QgsMapUnitScale()) const
Converts a size from the specified units to painter units (pixels).
virtual void startFeatureRender(const QgsFeature &feature, QgsRenderContext &context)
Called before the layer will be rendered for a particular feature.
const QgsMapToPixel & mapToPixel() const
Returns the context's map to pixel transform, which transforms between map coordinates and device coo...
static QString displayString(Type type) SIP_HOLDGIL
Returns a display string type for a WKB type, e.g., the geometry name used in WKT geometry representa...
double size() const
Returns the symbol size.
QgsPropertyCollection & dataDefinedProperties()
Returns a reference to the symbol layer's property collection, used for data defined overrides.
A store for object properties.
RenderUnit
Rendering size units.
QgsGeometry featureClipGeometry() const
Returns the geometry to use to clip features at render time.
QgsExpressionContext & expressionContext()
Gets the expression context.
static QgsSymbol * defaultSymbol(QgsWkbTypes::GeometryType geomType)
Returns a new default symbol for the specified geometry type.
virtual double width() const
Returns the estimated width for the line symbol layer.
A class to manager painter saving and restoring required for effect drawing.
void setSizeUnit(QgsUnitTypes::RenderUnit unit)
Sets the size units for the whole symbol (including all symbol layers).
Point geometry type, with support for z-dimension and m-values.
QgsSymbolRenderContext(QgsRenderContext &c, QgsUnitTypes::RenderUnit u, qreal opacity=1.0, bool selected=false, QgsSymbol::RenderHints renderHints=QgsSymbol::RenderHints(), const QgsFeature *f=nullptr, const QgsFields &fields=QgsFields(), const QgsMapUnitScale &mapUnitScale=QgsMapUnitScale())
Constructor for QgsSymbolRenderContext.
double size() const
Returns the estimated size for the whole symbol, which is the maximum size of all marker symbol layer...
#define QgsDebugMsgLevel(str, level)
static QgsSymbolLayer * create(const QgsStringMap &properties=QgsStringMap())
Creates a new QgsSimpleLineSymbolLayer, using the settings serialized in the properties map (correspo...
void renderUsingLayer(QgsSymbolLayer *layer, QgsSymbolRenderContext &context)
Renders a context using a particular symbol layer without passing in a geometry.
const QgsCurve * exteriorRing() const SIP_HOLDGIL
Returns the curve polygon's exterior ring.
QgsProperty dataDefinedSize() const
Returns data defined size for whole symbol (including all symbol layers).
QgsSymbolLayer * takeSymbolLayer(int index)
Removes a symbol layer from the list and returns a pointer to it.
double width() const
Returns the estimated width for the whole symbol, which is the maximum width of all marker symbol lay...
static Type flatType(Type type) SIP_HOLDGIL
Returns the flat type for a WKB type.
void setFlag(Flag flag, bool on=true)
Enable or disable a particular flag (other flags are not affected)
QgsLineSymbol * clone() const override
Returns a deep copy of this symbol.
virtual void setWidth(double width)
Sets the width of the line symbol layer.
static QgsMarkerSymbol * createSimple(const QgsStringMap &properties)
Create a marker symbol with one symbol layer: SimpleMarker with specified properties.
void setPainter(QPainter *p)
Sets the destination QPainter for the render operation.
Q_DECL_DEPRECATED const QgsVectorLayer * layer() const
void setOriginalValueVariable(const QVariant &value)
Sets the original value variable value for the context.
void setAngle(double angle)
Sets the rotation angle for the marker.
Container of fields for a vector layer.
double yMinimum() const SIP_HOLDGIL
Returns the y minimum value (bottom side of rectangle).
void setSelected(bool selected)
Sets whether symbols should be rendered using the selected symbol coloring and style.
void setGeometryPartNum(int num)
Sets the part number of current geometry.
QgsSymbol::ScaleMethod scaleMethod() const
Returns the method to use for scaling the marker's size.
QString asExpression() const
Returns an expression string representing the state of the property, or an empty string if the proper...
SimplifyAlgorithm simplifyAlgorithm() const
Gets the local simplification algorithm of the vector layer managed.
Contains information about the context of a rendering operation.
static QgsProject * instance()
Returns the QgsProject singleton instance.
bool hasDataDefinedProperties() const
Returns whether the symbol utilizes any data defined properties.
static QgsColorSchemeRegistry * colorSchemeRegistry()
Returns the application's color scheme registry, used for managing color schemes.
@ RenderMillimeters
Millimeters.
void setDataDefinedSize(const QgsProperty &property)
Set data defined size for whole symbol (including all symbol layers).
static QList< QgsExpressionContextScope * > globalProjectLayerScopes(const QgsMapLayer *layer)
Creates a list of three scopes: global, layer's project and layer.
Abstract base class for marker symbol layers.
QgsMapUnitScale mapUnitScale() const
Returns the map unit scale for the symbol.
static const QString EXPR_GEOMETRY_PART_NUM
Inbuilt variable name for geometry part number variable.
~QgsSymbolRenderContext()
QString readEntry(const QString &scope, const QString &key, const QString &def=QString(), bool *ok=nullptr) const
Reads a string from the specified scope and key.
Abstract base class for all rendered symbols.
static QgsProperty fromExpression(const QString &expression, bool isActive=true)
Returns a new ExpressionBasedProperty created from the specified expression.
virtual int partCount() const =0
Returns count of parts contained in the geometry.
double angle() const
Returns the marker angle for the whole symbol.
bool readBoolEntry(const QString &scope, const QString &key, bool def=false, bool *ok=nullptr) const
Reads a boolean from the specified scope and key.
QgsSymbolLayer * symbolLayer(int layer)
Returns the symbol layer at the specified index.
bool insertSymbolLayer(int index, QgsSymbolLayer *layer)
Inserts a symbol layer to specified index.
static QgsSymbolLayer * create(const QgsStringMap &properties=QgsStringMap())
Creates a new QgsSimpleMarkerSymbolLayer.
const QgsRectangle & extent() const
When rendering a map layer, calling this method returns the "clipping" extent for the layer (in the l...
QgsUnitTypes::RenderUnit outputUnit() const
Returns the units to use for sizes and widths within the symbol.
QgsSymbol(SymbolType type, const QgsSymbolLayerList &layers)
void setWidth(double width)
Sets the width for the whole line symbol.
const QgsLegendPatchShape * patchShape() const
Returns the symbol patch shape, to use if rendering symbol preview icons.
void setOffset(double offset)
Sets the line's offset.
A rectangle specified with double values.
Represents a patch shape for use in map legends.
QString qgsDoubleToString(double a, int precision=17)
Returns a string representation of a double.
int numGeometries() const SIP_HOLDGIL
Returns the number of geometries within the collection.
An interface for classes which provider custom handlers for features rendered as part of a map render...
QgsGeometry intersection(const QgsGeometry &geometry) const
Returns a geometry representing the points shared by this geometry and other.
bool isSymbolLayerEnabled(const QgsSymbolLayer *layer) const
When rendering a map layer in a second pass (for selective masking), some symbol layers may be disabl...
QgsProperty property(int key) const override
Returns a matching property from the collection, if one exists.
QImage bigSymbolPreviewImage(QgsExpressionContext *expressionContext=nullptr, QgsSymbol::PreviewFlags flags=QgsSymbol::FlagIncludeCrosshairsForMarkerSymbols)
Returns a large (roughly 100x100 pixel) preview image for the symbol.
void exportImage(const QString &path, const QString &format, QSize size)
Export the symbol as an image format, to the specified path and with the given size.
QgsMarkerSymbol * clone() const override
Returns a deep copy of this symbol.
void setPatchShape(const QgsLegendPatchShape &shape)
Sets the symbol patch shape, to use if rendering symbol preview icons.
QgsProperty rotateWholeSymbol(double additionalRotation, const QgsProperty &property)
QgsUnitTypes::RenderUnit sizeUnit() const
Returns the units for the symbol's size.
static QgsStyle * defaultStyle()
Returns default application-wide style.
QgsExpressionContextScope * expressionContextScope()
This scope is always available when a symbol of this type is being rendered.
void setMapUnitScale(const QgsMapUnitScale &scale)
Sets the map unit scale for the symbol.
ScaleMethod scaleMethod()
int numInteriorRings() const SIP_HOLDGIL
Returns the number of interior rings contained with the curve polygon.
void setOpacity(qreal opacity)
Sets the opacity for the symbol.
#define Q_NOWARN_DEPRECATED_POP
bool renderingStopped() const
Returns true if the rendering operation has been stopped and any ongoing rendering should be canceled...
void setClipFeaturesToExtent(bool clipFeaturesToExtent)
Sets whether features drawn by the symbol should be clipped to the render context's extent.
double xMaximum() const SIP_HOLDGIL
Returns the x maximum value (right side of rectangle).
QgsCoordinateTransform coordinateTransform() const
Returns the current coordinate transform for the context.
qreal opacity() const
Returns the opacity for the symbol.
@ PropertyOffset
Symbol offset.
Custom exception class for Coordinate Reference System related exceptions.
bool forceVectorOutput() const
Returns true if rendering operations should use vector operations instead of any faster raster shortc...
bool changeSymbolLayer(int index, QgsSymbolLayer *layer)
Deletes the current layer at the specified index and replaces it with layer.
QgsWkbTypes::Type wkbType() const SIP_HOLDGIL
Returns the WKB type of the geometry.
void setOutputUnit(QgsUnitTypes::RenderUnit unit)
Sets the units to use for sizes and widths within the symbol.
bool appendSymbolLayer(QgsSymbolLayer *layer)
Appends a symbol layer at the end of the current symbol layer list.
void stopRender(QgsRenderContext &context)
Ends the rendering process.
void setAngle(double angle)
static void trimPolygon(QPolygonF &pts, const QgsRectangle &clipRect)
SimplifyAlgorithm
Types of simplification algorithms that can be used.
QgsSymbolLayerList mLayers
static void _getPolygon(QPolygonF &pts, QVector< QPolygonF > &holes, QgsRenderContext &context, const QgsPolygon &polygon, bool clipToExtent=true, bool correctRingOrientation=false)
Creates a polygon in screen coordinates from a QgsPolygonXYin map coordinates.
virtual QPolygonF asQPolygonF() const
Returns a QPolygonF representing the points.
void toSld(QDomDocument &doc, QDomElement &element, QgsStringMap props) const
Converts the symbol to a SLD representation.
bool contains(const QgsRectangle &rect) const
Returns true when rectangle contains other rectangle.
A marker symbol type, for rendering Point and MultiPoint geometries.
void renderFeature(const QgsFeature &feature, QgsRenderContext &context, int layer=-1, bool selected=false, bool drawVertexMarker=false, int currentVertexMarkerType=0, double currentVertexMarkerSize=0.0) SIP_THROW(QgsCsException)
Render a feature.
virtual void stopFeatureRender(const QgsFeature &feature, QgsRenderContext &context)
Called after the layer has been rendered for a particular feature.
bool qgsDoubleNear(double a, double b, double epsilon=4 *std::numeric_limits< double >::epsilon())
Compare two doubles (but allow some difference)
void setLineAngle(double lineAngle)
Sets the line angle modification for the symbol's angle.
@ Clockwise
Clockwise orientation.
A simple line symbol layer, which renders lines using a line in a variety of styles (e....
Simple marker symbol layer, consisting of a rendered shape with solid fill color and an stroke.
QString dump() const
Returns a string dump of the symbol's properties.
@ PropertySize
Symbol size.
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.
void setGeometryPartCount(int count)
Sets the part count of current geometry.
void setScaleMethod(QgsSymbol::ScaleMethod scaleMethod)
@ CounterClockwise
Counter-clockwise orientation.
A line symbol type, for rendering LineString and MultiLineString geometries.
double segmentationTolerance() const
Gets the segmentation tolerance applied when rendering curved geometries.
QgsAbstractGeometry::SegmentationToleranceType segmentationToleranceType() const
Gets segmentation tolerance type (maximum angle or maximum difference between curve and approximation...
@ DrawSymbolBounds
Draw bounds of symbols (for debugging/testing)
QgsProperty dataDefinedWidth() const
Returns data defined width for whole symbol (including all symbol layers).
@ RenderMapTile
Draw map such that there are no problems between adjacent tiles.
bool isEmpty() const
Returns true if the geometry is empty (eg a linestring with no vertices, or a collection with no geom...
Q_DECL_DEPRECATED double outputLineWidth(double width) const
void setOffset(QPointF offset)
Sets the marker's offset, which is the horizontal and vertical displacement which the rendered marker...
double readDoubleEntry(const QString &scope, const QString &key, double def=0, bool *ok=nullptr) const
Reads a double from the specified scope and key.
Struct for storing maximum and minimum scales for measurements in map units.
virtual bool hasCurvedSegments() const
Returns true if the geometry contains curved segments.
void startRender(QgsRenderContext &context, const QgsFields &fields=QgsFields())
Begins the rendering process for the symbol.
QgsPaintEffect * paintEffect() const
Returns the current paint effect for the layer.
double xMinimum() const SIP_HOLDGIL
Returns the x minimum value (left side of rectangle).
const QgsCurve * interiorRing(int i) const SIP_HOLDGIL
Retrieves an interior ring from the curve polygon.
double tolerance() const
Gets the tolerance of simplification in map units. Represents the maximum distance in map units betwe...
void renderVertexMarker(QPointF pt, QgsRenderContext &context, int currentVertexMarkerType, double currentVertexMarkerSize)
Render editing vertex marker at specified point.
void renderPolygon(const QPolygonF &points, const QVector< QPolygonF > *rings, const QgsFeature *f, QgsRenderContext &context, int layer=-1, bool selected=false)
Renders the symbol using the given render context.
@ PropertyStrokeWidth
Stroke width.
QgsSymbolRenderContext * symbolRenderContext()
Returns the symbol render context.
const QgsAbstractGeometry * constGet() const SIP_HOLDGIL
Returns a non-modifiable (const) reference to the underlying abstract geometry primitive.
bool forceLocalOptimization() const
Gets where the simplification executes, after fetch the geometries from provider, or when supported,...
Multi point geometry collection.
void setForceRHR(bool force)
Sets whether polygon features drawn by the symbol should be reoriented to follow the standard right-h...
void setLineAngle(double lineAngle)
Sets the line angle modification for the symbol's angle.
Abstract base class for all geometries.
Q_DECL_DEPRECATED const QgsVectorLayer * mLayer
Single scope for storing variables and functions for use within a QgsExpressionContext.
const QgsVectorSimplifyMethod & vectorSimplifyMethod() const
Returns the simplification settings to use when rendering vector layers.
virtual QgsAbstractGeometry * segmentize(double tolerance=M_PI/180., SegmentationToleranceType toleranceType=MaximumAngle) const
Returns a version of the geometry without curves.
QRectF bounds(QPointF point, QgsRenderContext &context, const QgsFeature &feature=QgsFeature()) const
Returns the approximate bounding box of the marker symbol, which includes the bounding box of all sym...
Implementation of GeometrySimplifier using the "MapToPixel" algorithm.
@ PropertyLayerEnabled
Whether symbol layer is enabled.
void appendScope(QgsExpressionContextScope *scope)
Appends a scope to the end of the context.
void setForceVectorOutput(bool force)
Sets whether rendering operations should use vector operations instead of any faster raster shortcuts...
static const QString EXPR_GEOMETRY_PART_COUNT
Inbuilt variable name for geometry part count variable.
qreal mOpacity
Symbol opacity (in the range 0 - 1)
void setOriginalGeometryType(QgsWkbTypes::GeometryType type)
Sets the geometry type for the original feature geometry being rendered.
void transformInPlace(double &x, double &y) const
Transform device coordinates to map coordinates.
static bool isCurvedType(Type type) SIP_HOLDGIL
Returns true if the WKB type is a curved type or can contain curved geometries.
QMap< QString, QString > QgsStringMap
static QPointF _getPoint(QgsRenderContext &context, const QgsPoint &point)
Creates a point in screen coordinates from a QgsPoint in map coordinates.
Q_DECL_DEPRECATED double outputPixelSize(double size) const
QgsRectangle mapExtent() const
Returns the original extent of the map being rendered.
QList< QList< QPolygonF > > defaultPatchAsQPolygonF(QgsSymbol::SymbolType type, QSizeF size) const
Returns the default patch geometry for the given symbol type and size as a set of QPolygonF objects (...
double yMaximum() const SIP_HOLDGIL
Returns the y maximum value (top side of rectangle).
const QgsAbstractGeometry * geometryN(int n) const
Returns a const reference to a geometry from within the collection.
void setDataDefinedWidth(const QgsProperty &property)
Set data defined width for whole symbol (including all symbol layers).
static QgsExpressionContextScope * updateSymbolScope(const QgsSymbol *symbol, QgsExpressionContextScope *symbolScope=nullptr)
Updates a symbol scope related to a QgsSymbol to an expression context.
QgsProperty scaleWholeSymbol(double scaleFactor, const QgsProperty &property)
GeometryType
The geometry types are used to group QgsWkbTypes::Type in a coarse way.
bool clipFeaturesToExtent() const
Returns whether features drawn by the symbol will be clipped to the render context's extent.
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
A geometry is the spatial representation of a feature.
void setColor(const QColor &color)
Sets the color for the symbol.
virtual void render(QgsSymbolRenderContext &context)
Will render this symbol layer using the context.
Perform transforms between map coordinates and device coordinates.
void drawPreviewIcon(QPainter *painter, QSize size, QgsRenderContext *customContext=nullptr, bool selected=false, const QgsExpressionContext *expressionContext=nullptr, const QgsLegendPatchShape *patchShape=nullptr)
Draws an icon of the symbol that occupies an area given by size using the specified painter.
Represents a vector layer which manages a vector based data sets.
double width() const SIP_HOLDGIL
Returns the width of the rectangle.
QgsProperty dataDefinedAngle() const
Returns data defined angle for whole symbol (including all symbol layers).
QList< QgsSymbolLayer * > QgsSymbolLayerList
static QgsLineSymbol * createSimple(const QgsStringMap &properties)
Create a line symbol with one symbol layer: SimpleLine with specified properties.
static QgsRenderContext fromQPainter(QPainter *painter)
Creates a default render context given a pixel based QPainter destination.
#define DEFAULT_SCALE_METHOD
QgsGeometry simplify(const QgsGeometry &geometry) const override
Returns a simplified version the specified geometry.
QSet< QString > usedAttributes(const QgsRenderContext &context) const
Returns a list of attributes required to render this feature.
bool deleteSymbolLayer(int index)
Removes and deletes the symbol layer at the specified index.
static QgsGeometry fromRect(const QgsRectangle &rect) SIP_HOLDGIL
Creates a new geometry from a QgsRectangle.
Utility class for identifying a unique vertex within a geometry.
Base class for visual effects which can be applied to QPicture drawings.
QgsFillSymbol * clone() const override
Returns a deep copy of this symbol.
@ PropertyAngle
Symbol angle.
A fill symbol type, for rendering Polygon and MultiPolygon geometries.
void renderPolyline(const QPolygonF &points, const QgsFeature *f, QgsRenderContext &context, int layer=-1, bool selected=false)
Renders the symbol along the line joining points, using the given render context.
QgsLineSymbol(const QgsSymbolLayerList &layers=QgsSymbolLayerList())
Constructor for QgsLineSymbol, with the specified list of initial symbol layers.
@ RenderUnknownUnit
Mixed or unknown units.
VertexMarkerType
Editing vertex markers.
virtual void stopRender(QgsSymbolRenderContext &context)=0
Called after a set of rendering operations has finished on the supplied render context.
void setWidthUnit(QgsUnitTypes::RenderUnit unit)
Sets the width units for the whole symbol (including all symbol layers).
SymbolType type() const
Returns the symbol's type.
void setExpressionContextScope(QgsExpressionContextScope *contextScope)
Set an expression scope for this symbol.
void setExpressionContext(const QgsExpressionContext &context)
Sets the expression context.
static QString encodeSldUom(QgsUnitTypes::RenderUnit unit, double *scaleFactor)
Encodes a render unit into an SLD unit of measure string.
virtual void setSize(double size)
Sets the symbol size.
QgsRectangle boundingBox() const
Returns the bounding box of the geometry.
QPointF offset() const
Returns the marker's offset, which is the horizontal and vertical displacement which the rendered mar...
void setSizeMapUnitScale(const QgsMapUnitScale &scale)
Sets the map unit scale for the symbol's size.
SimplifyHints simplifyHints() const
Gets the simplification hints of the vector layer managed.
QgsSymbol::SymbolType type() const
@ RenderSymbolPreview
The render is for a symbol preview only and map based properties may not be available,...
static QgsGeometry fromQPolygonF(const QPolygonF &polygon)
Construct geometry from a QPolygonF.
The feature class encapsulates a single feature including its id, geometry and a list of field/values...
static QgsFillSymbol * createSimple(const QgsStringMap &properties)
Create a fill symbol with one symbol layer: SimpleFill with specified properties.
QgsRenderContext & renderContext()
Returns a reference to the context's render context.
double offset() const
Returns the line's offset.
virtual int numPoints() const =0
Returns the number of points in the curve.
SymbolType
Type of the symbol.
QgsUnitTypes::RenderUnit sizeUnit() const
Returns the size units for the whole symbol (including all symbol layers).
virtual void startRender(QgsSymbolRenderContext &context)=0
Called before a set of rendering operations commences on the supplied render context.
QPainter * painter()
Returns the destination QPainter for the render operation.
bool enabled() const
Returns whether the effect is enabled.
QgsMarkerSymbol(const QgsSymbolLayerList &layers=QgsSymbolLayerList())
Constructor for QgsMarkerSymbol, with the specified list of initial symbol layers.
void setGeometry(const QgsAbstractGeometry *geometry)
Sets pointer to original (unsegmentized) geometry.
QImage asImage(QSize size, QgsRenderContext *customContext=nullptr)
Returns an image of the symbol at the specified size.
Single variable definition for use within a QgsExpressionContextScope.
Orientation orientation() const
Returns the curve's orientation, e.g.
QgsMapUnitScale sizeMapUnitScale() const
Returns the size map unit scale for the whole symbol.
bool isActive(int key) const override
Returns true if the collection contains an active property with the specified key.
QgsWkbTypes::GeometryType type
QgsVectorLayer * clone() const override
Returns a new instance equivalent to this one.
#define Q_NOWARN_DEPRECATED_PUSH
static QPolygonF _getLineString(QgsRenderContext &context, const QgsCurve &curve, bool clipToExtent=true)
Creates a line string in screen coordinates from a QgsCurve in map coordinates.
void renderPoint(QPointF point, const QgsFeature *f, QgsRenderContext &context, int layer=-1, bool selected=false)
Renders the symbol at the specified point, using the given render context.
void setTextureOrigin(const QPointF &origin)
Sets the texture origin, which should be used as a brush transform when rendering using QBrush object...
double ANALYSIS_EXPORT angle(QgsPoint *p1, QgsPoint *p2, QgsPoint *p3, QgsPoint *p4)
Calculates the angle between two segments (in 2 dimension, z-values are ignored)
void setAngle(double angle)
virtual bool nextVertex(QgsVertexId &id, QgsPoint &vertex) const =0
Returns next vertex id and coordinates.
bool isNull() const
Test if the rectangle is null (all coordinates zero or after call to setMinimal()).
double angle() const
Returns the rotation angle for the marker, in degrees clockwise from north.
@ ApplyClipAfterReprojection
Feature geometry clipping to mapExtent() must be performed after the geometries are transformed using...
virtual void setDataDefinedProperty(Property key, const QgsProperty &property)
Sets a data defined property for the layer.
bool mClipFeaturesToExtent
QgsRectangle boundingBox() const override
Returns the minimal bounding box for the geometry.
void setScaleMethod(QgsSymbol::ScaleMethod scaleMethod)
Sets the method to use for scaling the marker's size.
static QgsGeometry collectGeometry(const QVector< QgsGeometry > &geometries)
Creates a new multipart geometry from a list of QgsGeometry objects.
void setSize(double size)
Sets the size for the whole symbol.
Flags flags() const
Returns combination of flags used for rendering.
static void drawVertexMarker(double x, double y, QPainter &p, QgsSymbolLayerUtils::VertexMarkerType type, int markerSize)
Draws a vertex symbol at (painter) coordinates x, y.
void setSizeMapUnitScale(const QgsMapUnitScale &scale)
Sets the size map unit scale for the whole symbol (including all symbol layers).
QgsSymbolRenderContext & operator=(const QgsSymbolRenderContext &)
const QgsMapUnitScale & sizeMapUnitScale() const
Returns the map unit scale for the symbol's size.