20 #include <QSvgGenerator>
77 ( !
qgsDoubleNear( scaleFactorX, 0.0 ) ?
"tostring(" + QString::number( scaleFactorX ) +
"*(" + exprString +
"))" : QStringLiteral(
"'0'" ) ) +
79 ( !
qgsDoubleNear( scaleFactorY, 0.0 ) ?
"tostring(" + QString::number( scaleFactorY ) +
"*(" + exprString +
"))" : QStringLiteral(
"'0'" ) ) );
92 for (
int i = 0; i <
mLayers.count(); i++ )
98 else if ( !
mLayers.at( i )->isCompatibleWithSymbol(
this ) )
109 const unsigned int nPoints = curve.
numPoints();
119 const double cw = e.
width() / 10;
120 const double ch = e.
height() / 10;
143 pts.erase( std::remove_if( pts.begin(), pts.end(),
144 [](
const QPointF point )
146 return !std::isfinite( point.x() ) || !std::isfinite( point.y() );
153 const double cw = e.
width() / 10;
154 const double ch = e.
height() / 10;
159 QPointF *ptr = pts.data();
160 for (
int i = 0; i < pts.size(); ++i, ++ptr )
178 if ( correctRingOrientation )
182 std::reverse( poly.begin(), poly.end() );
184 std::reverse( poly.begin(), poly.end() );
191 const double cw = e.
width() / 10;
192 const double ch = e.
height() / 10;
211 poly.erase( std::remove_if( poly.begin(), poly.end(),
212 [](
const QPointF point )
214 return !std::isfinite( point.x() ) || !std::isfinite( point.y() );
221 const double cw = e.
width() / 10;
222 const double ch = e.
height() / 10;
227 QPointF *ptr = poly.data();
228 for (
int i = 0; i < poly.size(); ++i, ++ptr )
233 if ( !poly.empty() && !poly.isClosed() )
234 poly << poly.at( 0 );
245 holes.reserve( ringCount );
246 for (
int idx = 0; idx < ringCount; idx++ )
249 if ( !hole.isEmpty() )
250 holes.append( hole );
256 QgsSymbol::initPropertyDefinitions();
257 return sPropertyDefinitions;
273 QgsSymbolLayerList::const_iterator it =
mLayers.constBegin();
277 for ( ; it !=
mLayers.constEnd(); ++it )
279 if ( ( *it )->outputUnit() != unit )
296 if (
layer->usesMapUnits() )
311 QgsSymbolLayerList::const_iterator it =
mLayers.constBegin();
312 if ( it ==
mLayers.constEnd() )
318 for ( ; it !=
mLayers.constEnd(); ++it )
320 if ( ( *it )->mapUnitScale() != scale )
330 const auto constMLayers =
mLayers;
333 layer->setOutputUnit( u );
339 const auto constMLayers =
mLayers;
342 layer->setMapUnitScale( scale );
348 std::unique_ptr< QgsSymbol > s;
375 s = qgis::make_unique< QgsMarkerSymbol >();
378 s = qgis::make_unique< QgsLineSymbol >();
381 s = qgis::make_unique< QgsFillSymbol >();
384 QgsDebugMsg( QStringLiteral(
"unknown layer's geometry type" ) );
423 if ( index < 0 || index >
mLayers.count() )
426 if ( !
layer || !
layer->isCompatibleWithSymbol(
this ) )
436 if ( !
layer || !
layer->isCompatibleWithSymbol(
this ) )
446 if ( index < 0 || index >=
mLayers.count() )
457 if ( index < 0 || index >=
mLayers.count() )
460 return mLayers.takeAt( index );
468 if ( oldLayer ==
layer )
471 if ( !
layer || !
layer->isCompatibleWithSymbol(
this ) )
482 Q_ASSERT_X( !mStarted,
"startRender",
"Rendering has already been started for this symbol instance!" );
492 mSymbolRenderContext->setExpressionContextScope( scope.release() );
496 const auto constMLayers =
mLayers;
502 layer->prepareExpressions( symbolContext );
503 layer->startRender( symbolContext );
509 Q_ASSERT_X( mStarted,
"startRender",
"startRender was not called for this symbol instance!" );
513 if ( mSymbolRenderContext )
515 const auto constMLayers =
mLayers;
521 layer->stopRender( *mSymbolRenderContext );
525 mSymbolRenderContext.reset(
nullptr );
534 const auto constMLayers =
mLayers;
537 if ( !
layer->isLocked() )
544 for ( QgsSymbolLayerList::const_iterator it =
mLayers.begin(); it !=
mLayers.end(); ++it )
547 if ( !( *it )->isLocked() )
548 return ( *it )->color();
550 return QColor( 0, 0, 0 );
556 std::unique_ptr< QgsRenderContext > tempContext;
560 context = tempContext.get();
575 if ( !customContext && expressionContext )
579 else if ( !customContext )
603 const QSizeF targetSize = QSizeF( size.width() - 1, size.height() - 1 );
611 std::unique_ptr< QgsEffectPainter > effectPainter;
612 if ( effect && effect->
enabled() )
613 effectPainter = qgis::make_unique< QgsEffectPainter >( symbolContext.
renderContext(), effect );
615 for (
const QList< QPolygonF > &poly : polys )
617 QVector< QPolygonF > rings;
618 rings.reserve( poly.size() );
619 for (
int i = 1; i < poly.size(); ++i )
620 rings << poly.at( i );
624 effectPainter.reset();
629 layer->drawPreviewIcon( symbolContext, size );
637 if ( format.compare( QLatin1String(
"svg" ), Qt::CaseInsensitive ) == 0 )
639 QSvgGenerator generator;
640 generator.setFileName( path );
641 generator.setSize( size );
642 generator.setViewBox( QRect( 0, 0, size.height(), size.height() ) );
644 QPainter painter( &generator );
650 QImage image =
asImage( size );
657 QImage image( size, QImage::Format_ARGB32_Premultiplied );
660 QPainter p( &image );
661 p.setRenderHint( QPainter::Antialiasing );
671 QImage preview( QSize( 100, 100 ), QImage::Format_ARGB32_Premultiplied );
674 QPainter p( &preview );
675 p.setRenderHint( QPainter::Antialiasing );
676 p.translate( 0.5, 0.5 );
680 p.setPen( QPen( Qt::gray ) );
681 p.drawLine( 0, 50, 100, 50 );
682 p.drawLine( 50, 0, 50, 100 );
687 if ( expressionContext )
696 poly << QPointF( 0, 50 ) << QPointF( 99, 50 );
697 static_cast<QgsLineSymbol *
>( this )->renderPolyline( poly,
nullptr, context );
702 polygon << QPointF( 20, 20 ) << QPointF( 80, 20 ) << QPointF( 80, 80 ) << QPointF( 20, 80 ) << QPointF( 20, 20 );
703 static_cast<QgsFillSymbol *
>( this )->renderPolygon( polygon,
nullptr,
nullptr, context );
707 static_cast<QgsMarkerSymbol *
>( this )->renderPoint( QPointF( 50, 50 ),
nullptr, context );
721 t = QStringLiteral(
"MARKER" );
724 t = QStringLiteral(
"LINE" );
727 t = QStringLiteral(
"FILL" );
730 Q_ASSERT(
false &&
"unknown symbol type" );
734 for ( QgsSymbolLayerList::const_iterator it =
mLayers.begin(); it !=
mLayers.end(); ++it )
743 props[ QStringLiteral(
"alpha" )] = QString::number(
opacity() );
744 double scaleFactor = 1.0;
748 for ( QgsSymbolLayerList::const_iterator it =
mLayers.begin(); it !=
mLayers.end(); ++it )
750 ( *it )->toSld( doc, element, props );
757 for ( QgsSymbolLayerList::const_iterator it =
mLayers.begin(); it !=
mLayers.end(); ++it )
760 layer->setLocked( ( *it )->isLocked() );
761 layer->setRenderingPass( ( *it )->renderingPass() );
762 layer->setEnabled( ( *it )->enabled() );
778 if ( effect && effect->
enabled() )
781 generatorLayer->
render( context );
785 generatorLayer->
render( context );
795 QgsSymbolLayerList::const_iterator sIt =
mLayers.constBegin();
796 for ( ; sIt !=
mLayers.constEnd(); ++sIt )
800 attributes.unite( ( *sIt )->usedAttributes( context ) );
808 mDataDefinedProperties.
setProperty( key, property );
818 if (
layer->hasDataDefinedProperties() )
828 if (
layer->canCauseArtifactsBetweenAdjacentTiles() )
853 class ExpressionContextScopePopper
857 ExpressionContextScopePopper() =
default;
859 ~ExpressionContextScopePopper()
871 class GeometryRestorer
875 : mContext( context ),
876 mGeometry( context.geometry() )
881 mContext.setGeometry( mGeometry );
901 GeometryRestorer geomRestorer( context );
903 bool usingSegmentizedGeometry =
false;
911 if ( std::isfinite( boundsOrigin.x() ) && std::isfinite( boundsOrigin.y() ) )
928 clippingEnabled =
false;
933 mSymbolRenderContext->setGeometryPartNum( 1 );
936 ExpressionContextScopePopper scopePopper;
937 if ( mSymbolRenderContext->expressionContextScope() )
939 if ( needsExpressionContext )
966 const QgsPoint *originalGeometry =
nullptr;
968 QVector< PointInfo > pointsToRender;
972 QPolygonF renderLine;
973 const QgsCurve *originalGeometry =
nullptr;
975 QVector< LineInfo > linesToRender;
979 QPolygonF renderExterior;
980 QVector< QPolygonF > renderRings;
983 QVector< PolygonInfo > polygonsToRender;
986 getPartGeometry = [&pointsToRender, &linesToRender, &polygonsToRender, &getPartGeometry, &context, &clippingEnabled, &markers, &feature, &usingSegmentizedGeometry,
this](
const QgsAbstractGeometry * part )
997 const bool isMultiPart = qgsgeometry_cast< const QgsGeometryCollection * >( part ) && qgsgeometry_cast< const QgsGeometryCollection * >( part )->numGeometries() > 1;
1003 if ( needsSegmentizing )
1006 if ( !segmentizedPart )
1010 temporaryGeometryContainer.
set( segmentizedPart.release() );
1011 processedGeometry = temporaryGeometryContainer.
constGet();
1012 usingSegmentizedGeometry =
true;
1017 processedGeometry = part;
1027 std::unique_ptr< QgsAbstractGeometry > simplified( simplifier.
simplify( processedGeometry ) );
1030 temporaryGeometryContainer.
set( simplified.release() );
1031 processedGeometry = temporaryGeometryContainer.
constGet();
1046 temporaryGeometryContainer.
set( clippedGeom.release() );
1047 processedGeometry = temporaryGeometryContainer.
constGet();
1054 processedGeometry = part;
1057 if ( !processedGeometry )
1060 QgsDebugMsg( QStringLiteral(
"No processed geometry to render for part!" ) );
1070 QgsDebugMsgLevel( QStringLiteral(
"point can be drawn only with marker symbol!" ), 2 );
1075 info.originalGeometry = qgsgeometry_cast< const QgsPoint * >( part );
1076 info.renderPoint =
_getPoint( context, *info.originalGeometry );
1077 pointsToRender << info;
1085 QgsDebugMsgLevel( QStringLiteral(
"linestring can be drawn only with line symbol!" ), 2 );
1090 info.originalGeometry = qgsgeometry_cast<const QgsCurve *>( part );
1091 info.renderLine =
_getLineString( context, *qgsgeometry_cast<const QgsCurve *>( processedGeometry ), clippingEnabled );
1092 linesToRender << info;
1102 QgsDebugMsgLevel( QStringLiteral(
"polygon can be drawn only with fill symbol!" ), 2 );
1107 info.originalGeometry = qgsgeometry_cast<const QgsCurvePolygon *>( part );
1108 if ( !qgsgeometry_cast<const QgsPolygon *>( processedGeometry )->exteriorRing() )
1110 QgsDebugMsg( QStringLiteral(
"cannot render polygon with no exterior ring" ) );
1114 _getPolygon( info.renderExterior, info.renderRings, context, *qgsgeometry_cast<const QgsPolygon *>( processedGeometry ), clippingEnabled,
mForceRHR );
1115 polygonsToRender << info;
1121 const QgsMultiPoint *mp = qgsgeometry_cast< const QgsMultiPoint * >( part );
1129 const QgsGeometryCollection *geomCollection = qgsgeometry_cast<const QgsGeometryCollection *>( part );
1132 for (
unsigned int i = 0; i < num; ++i )
1137 getPartGeometry( geomCollection->
geometryN( i ) );
1147 QgsDebugMsgLevel( QStringLiteral(
"multi-polygon can be drawn only with fill symbol!" ), 2 );
1158 std::map<double, QList<unsigned int> > thisAreaToPartNum;
1159 for (
unsigned int i = 0; i < num; ++i )
1168 std::map<double, QList<unsigned int> >::const_reverse_iterator iter = thisAreaToPartNum.rbegin();
1169 for ( ; iter != thisAreaToPartNum.rend(); ++iter )
1171 const QList<unsigned int> &listPartIndex = iter->second;
1172 for (
int idx = 0; idx < listPartIndex.size(); ++idx )
1174 const unsigned i = listPartIndex[idx];
1175 getPartGeometry( geomCollection->
geometryN( i ) );
1182 QgsDebugMsg( QStringLiteral(
"feature %1: unsupported wkb type %2/%3 for rendering" )
1183 .arg( feature.
id() )
1185 .arg( part->wkbType(), 0, 16 ) );
1189 getPartGeometry( geom.
constGet() );
1192 std::vector< int > layers;
1195 layers.reserve(
mLayers.count() );
1196 for (
int i = 0; i <
mLayers.count(); ++i )
1197 layers.emplace_back( i );
1201 layers.emplace_back(
layer );
1206 if ( needsExpressionContext )
1209 for (
const int symbolLayerIndex : layers )
1215 if ( needsExpressionContext )
1224 int geometryPartNumber = 0;
1225 for (
const PointInfo &point : qgis::as_const( pointsToRender ) )
1230 mSymbolRenderContext->setGeometryPartNum( geometryPartNumber + 1 );
1231 if ( needsExpressionContext )
1234 static_cast<QgsMarkerSymbol *
>( this )->renderPoint( point.renderPoint, &feature, context, symbolLayerIndex, selected );
1235 geometryPartNumber++;
1243 if ( linesToRender.empty() )
1246 int geometryPartNumber = 0;
1247 for (
const LineInfo &line : qgis::as_const( linesToRender ) )
1252 mSymbolRenderContext->setGeometryPartNum( geometryPartNumber + 1 );
1253 if ( needsExpressionContext )
1257 static_cast<QgsLineSymbol *
>( this )->renderPolyline( line.renderLine, &feature, context, symbolLayerIndex, selected );
1258 geometryPartNumber++;
1265 int geometryPartNumber = 0;
1266 for (
const PolygonInfo &info : qgis::as_const( polygonsToRender ) )
1271 mSymbolRenderContext->setGeometryPartNum( geometryPartNumber + 1 );
1272 if ( needsExpressionContext )
1276 static_cast<QgsFillSymbol *
>( this )->renderPolygon( info.renderExterior, ( !info.renderRings.isEmpty() ? &info.renderRings : nullptr ), &feature, context, symbolLayerIndex, selected );
1277 geometryPartNumber++;
1295 markers.reserve( pointsToRender.size() );
1296 for (
const PointInfo &info : qgis::as_const( pointsToRender ) )
1300 const QRectF bounds =
static_cast<QgsMarkerSymbol *
>( this )->bounds( info.renderPoint, context, feature );
1309 context.
painter()->setPen( Qt::red );
1310 context.
painter()->setBrush( QColor( 255, 0, 0, 100 ) );
1311 context.
painter()->drawRect( bounds );
1315 if ( drawVertexMarker && !usingSegmentizedGeometry )
1317 markers.append( info.renderPoint );
1325 for (
const LineInfo &info : qgis::as_const( linesToRender ) )
1333 if ( drawVertexMarker && !usingSegmentizedGeometry )
1335 markers << info.renderLine;
1344 for (
const PolygonInfo &info : qgis::as_const( polygonsToRender ) )
1353 if ( drawVertexMarker && !usingSegmentizedGeometry )
1355 markers << info.renderExterior;
1357 for (
const QPolygonF &hole : info.renderRings )
1376 handler->handleRenderedFeature( feature, renderedBoundsGeom, featureContext );
1379 if ( drawVertexMarker )
1383 const auto constMarkers = markers;
1384 for ( QPointF marker : constMarkers )
1386 renderVertexMarker( marker, context, currentVertexMarkerType, currentVertexMarkerSize );
1401 x = vertexPoint.
x();
1402 y = vertexPoint.
y();
1411 renderVertexMarker( mapPoint, context, currentVertexMarkerType, currentVertexMarkerSize );
1419 return mSymbolRenderContext.get();
1428 void QgsSymbol::initPropertyDefinitions()
1430 if ( !sPropertyDefinitions.isEmpty() )
1433 QString origin = QStringLiteral(
"symbol" );
1454 const QList< QgsSymbolLayer * > layers =
mLayers;
1478 const QList< QgsSymbolLayer * > layers =
mLayers;
1493 : mRenderContext(
c )
1495 , mMapUnitScale( mapUnitScale )
1496 , mOpacity( opacity )
1497 , mSelected( selected )
1498 , mRenderHints( renderHints )
1501 , mGeometryPartCount( 0 )
1502 , mGeometryPartNum( 0 )
1536 return mExpressionContextScope.get();
1541 mExpressionContextScope.reset( contextScope );
1546 return mPatchShape.get();
1563 layers.append( sl );
1574 layers.append( sl );
1585 layers.append( sl );
1600 double origAngle =
angle();
1601 double angleDiff = symbolAngle - origAngle;
1602 const auto constMLayers =
mLayers;
1618 return markerLayer->
angle();
1625 const auto constMLayers =
mLayers;
1637 const double symbolRotation =
angle();
1666 const double symbolRotation =
angle();
1697 if ( !layerAngleDD || layerAngleDD != symbolDD )
1703 if ( !layerAngleDD || layerAngleDD != rotatedDD )
1713 double origSize =
size();
1715 const auto constMLayers =
mLayers;
1726 markerLayer->
setSize( markerLayer->
size() * s / origSize );
1730 markerLayer->
setOffset( QPointF( markerLayer->
offset().x() * s / origSize,
1731 markerLayer->
offset().y() * s / origSize ) );
1739 const auto constMLayers =
mLayers;
1745 double lsize = markerLayer->
size();
1746 if ( lsize > maxSize )
1762 maxSize = std::max( maxSize, layerSize );
1769 const auto constMLayers =
mLayers;
1785 const auto constMLayers =
mLayers;
1796 if ( unit != markerLayer->
sizeUnit() )
1807 const auto constMLayers =
mLayers;
1820 const auto constMLayers =
mLayers;
1834 const double symbolSize =
size();
1836 const auto constMLayers =
mLayers;
1862 markerLayer->
offset().x() / symbolSize,
1863 markerLayer->
offset().y() / symbolSize, property ) );
1871 const double symbolSize =
size();
1904 if ( !layerSizeDD || layerSizeDD != symbolDD )
1913 if ( !layerSizeDD || layerSizeDD != scaledDD )
1918 if ( layerOffsetDD && layerOffsetDD != scaledOffsetDD )
1927 const auto constMLayers =
mLayers;
1939 const auto constMLayers =
mLayers;
1954 static QPointF nullPoint( 0, 0 );
1960 if ( effect && effect->
enabled() )
1963 p->translate( point );
1964 p.setEffect( effect );
1965 layer->renderPoint( nullPoint, context );
1969 layer->renderPoint( point, context );
1981 if ( layerIdx != -1 )
1989 renderPointUsingLayer( markerLayer, point, symbolContext );
2009 renderPointUsingLayer( markerLayer, point, symbolContext );
2021 const auto constMLayers =
mLayers;
2027 if ( bound.isNull() )
2028 bound =
symbolLayer->bounds( point, symbolContext );
2030 bound = bound.united(
symbolLayer->bounds( point, symbolContext ) );
2062 double origWidth =
width();
2064 const auto constMLayers =
mLayers;
2089 const auto constLLayers =
mLayers;
2102 double maxWidth = 0;
2106 const auto constMLayers =
mLayers;
2113 if (
width > maxWidth )
2123 double maxWidth = 0;
2129 const double layerWidth = lineLayer->
width( context );
2130 maxWidth = std::max( maxWidth, layerWidth );
2137 const double symbolWidth =
width();
2139 const auto constMLayers =
mLayers;
2173 const double symbolWidth =
width();
2178 for ( QgsSymbolLayerList::const_iterator it =
mLayers.begin(); it !=
mLayers.end(); ++it )
2192 const auto constMLayers =
mLayers;
2204 if ( !layerWidthDD || layerWidthDD != symbolDD )
2213 if ( !layerWidthDD || layerWidthDD != scaledDD )
2218 if ( layerOffsetDD && layerOffsetDD != scaledOffsetDD )
2230 QPainter *renderPainter = context.
painter();
2236 if ( layerIdx != -1 )
2244 renderPolylineUsingLayer( lineLayer, points, symbolContext );
2252 const auto constMLayers =
mLayers;
2264 renderPolylineUsingLayer( lineLayer, points, symbolContext );
2281 if ( effect && effect->
enabled() )
2284 p->translate( points.boundingRect().topLeft() );
2285 p.setEffect( effect );
2286 layer->renderPolyline( points.translated( -points.boundingRect().topLeft() ), context );
2290 layer->renderPolyline( points, context );
2327 if ( layerIdx != -1 )
2333 renderPolygonUsingLayer(
symbolLayer, points, rings, symbolContext );
2340 const auto constMLayers =
mLayers;
2350 renderPolygonUsingLayer(
symbolLayer, points, rings, symbolContext );
2364 if ( effect && effect->
enabled() )
2366 QRectF bounds = polygonBounds( points, rings );
2367 QVector<QPolygonF> *translatedRings = translateRings( rings, -bounds.left(), -bounds.top() );
2370 p->translate( bounds.topLeft() );
2371 p.setEffect( effect );
2374 (
static_cast<QgsFillSymbolLayer *
>(
layer ) )->renderPolygon( points.translated( -bounds.topLeft() ), translatedRings, context );
2378 (
static_cast<QgsLineSymbolLayer *
>(
layer ) )->renderPolygonStroke( points.translated( -bounds.topLeft() ), translatedRings, context );
2380 delete translatedRings;
2395 QRectF QgsFillSymbol::polygonBounds(
const QPolygonF &points,
const QVector<QPolygonF> *rings )
const
2397 QRectF bounds = points.boundingRect();
2400 for (
auto it = rings->constBegin(); it != rings->constEnd(); ++it )
2402 bounds = bounds.united( ( *it ).boundingRect() );
2408 QVector<QPolygonF> *QgsFillSymbol::translateRings(
const QVector<QPolygonF> *rings,
double dx,
double dy )
const
2413 QVector<QPolygonF> *translatedRings =
new QVector<QPolygonF>;
2414 translatedRings->reserve( rings->size() );
2415 for (
auto it = rings->constBegin(); it != rings->constEnd(); ++it )
2417 translatedRings->append( ( *it ).translated( dx, dy ) );
2419 return translatedRings;
2437 const auto constMLayers =
mLayers;
Abstract base class for all geometries.
virtual QgsRectangle boundingBox() const =0
Returns the minimal bounding box for the geometry.
virtual int partCount() const =0
Returns count of parts contained in the geometry.
QgsWkbTypes::Type wkbType() const SIP_HOLDGIL
Returns the WKB type of the geometry.
virtual bool nextVertex(QgsVertexId &id, QgsPoint &vertex) const =0
Returns next vertex id and coordinates.
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.
static QgsColorSchemeRegistry * colorSchemeRegistry()
Returns the application's color scheme registry, used for managing color schemes.
static void trimPolygon(QPolygonF &pts, const QgsRectangle &clipRect)
static QPolygonF clippedLine(const QgsCurve &curve, const QgsRectangle &clipExtent)
Takes a linestring and clips it to clipExtent.
Custom exception class for Coordinate Reference System related exceptions.
Curve polygon geometry type.
const QgsCurve * interiorRing(int i) const SIP_HOLDGIL
Retrieves an interior ring from the curve polygon.
const QgsCurve * exteriorRing() const SIP_HOLDGIL
Returns the curve polygon's exterior ring.
int numInteriorRings() const SIP_HOLDGIL
Returns the number of interior rings contained with the curve polygon.
Abstract base class for curved geometry type.
virtual int numPoints() const =0
Returns the number of points in the curve.
Orientation orientation() const
Returns the curve's orientation, e.g.
virtual QPolygonF asQPolygonF() const
Returns a QPolygonF representing the points.
@ Clockwise
Clockwise orientation.
@ CounterClockwise
Counter-clockwise orientation.
A class to manager painter saving and restoring required for effect drawing.
Single scope for storing variables and functions for use within a QgsExpressionContext.
static QgsExpressionContextScope * updateSymbolScope(const QgsSymbol *symbol, QgsExpressionContextScope *symbolScope=nullptr)
Updates a symbol scope related to a QgsSymbol to an expression context.
static QList< QgsExpressionContextScope * > globalProjectLayerScopes(const QgsMapLayer *layer)
Creates a list of three scopes: global, layer's project and layer.
Expression contexts are used to encapsulate the parameters around which a QgsExpression should be eva...
static const QString EXPR_GEOMETRY_PART_COUNT
Inbuilt variable name for geometry part count variable.
void setOriginalValueVariable(const QVariant &value)
Sets the original value variable value for the context.
static const QString EXPR_GEOMETRY_PART_NUM
Inbuilt variable name for geometry part number variable.
void appendScope(QgsExpressionContextScope *scope)
Appends a scope to the end of the context.
void appendScopes(const QList< QgsExpressionContextScope * > &scopes)
Appends a list of scopes to the end of the context.
The feature class encapsulates a single feature including its id, geometry and a list of field/values...
Container of fields for a vector layer.
void setAngle(double angle)
A fill symbol type, for rendering Polygon and MultiPolygon geometries.
QgsFillSymbol(const QgsSymbolLayerList &layers=QgsSymbolLayerList())
Constructor for QgsFillSymbol, with the specified list of initial symbol layers.
static QgsFillSymbol * createSimple(const QVariantMap &properties)
Create a fill symbol with one symbol layer: SimpleFill with specified properties.
void setAngle(double angle)
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.
QgsFillSymbol * clone() const override
Returns a deep copy of this symbol.
int numGeometries() const SIP_HOLDGIL
Returns the number of geometries within the collection.
const QgsAbstractGeometry * geometryN(int n) const
Returns a const reference to a geometry from within the collection.
virtual void render(QgsSymbolRenderContext &context)
Will render this symbol layer using the context.
A geometry is the spatial representation of a feature.
const QgsAbstractGeometry * constGet() const SIP_HOLDGIL
Returns a non-modifiable (const) reference to the underlying abstract geometry primitive.
static QgsGeometry collectGeometry(const QVector< QgsGeometry > &geometries)
Creates a new multipart geometry from a list of QgsGeometry objects.
static QgsGeometry fromQPolygonF(const QPolygonF &polygon)
Construct geometry from a QPolygonF.
static QgsGeometry fromRect(const QgsRectangle &rect) SIP_HOLDGIL
Creates a new geometry from a QgsRectangle.
QgsWkbTypes::GeometryType type
void set(QgsAbstractGeometry *geometry)
Sets the underlying geometry store.
bool isEmpty() const
Returns true if the geometry is empty (eg a linestring with no vertices, or a collection with no geom...
QgsRectangle boundingBox() const
Returns the bounding box of the geometry.
Does vector analysis using the geos library and handles import, export, exception handling*.
Represents a patch shape for use in map legends.
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...
virtual void setWidth(double width)
Sets the width of the line 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.
void setWidthUnit(QgsUnitTypes::RenderUnit unit)
Sets the units for the line's width.
void setOffset(double offset)
Sets the line's offset.
virtual double width() const
Returns the estimated width for the line symbol layer.
double offset() const
Returns the line's offset.
A line symbol type, for rendering LineString and MultiLineString geometries.
QgsLineSymbol * clone() const override
Returns a deep copy of this symbol.
void setWidthUnit(QgsUnitTypes::RenderUnit unit)
Sets the width units for the whole symbol (including all symbol layers).
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.
double width() const
Returns the estimated width for the whole symbol, which is the maximum width of all marker symbol lay...
static QgsLineSymbol * createSimple(const QVariantMap &properties)
Create a line symbol with one symbol layer: SimpleLine with specified properties.
QgsLineSymbol(const QgsSymbolLayerList &layers=QgsSymbolLayerList())
Constructor for QgsLineSymbol, with the specified list of initial symbol layers.
void setWidth(double width)
Sets the width for the whole line symbol.
void setDataDefinedWidth(const QgsProperty &property)
Set data defined width for whole symbol (including all symbol layers).
QgsProperty dataDefinedWidth() const
Returns data defined width for whole symbol (including all symbol layers).
Implementation of GeometrySimplifier using the "MapToPixel" algorithm.
SimplifyAlgorithm
Types of simplification algorithms that can be used.
QgsGeometry simplify(const QgsGeometry &geometry) const override
Returns a simplified version the specified geometry.
Perform transforms between map coordinates and device coordinates.
void transformInPlace(double &x, double &y) const
Transforms device coordinates to map coordinates.
Struct for storing maximum and minimum scales for measurements in map units.
Abstract base class for marker symbol layers.
virtual void setSize(double size)
Sets the symbol size.
QgsSymbol::ScaleMethod scaleMethod() const
Returns the method to use for scaling the marker's size.
QPointF offset() const
Returns the marker's offset, which is the horizontal and vertical displacement which the rendered mar...
void setAngle(double angle)
Sets the rotation angle for the marker.
QgsUnitTypes::RenderUnit sizeUnit() const
Returns the units for the symbol's size.
void setSizeUnit(QgsUnitTypes::RenderUnit unit)
Sets the units for the symbol's size.
void setOffset(QPointF offset)
Sets the marker's offset, which is the horizontal and vertical displacement which the rendered marker...
void setSizeMapUnitScale(const QgsMapUnitScale &scale)
Sets the map unit scale for the symbol's size.
void setLineAngle(double lineAngle)
Sets the line angle modification for the symbol's angle.
double size() const
Returns the symbol size.
const QgsMapUnitScale & sizeMapUnitScale() const
Returns the map unit scale for the symbol's size.
void setScaleMethod(QgsSymbol::ScaleMethod scaleMethod)
Sets the method to use for scaling the marker's size.
double angle() const
Returns the rotation angle for the marker, in degrees clockwise from north.
A marker symbol type, for rendering Point and MultiPoint geometries.
QgsUnitTypes::RenderUnit sizeUnit() const
Returns the size units for the whole symbol (including all symbol layers).
static QgsMarkerSymbol * createSimple(const QVariantMap &properties)
Create a marker symbol with one symbol layer: SimpleMarker with specified properties.
QgsProperty dataDefinedAngle() const
Returns data defined angle for whole symbol (including all symbol layers).
void setSize(double size)
Sets the size for the whole symbol.
void setLineAngle(double lineAngle)
Sets the line angle modification for the symbol's angle.
QgsMarkerSymbol(const QgsSymbolLayerList &layers=QgsSymbolLayerList())
Constructor for QgsMarkerSymbol, with the specified list of initial symbol layers.
void setSizeUnit(QgsUnitTypes::RenderUnit unit)
Sets the size units for the whole symbol (including all symbol layers).
void setScaleMethod(QgsSymbol::ScaleMethod scaleMethod)
double size() const
Returns the estimated size for the whole symbol, which is the maximum size of all marker symbol layer...
double angle() const
Returns the marker angle for the whole symbol.
QgsMapUnitScale sizeMapUnitScale() const
Returns the size map unit scale for the whole symbol.
void setDataDefinedSize(const QgsProperty &property)
Set data defined size for whole symbol (including all symbol layers).
ScaleMethod scaleMethod()
void setSizeMapUnitScale(const QgsMapUnitScale &scale)
Sets the size map unit scale for the whole symbol (including all symbol layers).
QgsProperty dataDefinedSize() const
Returns data defined size for whole symbol (including all symbol layers).
void setAngle(double symbolAngle)
Sets the angle for the whole symbol.
QgsMarkerSymbol * clone() const override
Returns a deep copy of this symbol.
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 setDataDefinedAngle(const QgsProperty &property)
Set data defined angle for whole symbol (including all symbol layers).
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...
Multi point geometry collection.
Base class for visual effects which can be applied to QPicture drawings.
bool enabled() const
Returns whether the effect is enabled.
Point geometry type, with support for z-dimension and m-values.
static QgsProject * instance()
Returns the QgsProject singleton instance.
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.
bool readBoolEntry(const QString &scope, const QString &key, bool def=false, bool *ok=nullptr) const
Reads a boolean from the specified scope and key.
double readDoubleEntry(const QString &scope, const QString &key, double def=0, bool *ok=nullptr) const
Reads a double from the specified scope and key.
QgsProperty property(int key) const override
Returns a matching property from the collection, if one exists.
void setProperty(int key, const QgsProperty &property)
Adds a property to the collection and takes ownership of it.
QSet< QString > referencedFields(const QgsExpressionContext &context=QgsExpressionContext(), bool ignoreContext=false) const override
Returns the set of any fields referenced by the active properties from the collection.
bool isActive(int key) const override
Returns true if the collection contains an active property with the specified key.
bool hasActiveProperties() const override
Returns true if the collection has any active properties, or false if all properties within the colle...
bool prepare(const QgsExpressionContext &context=QgsExpressionContext()) const override
Prepares the collection against a specified expression context.
Definition for a property.
A store for object properties.
QString asExpression() const
Returns an expression string representing the state of the property, or an empty string if the proper...
static QgsProperty fromExpression(const QString &expression, bool isActive=true)
Returns a new ExpressionBasedProperty created from the specified expression.
A rectangle specified with double values.
bool contains(const QgsRectangle &rect) const
Returns true when rectangle contains other rectangle.
double yMaximum() const SIP_HOLDGIL
Returns the y maximum value (top side of rectangle).
double xMaximum() const SIP_HOLDGIL
Returns the x maximum value (right side of rectangle).
double xMinimum() const SIP_HOLDGIL
Returns the x minimum value (left side of rectangle).
double yMinimum() const SIP_HOLDGIL
Returns the y minimum value (bottom side of rectangle).
bool isNull() const
Test if the rectangle is null (all coordinates zero or after call to setMinimal()).
double height() const SIP_HOLDGIL
Returns the height of the rectangle.
double width() const SIP_HOLDGIL
Returns the width of the rectangle.
Contains information about the context of a rendering operation.
void setForceVectorOutput(bool force)
Sets whether rendering operations should use vector operations instead of any faster raster shortcuts...
void setTextureOrigin(const QPointF &origin)
Sets the texture origin, which should be used as a brush transform when rendering using QBrush object...
bool hasRenderedFeatureHandlers() const
Returns true if the context has any rendered feature handlers.
double segmentationTolerance() const
Gets the segmentation tolerance applied when rendering curved geometries.
QPainter * painter()
Returns the destination QPainter for the render operation.
QgsExpressionContext & expressionContext()
Gets the expression context.
const QgsMapToPixel & mapToPixel() const
Returns the context's map to pixel transform, which transforms between map coordinates and device coo...
void setFlag(Flag flag, bool on=true)
Enable or disable a particular flag (other flags are not affected)
void setGeometry(const QgsAbstractGeometry *geometry)
Sets pointer to original (unsegmentized) geometry.
QgsGeometry featureClipGeometry() const
Returns the geometry to use to clip features at render time.
bool forceVectorOutput() const
Returns true if rendering operations should use vector operations instead of any faster raster shortc...
void setIsGuiPreview(bool preview)
Sets GUI preview mode.
QgsRectangle mapExtent() const
Returns the original extent of the map being rendered.
QList< QgsRenderedFeatureHandlerInterface * > renderedFeatureHandlers() const
Returns the list of rendered feature handlers to use while rendering map layers.
@ DrawSymbolBounds
Draw bounds of symbols (for debugging/testing)
@ RenderMapTile
Draw map such that there are no problems between adjacent tiles.
@ RenderSymbolPreview
The render is for a symbol preview only and map based properties may not be available,...
@ ApplyClipAfterReprojection
Feature geometry clipping to mapExtent() must be performed after the geometries are transformed using...
Flags flags() const
Returns combination of flags used for rendering.
void setPainter(QPainter *p)
Sets the destination QPainter for the render operation.
bool isSymbolLayerEnabled(const QgsSymbolLayer *layer) const
When rendering a map layer in a second pass (for selective masking), some symbol layers may be disabl...
bool renderingStopped() const
Returns true if the rendering operation has been stopped and any ongoing rendering should be canceled...
static QgsRenderContext fromQPainter(QPainter *painter)
Creates a default render context given a pixel based QPainter destination.
void setExpressionContext(const QgsExpressionContext &context)
Sets the expression context.
double convertToPainterUnits(double size, QgsUnitTypes::RenderUnit unit, const QgsMapUnitScale &scale=QgsMapUnitScale()) const
Converts a size from the specified units to painter units (pixels).
bool testFlag(Flag flag) const
Check whether a particular flag is enabled.
QgsCoordinateTransform coordinateTransform() const
Returns the current coordinate transform for the context.
const QgsRectangle & extent() const
When rendering a map layer, calling this method returns the "clipping" extent for the layer (in the l...
QgsAbstractGeometry::SegmentationToleranceType segmentationToleranceType() const
Gets segmentation tolerance type (maximum angle or maximum difference between curve and approximation...
const QgsVectorSimplifyMethod & vectorSimplifyMethod() const
Returns the simplification settings to use when rendering vector layers.
An interface for classes which provider custom handlers for features rendered as part of a map render...
static QgsSymbolLayer * create(const QVariantMap &properties=QVariantMap())
Creates a new QgsSimpleFillSymbolLayer using the specified properties map containing symbol propertie...
A simple line symbol layer, which renders lines using a line in a variety of styles (e....
static QgsSymbolLayer * create(const QVariantMap &properties=QVariantMap())
Creates a new QgsSimpleLineSymbolLayer, using the settings serialized in the properties map (correspo...
Simple marker symbol layer, consisting of a rendered shape with solid fill color and an stroke.
static QgsSymbolLayer * create(const QVariantMap &properties=QVariantMap())
Creates a new QgsSimpleMarkerSymbolLayer.
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 (...
static QgsStyle * defaultStyle()
Returns default application-wide style.
static QString encodeSldUom(QgsUnitTypes::RenderUnit unit, double *scaleFactor)
Encodes a render unit into an SLD unit of measure string.
static QString encodeColor(const QColor &color)
VertexMarkerType
Editing vertex markers.
static void drawVertexMarker(double x, double y, QPainter &p, QgsSymbolLayerUtils::VertexMarkerType type, int markerSize)
Draws a vertex symbol at (painter) coordinates x, y.
@ PropertyAngle
Symbol angle.
@ PropertySize
Symbol size.
@ PropertyOffset
Symbol offset.
@ PropertyStrokeWidth
Stroke width.
@ PropertyLayerEnabled
Whether symbol layer is enabled.
virtual void startFeatureRender(const QgsFeature &feature, QgsRenderContext &context)
Called before the layer will be rendered for a particular feature.
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.
bool enabled() const
Returns true if symbol layer is enabled and will be drawn.
virtual void stopRender(QgsSymbolRenderContext &context)=0
Called after a set of rendering operations has finished on the supplied render context.
virtual void setDataDefinedProperty(Property key, const QgsProperty &property)
Sets a data defined property for the layer.
QgsSymbol::SymbolType type() const
virtual void stopFeatureRender(const QgsFeature &feature, QgsRenderContext &context)
Called after the layer has been rendered for a particular feature.
QgsPropertyCollection & dataDefinedProperties()
Returns a reference to the symbol layer's property collection, used for data defined overrides.
~QgsSymbolRenderContext()
void setExpressionContextScope(QgsExpressionContextScope *contextScope)
Set an expression scope for this symbol.
void setSelected(bool selected)
Sets whether symbols should be rendered using the selected symbol coloring and style.
QgsSymbolRenderContext & operator=(const QgsSymbolRenderContext &)
Q_DECL_DEPRECATED double outputLineWidth(double width) const
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.
QgsRenderContext & renderContext()
Returns a reference to the context's render context.
Q_DECL_DEPRECATED double outputPixelSize(double size) const
void setGeometryPartCount(int count)
Sets the part count of current geometry.
void setOriginalValueVariable(const QVariant &value)
Sets the original value variable value for data defined symbology.
void setPatchShape(const QgsLegendPatchShape &shape)
Sets the symbol patch shape, to use if rendering symbol preview icons.
void setGeometryPartNum(int num)
Sets the part number of current geometry.
void setOriginalGeometryType(QgsWkbTypes::GeometryType type)
Sets the geometry type for the original feature geometry being rendered.
QgsExpressionContextScope * expressionContextScope()
This scope is always available when a symbol of this type is being rendered.
const QgsLegendPatchShape * patchShape() const
Returns the symbol patch shape, to use if rendering symbol preview icons.
Abstract base class for all rendered symbols.
void setDataDefinedProperties(const QgsPropertyCollection &collection)
Sets the symbol's property collection, used for data defined overrides.
QgsSymbolLayerList cloneLayers() const
Retrieve a cloned list of all layers that make up this symbol.
QgsSymbolRenderContext * symbolRenderContext()
Returns the symbol render context.
QgsSymbolLayer * symbolLayer(int layer)
Returns the symbol layer at the specified index.
Property
Data definable properties.
@ PropertyOpacity
Opacity.
void setDataDefinedProperty(Property key, const QgsProperty &property)
Sets a data defined property for the symbol.
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 stopRender(QgsRenderContext &context)
Ends the rendering process.
qreal mOpacity
Symbol opacity (in the range 0 - 1)
Q_DECL_DEPRECATED const QgsVectorLayer * mLayer
void setOutputUnit(QgsUnitTypes::RenderUnit unit)
Sets the units to use for sizes and widths within the symbol.
QImage bigSymbolPreviewImage(QgsExpressionContext *expressionContext=nullptr, QgsSymbol::PreviewFlags flags=QgsSymbol::FlagIncludeCrosshairsForMarkerSymbols)
Returns a large (roughly 100x100 pixel) preview image for the 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 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.
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.
static QPointF _getPoint(QgsRenderContext &context, const QgsPoint &point)
Creates a point in screen coordinates from a QgsPoint in map coordinates.
static const QgsPropertiesDefinition & propertyDefinitions()
Returns the symbol property definitions.
bool appendSymbolLayer(QgsSymbolLayer *layer)
Appends a symbol layer at the end of the current symbol layer list.
static QgsSymbol * defaultSymbol(QgsWkbTypes::GeometryType geomType)
Returns a new default symbol for the specified geometry type.
bool mClipFeaturesToExtent
bool usesMapUnits() const
Returns true if the symbol has any components which use map unit based sizes.
QgsUnitTypes::RenderUnit outputUnit() const
Returns the units to use for sizes and widths within the symbol.
void toSld(QDomDocument &doc, QDomElement &element, QVariantMap props) const
Converts the symbol to a SLD representation.
bool insertSymbolLayer(int index, QgsSymbolLayer *layer)
Inserts a symbol layer to specified index.
QgsMapUnitScale mapUnitScale() const
Returns the map unit scale for the symbol.
SymbolType type() const
Returns the symbol's type.
qreal opacity() const
Returns the opacity for the symbol.
bool canCauseArtifactsBetweenAdjacentTiles() const
Returns true if the symbol rendering can cause visible artifacts across a single feature when the fea...
bool clipFeaturesToExtent() const
Returns whether features drawn by the symbol will be clipped to the render context's extent.
QImage asImage(QSize size, QgsRenderContext *customContext=nullptr)
Returns an image of the symbol at the specified size.
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.
QString dump() const
Returns a string dump of the symbol's properties.
bool hasDataDefinedProperties() const
Returns whether the symbol utilizes any data defined properties.
bool deleteSymbolLayer(int index)
Removes and deletes the symbol layer at the specified index.
QSet< QString > usedAttributes(const QgsRenderContext &context) const
Returns a list of attributes required to render this feature.
void setColor(const QColor &color)
Sets the color for the symbol.
bool changeSymbolLayer(int index, QgsSymbolLayer *layer)
Deletes the current layer at the specified index and replaces it with layer.
QgsPropertyCollection & dataDefinedProperties()
Returns a reference to the symbol's property collection, used for data defined overrides.
SymbolType
Type of the symbol.
void setOpacity(qreal opacity)
Sets the opacity for the symbol.
QgsSymbolLayer * takeSymbolLayer(int index)
Removes a symbol layer from the list and returns a pointer to it.
void setMapUnitScale(const QgsMapUnitScale &scale)
Sets the map unit scale for the symbol.
QgsSymbolLayerList mLayers
Q_DECL_DEPRECATED const QgsVectorLayer * layer() const
void renderUsingLayer(QgsSymbolLayer *layer, QgsSymbolRenderContext &context)
Renders a context using a particular symbol layer without passing in a geometry.
QColor color() const
Returns the symbol's color.
void startRender(QgsRenderContext &context, const QgsFields &fields=QgsFields())
Begins the rendering process for the symbol.
Q_DECL_DEPRECATED void setLayer(const QgsVectorLayer *layer)
void renderVertexMarker(QPointF pt, QgsRenderContext &context, int currentVertexMarkerType, double currentVertexMarkerSize)
Render editing vertex marker at specified point.
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.
void setClipFeaturesToExtent(bool clipFeaturesToExtent)
Sets whether features drawn by the symbol should be clipped to the render context's extent.
void setForceRHR(bool force)
Sets whether polygon features drawn by the symbol should be reoriented to follow the standard right-h...
QgsSymbol(SymbolType type, const QgsSymbolLayerList &layers)
RenderUnit
Rendering size units.
@ RenderUnknownUnit
Mixed or unknown units.
@ RenderMillimeters
Millimeters.
Represents a vector layer which manages a vector based data sets.
QgsVectorLayer * clone() const override
Returns a new instance equivalent to this one.
double tolerance() const
Gets the tolerance of simplification in map units. Represents the maximum distance in map units betwe...
bool forceLocalOptimization() const
Gets where the simplification executes, after fetch the geometries from provider, or when supported,...
SimplifyHints simplifyHints() const
Gets the simplification hints of the vector layer managed.
SimplifyAlgorithm simplifyAlgorithm() const
Gets the local simplification algorithm of the vector layer managed.
GeometryType
The geometry types are used to group QgsWkbTypes::Type in a coarse way.
static QString displayString(Type type) SIP_HOLDGIL
Returns a non-translated display string type for a WKB type, e.g., the geometry name used in WKT geom...
static bool isCurvedType(Type type) SIP_HOLDGIL
Returns true if the WKB type is a curved type or can contain curved geometries.
static Type flatType(Type type) SIP_HOLDGIL
Returns the flat type for a WKB type.
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)
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
#define Q_NOWARN_DEPRECATED_POP
QString qgsDoubleToString(double a, int precision=17)
Returns a string representation of a double.
#define Q_NOWARN_DEPRECATED_PUSH
bool qgsDoubleNear(double a, double b, double epsilon=4 *std::numeric_limits< double >::epsilon())
Compare two doubles (but allow some difference)
#define QgsDebugMsgLevel(str, level)
QMap< int, QgsPropertyDefinition > QgsPropertiesDefinition
Definition of available properties.
QgsProperty scaleWholeSymbol(double scaleFactor, const QgsProperty &property)
QgsProperty rotateWholeSymbol(double additionalRotation, const QgsProperty &property)
QList< QgsSymbolLayer * > QgsSymbolLayerList
#define DEFAULT_SCALE_METHOD
Single variable definition for use within a QgsExpressionContextScope.
Utility class for identifying a unique vertex within a geometry.