QGIS API Documentation  3.14.0-Pi (9f7028fd23)
qgssymbollayer.cpp
Go to the documentation of this file.
1 /***************************************************************************
2  qgssymbollayer.cpp
3  ---------------------
4  begin : November 2009
5  copyright : (C) 2009 by Martin Dobias
6  email : wonder dot sk at gmail dot com
7  ***************************************************************************
8  * *
9  * This program is free software; you can redistribute it and/or modify *
10  * it under the terms of the GNU General Public License as published by *
11  * the Free Software Foundation; either version 2 of the License, or *
12  * (at your option) any later version. *
13  * *
14  ***************************************************************************/
15 
16 #include "qgssymbollayer.h"
17 #include "qgsclipper.h"
18 #include "qgsexpression.h"
19 #include "qgsrendercontext.h"
20 #include "qgsvectorlayer.h"
21 #include "qgsdxfexport.h"
22 #include "qgsgeometrysimplifier.h"
23 #include "qgspainteffect.h"
24 #include "qgseffectstack.h"
25 #include "qgspainteffectregistry.h"
26 #include "qgsproperty.h"
27 #include "qgsexpressioncontext.h"
28 #include "qgssymbollayerutils.h"
29 #include "qgsapplication.h"
30 #include "qgsmultipoint.h"
31 #include "qgslegendpatchshape.h"
32 #include "qgsstyle.h"
33 
34 #include <QSize>
35 #include <QPainter>
36 #include <QPointF>
37 #include <QPolygonF>
38 
39 QgsPropertiesDefinition QgsSymbolLayer::sPropertyDefinitions;
40 
41 void QgsSymbolLayer::initPropertyDefinitions()
42 {
43  if ( !sPropertyDefinitions.isEmpty() )
44  return;
45 
46  QString origin = QStringLiteral( "symbol" );
47 
48  sPropertyDefinitions = QgsPropertiesDefinition
49  {
50  { QgsSymbolLayer::PropertySize, QgsPropertyDefinition( "size", QObject::tr( "Symbol size" ), QgsPropertyDefinition::Size, origin ) },
51  { QgsSymbolLayer::PropertyAngle, QgsPropertyDefinition( "angle", QObject::tr( "Rotation angle" ), QgsPropertyDefinition::Rotation, origin ) },
52  { QgsSymbolLayer::PropertyName, QgsPropertyDefinition( "name", QObject::tr( "Symbol name" ), QgsPropertyDefinition::String, origin ) },
53  { QgsSymbolLayer::PropertyFillColor, QgsPropertyDefinition( "fillColor", QObject::tr( "Symbol fill color" ), QgsPropertyDefinition::ColorWithAlpha, origin ) },
54  { QgsSymbolLayer::PropertyStrokeColor, QgsPropertyDefinition( "outlineColor", QObject::tr( "Symbol stroke color" ), QgsPropertyDefinition::ColorWithAlpha, origin ) },
55  { QgsSymbolLayer::PropertyStrokeWidth, QgsPropertyDefinition( "outlineWidth", QObject::tr( "Symbol stroke width" ), QgsPropertyDefinition::StrokeWidth, origin ) },
56  { QgsSymbolLayer::PropertyStrokeStyle, QgsPropertyDefinition( "outlineStyle", QObject::tr( "Symbol stroke style" ), QgsPropertyDefinition::LineStyle, origin )},
57  { QgsSymbolLayer::PropertyOffset, QgsPropertyDefinition( "offset", QObject::tr( "Symbol offset" ), QgsPropertyDefinition::Offset, origin )},
58  { QgsSymbolLayer::PropertyCharacter, QgsPropertyDefinition( "char", QObject::tr( "Marker character(s)" ), QgsPropertyDefinition::String, origin )},
59  { QgsSymbolLayer::PropertyFontFamily, QgsPropertyDefinition( "fontFamily", QObject::tr( "Font family" ), QgsPropertyDefinition::String, origin )},
60  { QgsSymbolLayer::PropertyFontStyle, QgsPropertyDefinition( "fontStyle", QObject::tr( "Font style" ), QgsPropertyDefinition::String, origin )},
61  { QgsSymbolLayer::PropertyWidth, QgsPropertyDefinition( "width", QObject::tr( "Symbol width" ), QgsPropertyDefinition::DoublePositive, origin )},
62  { QgsSymbolLayer::PropertyHeight, QgsPropertyDefinition( "height", QObject::tr( "Symbol height" ), QgsPropertyDefinition::DoublePositive, origin )},
63  { QgsSymbolLayer::PropertyPreserveAspectRatio, QgsPropertyDefinition( "preserveAspectRatio", QObject::tr( "Preserve aspect ratio between width and height" ), QgsPropertyDefinition::Boolean, origin )},
64  { QgsSymbolLayer::PropertyFillStyle, QgsPropertyDefinition( "fillStyle", QObject::tr( "Symbol fill style" ), QgsPropertyDefinition::FillStyle, origin )},
65  { QgsSymbolLayer::PropertyJoinStyle, QgsPropertyDefinition( "joinStyle", QObject::tr( "Outline join style" ), QgsPropertyDefinition::PenJoinStyle, origin )},
66  { QgsSymbolLayer::PropertySecondaryColor, QgsPropertyDefinition( "color2", QObject::tr( "Secondary fill color" ), QgsPropertyDefinition::ColorWithAlpha, origin )},
67  { QgsSymbolLayer::PropertyLineAngle, QgsPropertyDefinition( "lineAngle", QObject::tr( "Angle for line fills" ), QgsPropertyDefinition::Rotation, origin )},
68  { QgsSymbolLayer::PropertyGradientType, QgsPropertyDefinition( "gradientType", QgsPropertyDefinition::DataTypeString, QObject::tr( "Gradient type" ), QObject::tr( "string " ) + QLatin1String( "[<b>linear</b>|<b>radial</b>|<b>conical</b>]" ), origin )},
69  { QgsSymbolLayer::PropertyCoordinateMode, QgsPropertyDefinition( "gradientMode", QgsPropertyDefinition::DataTypeString, QObject::tr( "Gradient mode" ), QObject::tr( "string " ) + QLatin1String( "[<b>feature</b>|<b>viewport</b>]" ), origin )},
70  { QgsSymbolLayer::PropertyGradientSpread, QgsPropertyDefinition( "gradientSpread", QgsPropertyDefinition::DataTypeString, QObject::tr( "Gradient spread" ), QObject::tr( "string " ) + QLatin1String( "[<b>pad</b>|<b>repeat</b>|<b>reflect</b>]" ), origin )},
71  { QgsSymbolLayer::PropertyGradientReference1X, QgsPropertyDefinition( "gradientRef1X", QObject::tr( "Reference point 1 (X)" ), QgsPropertyDefinition::Double0To1, origin )},
72  { QgsSymbolLayer::PropertyGradientReference1Y, QgsPropertyDefinition( "gradientRef1Y", QObject::tr( "Reference point 1 (Y)" ), QgsPropertyDefinition::Double0To1, origin )},
73  { QgsSymbolLayer::PropertyGradientReference2X, QgsPropertyDefinition( "gradientRef2X", QObject::tr( "Reference point 2 (X)" ), QgsPropertyDefinition::Double0To1, origin )},
74  { QgsSymbolLayer::PropertyGradientReference2Y, QgsPropertyDefinition( "gradientRef2Y", QObject::tr( "Reference point 2 (Y)" ), QgsPropertyDefinition::Double0To1, origin )},
75  { QgsSymbolLayer::PropertyGradientReference1IsCentroid, QgsPropertyDefinition( "gradientRef1Centroid", QObject::tr( "Reference point 1 follows feature centroid" ), QgsPropertyDefinition::Boolean, origin )},
76  { QgsSymbolLayer::PropertyGradientReference2IsCentroid, QgsPropertyDefinition( "gradientRef2Centroid", QObject::tr( "Reference point 2 follows feature centroid" ), QgsPropertyDefinition::Boolean, origin )},
77  { QgsSymbolLayer::PropertyBlurRadius, QgsPropertyDefinition( "blurRadius", QgsPropertyDefinition::DataTypeNumeric, QObject::tr( "Blur radius" ), QObject::tr( "Integer between 0 and 18" ), origin )},
78  { QgsSymbolLayer::PropertyLineDistance, QgsPropertyDefinition( "lineDistance", QObject::tr( "Distance between lines" ), QgsPropertyDefinition::DoublePositive, origin )},
79  { QgsSymbolLayer::PropertyShapeburstUseWholeShape, QgsPropertyDefinition( "shapeburstWholeShape", QObject::tr( "Shade whole shape" ), QgsPropertyDefinition::Boolean, origin )},
80  { QgsSymbolLayer::PropertyShapeburstMaxDistance, QgsPropertyDefinition( "shapeburstMaxDist", QObject::tr( "Maximum distance for shapeburst fill" ), QgsPropertyDefinition::DoublePositive, origin )},
81  { QgsSymbolLayer::PropertyShapeburstIgnoreRings, QgsPropertyDefinition( "shapeburstIgnoreRings", QObject::tr( "Ignore rings in feature" ), QgsPropertyDefinition::Boolean, origin )},
82  { QgsSymbolLayer::PropertyFile, QgsPropertyDefinition( "file", QObject::tr( "Symbol file path" ), QgsPropertyDefinition::String, origin )},
83  { QgsSymbolLayer::PropertyDistanceX, QgsPropertyDefinition( "distanceX", QObject::tr( "Horizontal distance between markers" ), QgsPropertyDefinition::DoublePositive, origin )},
84  { QgsSymbolLayer::PropertyDistanceY, QgsPropertyDefinition( "distanceY", QObject::tr( "Vertical distance between markers" ), QgsPropertyDefinition::DoublePositive, origin )},
85  { QgsSymbolLayer::PropertyDisplacementX, QgsPropertyDefinition( "displacementX", QObject::tr( "Horizontal displacement between rows" ), QgsPropertyDefinition::DoublePositive, origin )},
86  { QgsSymbolLayer::PropertyDisplacementY, QgsPropertyDefinition( "displacementY", QObject::tr( "Vertical displacement between columns" ), QgsPropertyDefinition::DoublePositive, origin )},
87  { QgsSymbolLayer::PropertyOffsetX, QgsPropertyDefinition( "offsetX", QObject::tr( "Horizontal offset" ), QgsPropertyDefinition::Double, origin )},
88  { QgsSymbolLayer::PropertyOffsetY, QgsPropertyDefinition( "offsetY", QObject::tr( "Vertical offset" ), QgsPropertyDefinition::Double, origin )},
89  { QgsSymbolLayer::PropertyOpacity, QgsPropertyDefinition( "alpha", QObject::tr( "Opacity" ), QgsPropertyDefinition::Opacity, origin )},
90  { QgsSymbolLayer::PropertyCustomDash, QgsPropertyDefinition( "customDash", QgsPropertyDefinition::DataTypeString, QObject::tr( "Custom dash pattern" ), QObject::tr( "[<b><dash>;<space></b>] e.g. '8;2;1;2'" ), origin )},
91  { QgsSymbolLayer::PropertyCapStyle, QgsPropertyDefinition( "capStyle", QObject::tr( "Line cap style" ), QgsPropertyDefinition::CapStyle, origin )},
92  { QgsSymbolLayer::PropertyPlacement, QgsPropertyDefinition( "placement", QgsPropertyDefinition::DataTypeString, QObject::tr( "Marker placement" ), QObject::tr( "string " ) + "[<b>interval</b>|<b>vertex</b>|<b>lastvertex</b>|<b>firstvertex</b>|<b>centerpoint</b>|<b>curvepoint</b>|<b>segmentcenter</b>]", origin )},
93  { QgsSymbolLayer::PropertyInterval, QgsPropertyDefinition( "interval", QObject::tr( "Marker interval" ), QgsPropertyDefinition::DoublePositive, origin )},
94  { QgsSymbolLayer::PropertyOffsetAlongLine, QgsPropertyDefinition( "offsetAlongLine", QObject::tr( "Offset along line" ), QgsPropertyDefinition::DoublePositive, origin )},
95  { QgsSymbolLayer::PropertyAverageAngleLength, QgsPropertyDefinition( "averageAngleLength", QObject::tr( "Average line angles over" ), QgsPropertyDefinition::DoublePositive, origin )},
96  { QgsSymbolLayer::PropertyHorizontalAnchor, QgsPropertyDefinition( "hAnchor", QObject::tr( "Horizontal anchor point" ), QgsPropertyDefinition::HorizontalAnchor, origin )},
97  { QgsSymbolLayer::PropertyVerticalAnchor, QgsPropertyDefinition( "vAnchor", QObject::tr( "Vertical anchor point" ), QgsPropertyDefinition::VerticalAnchor, origin )},
98  { QgsSymbolLayer::PropertyLayerEnabled, QgsPropertyDefinition( "enabled", QObject::tr( "Layer enabled" ), QgsPropertyDefinition::Boolean, origin )},
99  { QgsSymbolLayer::PropertyArrowWidth, QgsPropertyDefinition( "arrowWidth", QObject::tr( "Arrow line width" ), QgsPropertyDefinition::StrokeWidth, origin )},
100  { QgsSymbolLayer::PropertyArrowStartWidth, QgsPropertyDefinition( "arrowStartWidth", QObject::tr( "Arrow line start width" ), QgsPropertyDefinition::StrokeWidth, origin )},
101  { QgsSymbolLayer::PropertyArrowHeadLength, QgsPropertyDefinition( "arrowHeadLength", QObject::tr( "Arrow head length" ), QgsPropertyDefinition::DoublePositive, origin )},
102  { QgsSymbolLayer::PropertyArrowHeadThickness, QgsPropertyDefinition( "arrowHeadThickness", QObject::tr( "Arrow head thickness" ), QgsPropertyDefinition::DoublePositive, origin )},
103  { QgsSymbolLayer::PropertyArrowHeadType, QgsPropertyDefinition( "arrowHeadType", QgsPropertyDefinition::DataTypeString, QObject::tr( "Arrow head type" ), QObject::tr( "string " ) + QLatin1String( "[<b>single</b>|<b>reversed</b>|<b>double</b>]" ), origin )},
104  { QgsSymbolLayer::PropertyArrowType, QgsPropertyDefinition( "arrowType", QgsPropertyDefinition::DataTypeString, QObject::tr( "Arrow type" ), QObject::tr( "string " ) + QLatin1String( "[<b>plain</b>|<b>lefthalf</b>|<b>righthalf</b>]" ), origin )},
105  { QgsSymbolLayer::PropertyPointCount, QgsPropertyDefinition( "pointCount", QObject::tr( "Point count" ), QgsPropertyDefinition::IntegerPositive, origin )},
106  { QgsSymbolLayer::PropertyRandomSeed, QgsPropertyDefinition( "randomSeed", QgsPropertyDefinition::DataTypeNumeric, QObject::tr( "Random number seed" ), QObject::tr( "integer > 0, or 0 for completely random sequence" ), origin )},
107  { QgsSymbolLayer::PropertyClipPoints, QgsPropertyDefinition( "clipPoints", QObject::tr( "Clip markers" ), QgsPropertyDefinition::Boolean, origin )},
108  { QgsSymbolLayer::PropertyClipPoints, QgsPropertyDefinition( "densityArea", QObject::tr( "Density area" ), QgsPropertyDefinition::DoublePositive, origin )},
109  };
110 }
111 
113 {
114  dataDefinedProperties().setProperty( key, property );
115 }
116 
118 {
119 
120 }
121 
123 {
124 
125 }
126 
127 bool QgsSymbolLayer::writeDxf( QgsDxfExport &e, double mmMapUnitScaleFactor, const QString &layerName, QgsSymbolRenderContext &context, QPointF shift ) const
128 {
129  Q_UNUSED( e )
130  Q_UNUSED( mmMapUnitScaleFactor )
131  Q_UNUSED( layerName )
132  Q_UNUSED( context )
133  Q_UNUSED( shift )
134  return false;
135 }
136 
138 {
139  Q_UNUSED( e )
140  Q_UNUSED( context )
141  return 1.0;
142 }
143 
145 {
146  Q_UNUSED( e )
147  Q_UNUSED( context )
148  return 0.0;
149 }
150 
152 {
153  Q_UNUSED( context )
154  return color();
155 }
156 
158 {
159  Q_UNUSED( context )
160  return 0.0;
161 }
162 
164 {
165  Q_UNUSED( unit )
166  return QVector<qreal>();
167 }
168 
169 Qt::PenStyle QgsSymbolLayer::dxfPenStyle() const
170 {
171  return Qt::SolidLine;
172 }
173 
175 {
176  Q_UNUSED( context )
177  return color();
178 }
179 
180 Qt::BrushStyle QgsSymbolLayer::dxfBrushStyle() const
181 {
182  return Qt::NoBrush;
183 }
184 
186 {
187  return mPaintEffect.get();
188 }
189 
191 {
192  if ( effect == mPaintEffect.get() )
193  return;
194 
195  mPaintEffect.reset( effect );
196 }
197 
199  : mType( type )
200  , mLocked( locked )
201 {
202 }
203 
205 {
207 
208  if ( !context.fields().isEmpty() )
209  {
210  //QgsFields is implicitly shared, so it's cheap to make a copy
211  mFields = context.fields();
212  }
213 }
214 
216 {
218 }
219 
221 {
222  QgsSymbolLayer::initPropertyDefinitions();
223  return sPropertyDefinitions;
224 }
225 
227 
229 {
230  if ( symbol->type() == QgsSymbol::Fill && mType == QgsSymbol::Line )
231  return true;
232 
233  return symbol->type() == mType;
234 }
235 
236 void QgsSymbolLayer::setRenderingPass( int renderingPass )
237 {
239 }
240 
242 {
243  return mRenderingPass;
244 }
245 
246 QSet<QString> QgsSymbolLayer::usedAttributes( const QgsRenderContext &context ) const
247 {
248  QSet<QString> columns = mDataDefinedProperties.referencedFields( context.expressionContext() );
249  return columns;
250 }
251 
252 QgsProperty propertyFromMap( const QgsStringMap &map, const QString &baseName )
253 {
254  QString prefix;
255  if ( !baseName.isEmpty() )
256  {
257  prefix.append( QStringLiteral( "%1_dd_" ).arg( baseName ) );
258  }
259 
260  if ( !map.contains( QStringLiteral( "%1expression" ).arg( prefix ) ) )
261  {
262  //requires at least the expression value
263  return QgsProperty();
264  }
265 
266  bool active = ( map.value( QStringLiteral( "%1active" ).arg( prefix ), QStringLiteral( "1" ) ) != QLatin1String( "0" ) );
267  QString expression = map.value( QStringLiteral( "%1expression" ).arg( prefix ) );
268  bool useExpression = ( map.value( QStringLiteral( "%1useexpr" ).arg( prefix ), QStringLiteral( "1" ) ) != QLatin1String( "0" ) );
269  QString field = map.value( QStringLiteral( "%1field" ).arg( prefix ), QString() );
270 
271  if ( useExpression )
272  return QgsProperty::fromExpression( expression, active );
273  else
274  return QgsProperty::fromField( field, active );
275 }
276 
278 {
279  // property string to type upgrade map
280  static const QMap< QString, QgsSymbolLayer::Property > OLD_PROPS
281  {
283  { "arrow_width", QgsSymbolLayer::PropertyArrowWidth },
284  { "arrow_start_width", QgsSymbolLayer::PropertyArrowStartWidth },
285  { "head_length", QgsSymbolLayer::PropertyArrowHeadLength },
286  { "head_thickness", QgsSymbolLayer::PropertyArrowHeadThickness },
287  { "offset", QgsSymbolLayer::PropertyOffset },
288  { "head_type", QgsSymbolLayer::PropertyArrowHeadType },
289  { "arrow_type", QgsSymbolLayer::PropertyArrowType },
290  { "width_field", QgsSymbolLayer::PropertyWidth },
291  { "height_field", QgsSymbolLayer::PropertyHeight },
292  { "rotation_field", QgsSymbolLayer::PropertyAngle },
293  { "outline_width_field", QgsSymbolLayer::PropertyStrokeWidth },
294  { "fill_color_field", QgsSymbolLayer::PropertyFillColor },
295  { "outline_color_field", QgsSymbolLayer::PropertyStrokeColor },
296  { "symbol_name_field", QgsSymbolLayer::PropertyName },
297  { "outline_width", QgsSymbolLayer::PropertyStrokeWidth },
298  { "outline_style", QgsSymbolLayer::PropertyStrokeStyle },
299  { "join_style", QgsSymbolLayer::PropertyJoinStyle },
300  { "fill_color", QgsSymbolLayer::PropertyFillColor },
301  { "outline_color", QgsSymbolLayer::PropertyStrokeColor },
302  { "width", QgsSymbolLayer::PropertyWidth },
303  { "height", QgsSymbolLayer::PropertyHeight },
304  { "symbol_name", QgsSymbolLayer::PropertyName },
305  { "angle", QgsSymbolLayer::PropertyAngle },
306  { "fill_style", QgsSymbolLayer::PropertyFillStyle },
307  { "color_border", QgsSymbolLayer::PropertyStrokeColor },
308  { "width_border", QgsSymbolLayer::PropertyStrokeWidth },
309  { "border_color", QgsSymbolLayer::PropertyStrokeColor },
310  { "border_style", QgsSymbolLayer::PropertyStrokeStyle },
312  { "gradient_type", QgsSymbolLayer::PropertyGradientType },
313  { "coordinate_mode", QgsSymbolLayer::PropertyCoordinateMode },
319  { "reference1_iscentroid", QgsSymbolLayer::PropertyGradientReference1IsCentroid },
320  { "reference2_iscentroid", QgsSymbolLayer::PropertyGradientReference2IsCentroid },
321  { "blur_radius", QgsSymbolLayer::PropertyBlurRadius },
325  { "svgFillColor", QgsSymbolLayer::PropertyFillColor },
326  { "svgOutlineColor", QgsSymbolLayer::PropertyStrokeColor },
327  { "svgOutlineWidth", QgsSymbolLayer::PropertyStrokeWidth },
328  { "svgFile", QgsSymbolLayer::PropertyFile },
329  { "lineangle", QgsSymbolLayer::PropertyLineAngle },
330  { "distance", QgsSymbolLayer::PropertyLineDistance },
331  { "distance_x", QgsSymbolLayer::PropertyDistanceX },
332  { "distance_y", QgsSymbolLayer::PropertyDistanceY },
333  { "displacement_x", QgsSymbolLayer::PropertyDisplacementX },
334  { "displacement_y", QgsSymbolLayer::PropertyDisplacementY },
335  { "file", QgsSymbolLayer::PropertyFile },
336  { "alpha", QgsSymbolLayer::PropertyOpacity },
337  { "customdash", QgsSymbolLayer::PropertyCustomDash },
338  { "line_style", QgsSymbolLayer::PropertyStrokeStyle },
339  { "joinstyle", QgsSymbolLayer::PropertyJoinStyle },
340  { "capstyle", QgsSymbolLayer::PropertyCapStyle },
341  { "placement", QgsSymbolLayer::PropertyPlacement },
342  { "interval", QgsSymbolLayer::PropertyInterval },
343  { "offset_along_line", QgsSymbolLayer::PropertyOffsetAlongLine },
344  { "name", QgsSymbolLayer::PropertyName },
345  { "size", QgsSymbolLayer::PropertySize },
350  { "rotation", QgsSymbolLayer::PropertyAngle },
351  { "horizontal_anchor_point", QgsSymbolLayer::PropertyHorizontalAnchor },
352  { "vertical_anchor_point", QgsSymbolLayer::PropertyVerticalAnchor },
353  };
354 
355  QgsStringMap::const_iterator propIt = stringMap.constBegin();
356  for ( ; propIt != stringMap.constEnd(); ++propIt )
357  {
358  QgsProperty prop;
359  QString propertyName;
360 
361  if ( propIt.key().endsWith( QLatin1String( "_dd_expression" ) ) )
362  {
363  //found a data defined property
364 
365  //get data defined property name by stripping "_dd_expression" from property key
366  propertyName = propIt.key().left( propIt.key().length() - 14 );
367 
368  prop = propertyFromMap( stringMap, propertyName );
369  }
370  else if ( propIt.key().endsWith( QLatin1String( "_expression" ) ) )
371  {
372  //old style data defined property, upgrade
373 
374  //get data defined property name by stripping "_expression" from property key
375  propertyName = propIt.key().left( propIt.key().length() - 11 );
376 
377  prop = QgsProperty::fromExpression( propIt.value() );
378  }
379 
380  if ( !prop || !OLD_PROPS.contains( propertyName ) )
381  continue;
382 
383  QgsSymbolLayer::Property key = static_cast< QgsSymbolLayer::Property >( OLD_PROPS.value( propertyName ) );
384 
385  if ( type() == QgsSymbol::Line )
386  {
387  //these keys had different meaning for line symbol layers
388  if ( propertyName == QLatin1String( "width" ) )
390  else if ( propertyName == QLatin1String( "color" ) )
392  }
393 
394  setDataDefinedProperty( key, prop );
395  }
396 }
397 
399 {
400  if ( !destLayer )
401  return;
402 
404 }
405 
407 {
408  if ( !destLayer || !mPaintEffect )
409  return;
410 
412  destLayer->setPaintEffect( mPaintEffect->clone() );
413  else
414  destLayer->setPaintEffect( nullptr );
415 }
416 
418  : QgsSymbolLayer( QgsSymbol::Marker, locked )
419 {
420 
421 }
422 
424  : QgsSymbolLayer( QgsSymbol::Line, locked )
425 {
426 }
427 
429 {
430  return mRingFilter;
431 }
432 
434 {
435  mRingFilter = filter;
436 }
437 
439  : QgsSymbolLayer( QgsSymbol::Fill, locked )
440 {
441 }
442 
444 {
445  Q_UNUSED( context )
446 }
447 
449 {
450  Q_UNUSED( context )
451 }
452 
454 {
455  startRender( context );
456  QgsPaintEffect *effect = paintEffect();
457 
458  QPolygonF points = context.patchShape() ? context.patchShape()->toQPolygonF( QgsSymbol::Marker, size ).value( 0 ).value( 0 )
460 
461  std::unique_ptr< QgsEffectPainter > effectPainter;
462  if ( effect && effect->enabled() )
463  effectPainter = qgis::make_unique< QgsEffectPainter >( context.renderContext(), effect );
464 
465  for ( QPointF point : qgis::as_const( points ) )
466  renderPoint( point, context );
467 
468  effectPainter.reset();
469 
470  stopRender( context );
471 }
472 
473 void QgsMarkerSymbolLayer::markerOffset( QgsSymbolRenderContext &context, double &offsetX, double &offsetY ) const
474 {
476 }
477 
478 void QgsMarkerSymbolLayer::markerOffset( QgsSymbolRenderContext &context, double width, double height, double &offsetX, double &offsetY ) const
479 {
480  markerOffset( context, width, height, mSizeUnit, mSizeUnit, offsetX, offsetY, mSizeMapUnitScale, mSizeMapUnitScale );
481 }
482 
483 void QgsMarkerSymbolLayer::markerOffset( QgsSymbolRenderContext &context, double width, double height,
485  double &offsetX, double &offsetY, const QgsMapUnitScale &widthMapUnitScale, const QgsMapUnitScale &heightMapUnitScale ) const
486 {
487  offsetX = mOffset.x();
488  offsetY = mOffset.y();
489 
491  {
494  bool ok = false;
495  const QPointF offset = QgsSymbolLayerUtils::toPoint( exprVal, &ok );
496  if ( ok )
497  {
498  offsetX = offset.x();
499  offsetY = offset.y();
500  }
501  }
502 
503  offsetX = context.renderContext().convertToPainterUnits( offsetX, mOffsetUnit, mOffsetMapUnitScale );
504  offsetY = context.renderContext().convertToPainterUnits( offsetY, mOffsetUnit, mOffsetMapUnitScale );
505 
509  {
511  if ( exprVal.isValid() )
512  {
513  horizontalAnchorPoint = decodeHorizontalAnchorPoint( exprVal.toString() );
514  }
515  }
517  {
519  if ( exprVal.isValid() )
520  {
521  verticalAnchorPoint = decodeVerticalAnchorPoint( exprVal.toString() );
522  }
523  }
524 
525  //correct horizontal position according to anchor point
527  {
528  return;
529  }
530 
531  double anchorPointCorrectionX = context.renderContext().convertToPainterUnits( width, widthUnit, widthMapUnitScale ) / 2.0;
533  {
534  // rendering for symbol previews -- an size in meters in map units can't be calculated, so treat the size as millimeters
535  // and clamp it to a reasonable range. It's the best we can do in this situation!
536  anchorPointCorrectionX = std::min( std::max( context.renderContext().convertToPainterUnits( width, QgsUnitTypes::RenderMillimeters ), 3.0 ), 100.0 ) / 2.0;
537  }
538 
539  double anchorPointCorrectionY = context.renderContext().convertToPainterUnits( height, heightUnit, heightMapUnitScale ) / 2.0;
541  {
542  // rendering for symbol previews -- an size in meters in map units can't be calculated, so treat the size as millimeters
543  // and clamp it to a reasonable range. It's the best we can do in this situation!
544  anchorPointCorrectionY = std::min( std::max( context.renderContext().convertToPainterUnits( height, QgsUnitTypes::RenderMillimeters ), 3.0 ), 100.0 ) / 2.0;
545  }
546 
547  if ( horizontalAnchorPoint == Left )
548  {
549  offsetX += anchorPointCorrectionX;
550  }
551  else if ( horizontalAnchorPoint == Right )
552  {
553  offsetX -= anchorPointCorrectionX;
554  }
555 
556  //correct vertical position according to anchor point
557  if ( verticalAnchorPoint == Top )
558  {
559  offsetY += anchorPointCorrectionY;
560  }
561  else if ( verticalAnchorPoint == Bottom )
562  {
563  offsetY -= anchorPointCorrectionY;
564  }
565 }
566 
567 QPointF QgsMarkerSymbolLayer::_rotatedOffset( QPointF offset, double angle )
568 {
569  angle = DEG2RAD( angle );
570  double c = std::cos( angle ), s = std::sin( angle );
571  return QPointF( offset.x() * c - offset.y() * s, offset.x() * s + offset.y() * c );
572 }
573 
574 QgsMarkerSymbolLayer::HorizontalAnchorPoint QgsMarkerSymbolLayer::decodeHorizontalAnchorPoint( const QString &str )
575 {
576  if ( str.compare( QLatin1String( "left" ), Qt::CaseInsensitive ) == 0 )
577  {
579  }
580  else if ( str.compare( QLatin1String( "right" ), Qt::CaseInsensitive ) == 0 )
581  {
583  }
584  else
585  {
587  }
588 }
589 
590 QgsMarkerSymbolLayer::VerticalAnchorPoint QgsMarkerSymbolLayer::decodeVerticalAnchorPoint( const QString &str )
591 {
592  if ( str.compare( QLatin1String( "top" ), Qt::CaseInsensitive ) == 0 )
593  {
595  }
596  else if ( str.compare( QLatin1String( "bottom" ), Qt::CaseInsensitive ) == 0 )
597  {
599  }
600  else
601  {
603  }
604 }
605 
607 {
608  mSizeUnit = unit;
609  mOffsetUnit = unit;
610 }
611 
613 {
614  if ( mOffsetUnit != mSizeUnit )
615  {
617  }
618  return mOffsetUnit;
619 }
620 
622 {
623  mSizeMapUnitScale = scale;
624  mOffsetMapUnitScale = scale;
625 }
626 
628 {
630  {
631  return mSizeMapUnitScale;
632  }
633  return QgsMapUnitScale();
634 }
635 
637 {
638  mWidthUnit = unit;
639 }
640 
642 {
643  return mWidthUnit;
644 }
645 
647 {
648  mWidthMapUnitScale = scale;
649 }
650 
652 {
653  return mWidthMapUnitScale;
654 }
655 
656 
658 {
659  const QList< QList< QPolygonF > > points = context.patchShape() ? context.patchShape()->toQPolygonF( QgsSymbol::Line, size )
661  startRender( context );
662  QgsPaintEffect *effect = paintEffect();
663 
664  std::unique_ptr< QgsEffectPainter > effectPainter;
665  if ( effect && effect->enabled() )
666  effectPainter = qgis::make_unique< QgsEffectPainter >( context.renderContext(), effect );
667 
668  for ( const QList< QPolygonF > &line : points )
669  renderPolyline( line.value( 0 ), context );
670 
671  effectPainter.reset();
672 
673  stopRender( context );
674 }
675 
676 void QgsLineSymbolLayer::renderPolygonStroke( const QPolygonF &points, const QVector<QPolygonF> *rings, QgsSymbolRenderContext &context )
677 {
678  switch ( mRingFilter )
679  {
680  case AllRings:
681  case ExteriorRingOnly:
682  renderPolyline( points, context );
683  break;
684  case InteriorRingsOnly:
685  break;
686  }
687 
688  if ( rings )
689  {
690  switch ( mRingFilter )
691  {
692  case AllRings:
693  case InteriorRingsOnly:
694  {
695  for ( const QPolygonF &ring : qgis::as_const( *rings ) )
696  renderPolyline( ring, context );
697  }
698  break;
699  case ExteriorRingOnly:
700  break;
701  }
702  }
703 }
704 
705 double QgsLineSymbolLayer::width( const QgsRenderContext &context ) const
706 {
708 }
709 
711 {
712  Q_UNUSED( context )
714 }
715 
716 
718 {
719  const QList< QList< QPolygonF > > polys = context.patchShape() ? context.patchShape()->toQPolygonF( QgsSymbol::Fill, size )
721 
722  startRender( context );
723  QgsPaintEffect *effect = paintEffect();
724 
725  std::unique_ptr< QgsEffectPainter > effectPainter;
726  if ( effect && effect->enabled() )
727  effectPainter = qgis::make_unique< QgsEffectPainter >( context.renderContext(), effect );
728 
729  for ( const QList< QPolygonF > &poly : polys )
730  {
731  QVector< QPolygonF > rings;
732  for ( int i = 1; i < poly.size(); ++i )
733  rings << poly.at( i );
734  renderPolygon( poly.value( 0 ), &rings, context );
735  }
736 
737  effectPainter.reset();
738 
739  stopRender( context );
740 }
741 
742 void QgsFillSymbolLayer::_renderPolygon( QPainter *p, const QPolygonF &points, const QVector<QPolygonF> *rings, QgsSymbolRenderContext &context )
743 {
744  if ( !p )
745  {
746  return;
747  }
748 
749  // Disable 'Antialiasing' if the geometry was generalized in the current RenderContext (We known that it must have least #5 points).
750  if ( points.size() <= 5 &&
753  ( p->renderHints() & QPainter::Antialiasing ) )
754  {
755  p->setRenderHint( QPainter::Antialiasing, false );
756  p->drawRect( points.boundingRect() );
757  p->setRenderHint( QPainter::Antialiasing, true );
758  return;
759  }
760 
761  // polygons outlines are sometimes rendered wrongly with drawPolygon, when
762  // clipped (see #13343), so use drawPath instead.
763  if ( !rings && p->pen().style() == Qt::NoPen )
764  {
765  // simple polygon without holes
766  p->drawPolygon( points );
767  }
768  else
769  {
770  // polygon with holes must be drawn using painter path
771  QPainterPath path;
772  path.addPolygon( points );
773 
774  if ( rings )
775  {
776  for ( auto it = rings->constBegin(); it != rings->constEnd(); ++it )
777  {
778  QPolygonF ring = *it;
779  path.addPolygon( ring );
780  }
781  }
782 
783  p->drawPath( path );
784  }
785 }
786 
787 void QgsMarkerSymbolLayer::toSld( QDomDocument &doc, QDomElement &element, const QgsStringMap &props ) const
788 {
789  QDomElement symbolizerElem = doc.createElement( QStringLiteral( "se:PointSymbolizer" ) );
790  if ( !props.value( QStringLiteral( "uom" ), QString() ).isEmpty() )
791  symbolizerElem.setAttribute( QStringLiteral( "uom" ), props.value( QStringLiteral( "uom" ), QString() ) );
792  element.appendChild( symbolizerElem );
793 
794  // <Geometry>
795  QgsSymbolLayerUtils::createGeometryElement( doc, symbolizerElem, props.value( QStringLiteral( "geom" ), QString() ) );
796 
797  writeSldMarker( doc, symbolizerElem, props );
798 }
799 
801 {
802  return {};
803 }
804 
QgsSymbolLayer::PropertyArrowHeadType
@ PropertyArrowHeadType
Arrow head type.
Definition: qgssymbollayer.h:181
QgsSymbolRenderContext::setOriginalValueVariable
void setOriginalValueVariable(const QVariant &value)
Sets the original value variable value for data defined symbology.
Definition: qgssymbol.cpp:1370
QgsMarkerSymbolLayer::Right
@ Right
Align to right side of symbol.
Definition: qgssymbollayer.h:584
QgsSymbolLayer::PropertyHorizontalAnchor
@ PropertyHorizontalAnchor
Horizontal anchor point.
Definition: qgssymbollayer.h:174
QgsPropertyCollection::prepare
bool prepare(const QgsExpressionContext &context=QgsExpressionContext()) const override
Prepares the collection against a specified expression context.
Definition: qgspropertycollection.cpp:230
QgsProperty::fromField
static QgsProperty fromField(const QString &fieldName, bool isActive=true)
Returns a new FieldBasedProperty created from the specified field name.
Definition: qgsproperty.cpp:220
QgsLegendPatchShape::toQPolygonF
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...
Definition: qgslegendpatchshape.cpp:84
QgsSymbolLayer::PropertyBlurRadius
@ PropertyBlurRadius
Shapeburst blur radius.
Definition: qgssymbollayer.h:158
QgsPropertyDefinition::Offset
@ Offset
2D offset
Definition: qgsproperty.h:79
QgsMarkerSymbolLayer::VerticalAnchorPoint
VerticalAnchorPoint
Symbol vertical anchor points.
Definition: qgssymbollayer.h:588
QgsSymbolLayer::PropertyArrowHeadThickness
@ PropertyArrowHeadThickness
Arrow head thickness.
Definition: qgssymbollayer.h:180
QgsLineSymbolLayer::RenderRingFilter
RenderRingFilter
Options for filtering rings when the line symbol layer is being used to render a polygon's rings.
Definition: qgssymbollayer.h:899
QgsSymbolLayer::PropertyLineDistance
@ PropertyLineDistance
Distance between lines, or length of lines for hash line symbols.
Definition: qgssymbollayer.h:148
QgsRenderContext::convertToPainterUnits
double convertToPainterUnits(double size, QgsUnitTypes::RenderUnit unit, const QgsMapUnitScale &scale=QgsMapUnitScale()) const
Converts a size from the specified units to painter units (pixels).
Definition: qgsrendercontext.cpp:287
QgsSymbolLayer::PropertyShapeburstUseWholeShape
@ PropertyShapeburstUseWholeShape
Shapeburst use whole shape.
Definition: qgssymbollayer.h:159
QgsSymbolLayer::startFeatureRender
virtual void startFeatureRender(const QgsFeature &feature, QgsRenderContext &context)
Called before the layer will be rendered for a particular feature.
Definition: qgssymbollayer.cpp:117
QgsRenderContext::mapToPixel
const QgsMapToPixel & mapToPixel() const
Returns the context's map to pixel transform, which transforms between map coordinates and device coo...
Definition: qgsrendercontext.h:309
QgsSymbolLayer::dxfAngle
virtual double dxfAngle(QgsSymbolRenderContext &context) const
Gets angle.
Definition: qgssymbollayer.cpp:157
QgsMarkerSymbolLayer::size
double size() const
Returns the symbol size.
Definition: qgssymbollayer.h:655
QgsSymbolLayer::dataDefinedProperties
QgsPropertyCollection & dataDefinedProperties()
Returns a reference to the symbol layer's property collection, used for data defined overrides.
Definition: qgssymbollayer.h:480
QgsProperty
A store for object properties.
Definition: qgsproperty.h:231
QgsSymbolLayer::PropertyClipPoints
@ PropertyClipPoints
Whether markers should be clipped to polygon boundaries.
Definition: qgssymbollayer.h:187
QgsSymbolLayer::PropertyGradientReference2IsCentroid
@ PropertyGradientReference2IsCentroid
Gradient reference point 2 is centroid.
Definition: qgssymbollayer.h:157
QgsUnitTypes::RenderUnit
RenderUnit
Rendering size units.
Definition: qgsunittypes.h:166
QgsMarkerSymbolLayer::mSizeMapUnitScale
QgsMapUnitScale mSizeMapUnitScale
Marker size map unit scale.
Definition: qgssymbollayer.h:867
QgsDxfExport
Definition: qgsdxfexport.h:62
QgsLineSymbolLayer::renderPolyline
virtual void renderPolyline(const QPolygonF &points, QgsSymbolRenderContext &context)=0
Renders the line symbol layer along the line joining points, using the given render context.
QgsPropertyDefinition::HorizontalAnchor
@ HorizontalAnchor
Horizontal anchor point.
Definition: qgsproperty.h:76
QgsRenderContext::expressionContext
QgsExpressionContext & expressionContext()
Gets the expression context.
Definition: qgsrendercontext.h:580
QgsVectorSimplifyMethod::AntialiasingSimplification
@ AntialiasingSimplification
The geometries can be rendered with 'AntiAliasing' disabled because of it is '1-pixel size'.
Definition: qgsvectorsimplifymethod.h:54
QgsFillSymbolLayer::drawPreviewIcon
void drawPreviewIcon(QgsSymbolRenderContext &context, QSize size) override
Definition: qgssymbollayer.cpp:717
QgsMapToPixel::mapUnitsPerPixel
double mapUnitsPerPixel() const
Returns current map units per pixel.
Definition: qgsmaptopixel.cpp:128
QgsSymbolLayer::PropertyAverageAngleLength
@ PropertyAverageAngleLength
Length to average symbol angles over.
Definition: qgssymbollayer.h:173
QgsLineSymbolLayer::setRingFilter
void setRingFilter(QgsLineSymbolLayer::RenderRingFilter filter)
Sets the line symbol layer's ring filter, which controls which rings are rendered when the line symbo...
Definition: qgssymbollayer.cpp:433
QgsSymbolLayer::dxfPenStyle
virtual Qt::PenStyle dxfPenStyle() const
Gets pen style.
Definition: qgssymbollayer.cpp:169
QgsSymbolLayer::isCompatibleWithSymbol
virtual bool isCompatibleWithSymbol(QgsSymbol *symbol) const
Returns if the layer can be used below the specified symbol.
Definition: qgssymbollayer.cpp:228
QgsLineSymbolLayer::width
virtual double width() const
Returns the estimated width for the line symbol layer.
Definition: qgssymbollayer.h:959
QgsMarkerSymbolLayer::mapUnitScale
QgsMapUnitScale mapUnitScale() const override
Definition: qgssymbollayer.cpp:627
QgsSymbolLayer::PropertyArrowStartWidth
@ PropertyArrowStartWidth
Arrow tail start width.
Definition: qgssymbollayer.h:178
QgsMarkerSymbolLayer::QgsMarkerSymbolLayer
QgsMarkerSymbolLayer(const QgsMarkerSymbolLayer &other)=delete
QgsMarkerSymbolLayer cannot be copied.
QgsFields::isEmpty
bool isEmpty() const
Checks whether the container is empty.
Definition: qgsfields.cpp:128
QgsSymbolLayer::dxfCustomDashPattern
virtual QVector< qreal > dxfCustomDashPattern(QgsUnitTypes::RenderUnit &unit) const
Gets dash pattern.
Definition: qgssymbollayer.cpp:163
qgsexpression.h
QgsSymbolLayer::prepareExpressions
virtual void prepareExpressions(const QgsSymbolRenderContext &context)
Prepares all data defined property expressions for evaluation.
Definition: qgssymbollayer.cpp:204
QgsPropertyDefinition::DataTypeString
@ DataTypeString
Property requires a string value.
Definition: qgsproperty.h:93
QgsSymbolLayer::mType
QgsSymbol::SymbolType mType
Definition: qgssymbollayer.h:515
QgsSymbolLayer::PropertyFontFamily
@ PropertyFontFamily
Font family.
Definition: qgssymbollayer.h:189
QgsSymbolLayer::PropertyFillStyle
@ PropertyFillStyle
Fill style (eg solid, dots)
Definition: qgssymbollayer.h:144
QgsSymbolLayer::PropertyGradientReference2Y
@ PropertyGradientReference2Y
Gradient reference point 2 y.
Definition: qgssymbollayer.h:155
QgsSymbolLayer::color
virtual QColor color() const
The fill color.
Definition: qgssymbollayer.h:226
QgsSymbolLayer::PropertyFillColor
@ PropertyFillColor
Fill color.
Definition: qgssymbollayer.h:135
QgsSymbolLayer::mRenderingPass
int mRenderingPass
Definition: qgssymbollayer.h:522
QgsLineSymbolLayer::mWidthMapUnitScale
QgsMapUnitScale mWidthMapUnitScale
Definition: qgssymbollayer.h:1075
qgssymbollayerutils.h
QgsLineSymbolLayer::mRingFilter
RenderRingFilter mRingFilter
Definition: qgssymbollayer.h:1080
QgsSymbolLayer::mPaintEffect
std::unique_ptr< QgsPaintEffect > mPaintEffect
Definition: qgssymbollayer.h:526
QgsSymbolLayer::setRenderingPass
void setRenderingPass(int renderingPass)
Specifies the rendering pass in which this symbol layer should be rendered.
Definition: qgssymbollayer.cpp:236
QgsSymbolLayer::hasDataDefinedProperties
virtual bool hasDataDefinedProperties() const
Returns true if the symbol layer (or any of its sub-symbols) contains data defined properties.
Definition: qgssymbollayer.cpp:215
qgsmultipoint.h
QgsSymbolLayer::PropertyGradientReference1IsCentroid
@ PropertyGradientReference1IsCentroid
Gradient reference point 1 is centroid.
Definition: qgssymbollayer.h:156
QgsSymbolLayer::QgsSymbolLayer
QgsSymbolLayer(const QgsSymbolLayer &other)=delete
QgsSymbolLayer cannot be copied.
QgsMarkerSymbolLayer::startRender
void startRender(QgsSymbolRenderContext &context) override
Called before a set of rendering operations commences on the supplied render context.
Definition: qgssymbollayer.cpp:443
QgsSymbolLayer::PropertyDisplacementX
@ PropertyDisplacementX
Horizontal displacement.
Definition: qgssymbollayer.h:165
QgsFillSymbolLayer::_renderPolygon
void _renderPolygon(QPainter *p, const QPolygonF &points, const QVector< QPolygonF > *rings, QgsSymbolRenderContext &context)
Default method to render polygon.
Definition: qgssymbollayer.cpp:742
QgsPropertyDefinition::FillStyle
@ FillStyle
Fill style (eg solid, lines)
Definition: qgsproperty.h:74
QgsRenderContext
Definition: qgsrendercontext.h:57
QgsPropertyDefinition::DataTypeNumeric
@ DataTypeNumeric
Property requires a numeric value.
Definition: qgsproperty.h:100
QgsPropertyDefinition::Double
@ Double
Double value (including negative values)
Definition: qgsproperty.h:58
QgsUnitTypes::RenderMillimeters
@ RenderMillimeters
Millimeters.
Definition: qgsunittypes.h:168
QgsPropertyDefinition::PenJoinStyle
@ PenJoinStyle
Pen join style.
Definition: qgsproperty.h:67
qgspainteffectregistry.h
QgsSymbolLayer::PropertyInterval
@ PropertyInterval
Line marker interval.
Definition: qgssymbollayer.h:171
QgsSymbolLayer::~QgsSymbolLayer
virtual ~QgsSymbolLayer()
QgsLineSymbolLayer::outputUnit
QgsUnitTypes::RenderUnit outputUnit() const override
Returns the units to use for sizes and widths within the symbol layer.
Definition: qgssymbollayer.cpp:641
QgsSymbolLayer::PropertyCapStyle
@ PropertyCapStyle
Line cap style.
Definition: qgssymbollayer.h:169
QgsSymbol
Definition: qgssymbol.h:63
QgsMarkerSymbolLayer::setMapUnitScale
void setMapUnitScale(const QgsMapUnitScale &scale) override
Definition: qgssymbollayer.cpp:621
QgsProperty::fromExpression
static QgsProperty fromExpression(const QString &expression, bool isActive=true)
Returns a new ExpressionBasedProperty created from the specified expression.
Definition: qgsproperty.cpp:212
QgsMarkerSymbolLayer::mSizeUnit
QgsUnitTypes::RenderUnit mSizeUnit
Marker size unit.
Definition: qgssymbollayer.h:865
qgspainteffect.h
QgsSymbolLayer::PropertyStrokeColor
@ PropertyStrokeColor
Stroke color.
Definition: qgssymbollayer.h:136
QgsMarkerSymbolLayer::drawPreviewIcon
void drawPreviewIcon(QgsSymbolRenderContext &context, QSize size) override
Definition: qgssymbollayer.cpp:453
QgsMarkerSymbolLayer::mVerticalAnchorPoint
VerticalAnchorPoint mVerticalAnchorPoint
Vertical anchor point.
Definition: qgssymbollayer.h:879
QgsDxfExport::mapUnitScaleFactor
static double mapUnitScaleFactor(double scale, QgsUnitTypes::RenderUnit symbolUnits, QgsUnitTypes::DistanceUnit mapUnits, double mapUnitsPerPixel=1.0)
Returns scale factor for conversion to map units.
Definition: qgsdxfexport.cpp:1819
QgsLineSymbolLayer::mapUnitScale
QgsMapUnitScale mapUnitScale() const override
Definition: qgssymbollayer.cpp:651
QgsFillSymbolLayer::renderPolygon
virtual void renderPolygon(const QPolygonF &points, const QVector< QPolygonF > *rings, QgsSymbolRenderContext &context)=0
Renders the fill symbol layer for the polygon whose outer ring is defined by points,...
QgsSymbolRenderContext::patchShape
const QgsLegendPatchShape * patchShape() const
Returns the symbol patch shape, to use if rendering symbol preview icons.
Definition: qgssymbol.cpp:1406
QgsSymbolLayerUtils::createGeometryElement
static void createGeometryElement(QDomDocument &doc, QDomElement &element, const QString &geomFunc)
Definition: qgssymbollayerutils.cpp:2695
qgsgeometrysimplifier.h
QgsPropertyDefinition::String
@ String
Any string value.
Definition: qgsproperty.h:62
QgsSymbolLayer::PropertyFontStyle
@ PropertyFontStyle
Font style.
Definition: qgssymbollayer.h:190
QgsMarkerSymbolLayer::mOffsetUnit
QgsUnitTypes::RenderUnit mOffsetUnit
Offset units.
Definition: qgssymbollayer.h:871
QgsStyle::defaultStyle
static QgsStyle * defaultStyle()
Returns default application-wide style.
Definition: qgsstyle.cpp:111
QgsSymbolLayer::PropertyArrowHeadLength
@ PropertyArrowHeadLength
Arrow head length.
Definition: qgssymbollayer.h:179
QgsMarkerSymbolLayer::mSize
double mSize
Marker size.
Definition: qgssymbollayer.h:863
qgsapplication.h
QgsSymbolLayer::PropertyGradientSpread
@ PropertyGradientSpread
Gradient spread mode.
Definition: qgssymbollayer.h:151
QgsLineSymbolLayer::drawPreviewIcon
void drawPreviewIcon(QgsSymbolRenderContext &context, QSize size) override
Definition: qgssymbollayer.cpp:657
QgsSymbolRenderContext
Definition: qgssymbol.h:681
QgsMarkerSymbolLayer::HorizontalAnchorPoint
HorizontalAnchorPoint
Symbol horizontal anchor points.
Definition: qgssymbollayer.h:580
QgsPropertyDefinition::Rotation
@ Rotation
Rotation (value between 0-360 degrees)
Definition: qgsproperty.h:61
QgsMarkerSymbolLayer::setOutputUnit
void setOutputUnit(QgsUnitTypes::RenderUnit unit) override
Sets the units to use for sizes and widths within the symbol layer.
Definition: qgssymbollayer.cpp:606
QgsSymbolLayerUtils::toPoint
static QPointF toPoint(const QVariant &value, bool *ok=nullptr)
Converts a value to a point.
Definition: qgssymbollayerutils.cpp:443
QgsSymbolLayer::propertyDefinitions
static const QgsPropertiesDefinition & propertyDefinitions()
Returns the symbol layer property definitions.
Definition: qgssymbollayer.cpp:220
QgsSymbolLayer::writeDxf
virtual bool writeDxf(QgsDxfExport &e, double mmMapUnitScaleFactor, const QString &layerName, QgsSymbolRenderContext &context, QPointF shift=QPointF(0.0, 0.0)) const
write as DXF
Definition: qgssymbollayer.cpp:127
QgsMarkerSymbolLayer::markerOffset
void markerOffset(QgsSymbolRenderContext &context, double &offsetX, double &offsetY) const
Calculates the required marker offset, including both the symbol offset and any displacement required...
Definition: qgssymbollayer.cpp:473
QgsPropertiesDefinition
QMap< int, QgsPropertyDefinition > QgsPropertiesDefinition
Definition of available properties.
Definition: qgspropertycollection.h:29
QgsSymbolLayer::PropertyOffset
@ PropertyOffset
Symbol offset.
Definition: qgssymbollayer.h:139
QgsPaintEffectRegistry::isDefaultStack
static bool isDefaultStack(QgsPaintEffect *effect)
Tests whether a paint effect matches the default effects stack.
Definition: qgspainteffectregistry.cpp:134
QgsSymbolLayer::PropertyCharacter
@ PropertyCharacter
Character, eg for font marker symbol layers.
Definition: qgssymbollayer.h:140
qgsexpressioncontext.h
QgsSymbolLayer
Definition: qgssymbollayer.h:52
QgsSymbolLayer::PropertyGradientType
@ PropertyGradientType
Gradient fill type.
Definition: qgssymbollayer.h:149
QgsDxfExport::mapUnits
QgsUnitTypes::DistanceUnit mapUnits() const
Retrieve map units.
Definition: qgsdxfexport.cpp:245
QgsSymbolLayer::dxfOffset
virtual double dxfOffset(const QgsDxfExport &e, QgsSymbolRenderContext &context) const
Gets offset.
Definition: qgssymbollayer.cpp:144
QgsSymbolLayer::PropertyArrowWidth
@ PropertyArrowWidth
Arrow tail width.
Definition: qgssymbollayer.h:177
QgsFillSymbolLayer::QgsFillSymbolLayer
QgsFillSymbolLayer(const QgsFillSymbolLayer &other)=delete
QgsFillSymbolLayer cannot be copied.
QgsMarkerSymbolLayer::Top
@ Top
Align to top of symbol.
Definition: qgssymbollayer.h:590
QgsSymbolLayer::renderingPass
int renderingPass() const
Specifies the rendering pass in which this symbol layer should be rendered.
Definition: qgssymbollayer.cpp:241
QgsSymbolLayer::PropertyRandomSeed
@ PropertyRandomSeed
Random number seed.
Definition: qgssymbollayer.h:186
QgsSymbolRenderContext::fields
QgsFields fields() const
Fields of the layer.
Definition: qgssymbol.h:814
QgsPropertyCollection::hasActiveProperties
bool hasActiveProperties() const override
Returns true if the collection has any active properties, or false if all properties within the colle...
Definition: qgspropertycollection.cpp:294
QgsPropertyDefinition::VerticalAnchor
@ VerticalAnchor
Vertical anchor point.
Definition: qgsproperty.h:77
QgsSymbolLayer::stopFeatureRender
virtual void stopFeatureRender(const QgsFeature &feature, QgsRenderContext &context)
Called after the layer has been rendered for a particular feature.
Definition: qgssymbollayer.cpp:122
QgsMarkerSymbolLayer::HCenter
@ HCenter
Align to horizontal center of symbol.
Definition: qgssymbollayer.h:583
QgsPropertyDefinition::ColorWithAlpha
@ ColorWithAlpha
Color with alpha channel.
Definition: qgsproperty.h:65
QgsSymbolLayer::PropertyVerticalAnchor
@ PropertyVerticalAnchor
Vertical anchor point.
Definition: qgssymbollayer.h:175
QgsSymbolLayer::PropertyGradientReference1Y
@ PropertyGradientReference1Y
Gradient reference point 1 y.
Definition: qgssymbollayer.h:153
QgsMarkerSymbolLayer::toSld
void toSld(QDomDocument &doc, QDomElement &element, const QgsStringMap &props) const override
Definition: qgssymbollayer.cpp:787
QgsSymbolLayer::PropertySize
@ PropertySize
Symbol size.
Definition: qgssymbollayer.h:132
QgsLineSymbolLayer::mWidthUnit
QgsUnitTypes::RenderUnit mWidthUnit
Definition: qgssymbollayer.h:1074
QgsLineSymbolLayer::dxfWidth
double dxfWidth(const QgsDxfExport &e, QgsSymbolRenderContext &context) const override
Gets line width.
Definition: qgssymbollayer.cpp:710
QgsSymbolLayer::copyPaintEffect
void copyPaintEffect(QgsSymbolLayer *destLayer) const
Copies paint effect of this layer to another symbol layer.
Definition: qgssymbollayer.cpp:406
QgsLineSymbolLayer::renderPolygonStroke
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.
Definition: qgssymbollayer.cpp:676
QgsSymbolLayer::PropertyStrokeStyle
@ PropertyStrokeStyle
Stroke style (eg solid, dashed)
Definition: qgssymbollayer.h:138
QgsMarkerSymbolLayer::outputUnit
QgsUnitTypes::RenderUnit outputUnit() const override
Returns the units to use for sizes and widths within the symbol layer.
Definition: qgssymbollayer.cpp:612
qgsrendercontext.h
propertyFromMap
QgsProperty propertyFromMap(const QgsStringMap &map, const QString &baseName)
Definition: qgssymbollayer.cpp:252
QgsMarkerSymbolLayer::verticalAnchorPoint
VerticalAnchorPoint verticalAnchorPoint() const
Returns the vertical anchor point for positioning the symbol.
Definition: qgssymbollayer.h:789
QgsPropertyDefinition::CapStyle
@ CapStyle
Line cap style (eg round)
Definition: qgsproperty.h:75
QgsLineSymbolLayer::mWidth
double mWidth
Definition: qgssymbollayer.h:1073
QgsPropertyDefinition
Definition for a property.
Definition: qgsproperty.h:47
QgsMarkerSymbolLayer::Bottom
@ Bottom
Align to bottom of symbol.
Definition: qgssymbollayer.h:592
qgssymbollayer.h
QgsVectorSimplifyMethod::threshold
float threshold() const
Gets the simplification threshold of the vector layer managed.
Definition: qgsvectorsimplifymethod.h:89
QgsSymbolLayer::mFields
QgsFields mFields
Definition: qgssymbollayer.h:527
QgsSymbolLayer::setPaintEffect
void setPaintEffect(QgsPaintEffect *effect)
Sets the current paint effect for the layer.
Definition: qgssymbollayer.cpp:190
QgsMarkerSymbolLayer::Left
@ Left
Align to left side of symbol.
Definition: qgssymbollayer.h:582
QgsSymbolLayer::PropertyName
@ PropertyName
Name, eg shape name for simple markers.
Definition: qgssymbollayer.h:134
qgslegendpatchshape.h
QgsSymbol::Fill
@ Fill
Fill symbol.
Definition: qgssymbol.h:89
QgsMapUnitScale
Struct for storing maximum and minimum scales for measurements in map units.
Definition: qgsmapunitscale.h:37
QgsSymbolLayer::PropertyPointCount
@ PropertyPointCount
Point count.
Definition: qgssymbollayer.h:185
QgsSymbolLayer::paintEffect
QgsPaintEffect * paintEffect() const
Returns the current paint effect for the layer.
Definition: qgssymbollayer.cpp:185
qgseffectstack.h
QgsPropertyCollection::referencedFields
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.
Definition: qgspropertycollection.cpp:244
QgsSymbolLayer::mDataDefinedProperties
QgsPropertyCollection mDataDefinedProperties
Definition: qgssymbollayer.h:524
QgsSymbolLayer::PropertyStrokeWidth
@ PropertyStrokeWidth
Stroke width.
Definition: qgssymbollayer.h:137
QgsSymbolLayer::PropertyShapeburstIgnoreRings
@ PropertyShapeburstIgnoreRings
Shapeburst ignore rings.
Definition: qgssymbollayer.h:161
QgsSymbolLayerUtils::encodePoint
static QString encodePoint(QPointF point)
Encodes a QPointF to a string.
Definition: qgssymbollayerutils.cpp:430
QgsMarkerSymbolLayer::VCenter
@ VCenter
Align to vertical center of symbol.
Definition: qgssymbollayer.h:591
QgsLineSymbolLayer::InteriorRingsOnly
@ InteriorRingsOnly
Render the interior rings only.
Definition: qgssymbollayer.h:903
QgsRenderContext::vectorSimplifyMethod
const QgsVectorSimplifyMethod & vectorSimplifyMethod() const
Returns the simplification settings to use when rendering vector layers.
Definition: qgsrendercontext.h:549
QgsSymbolLayer::usedAttributes
virtual QSet< QString > usedAttributes(const QgsRenderContext &context) const
Returns the set of attributes referenced by the layer.
Definition: qgssymbollayer.cpp:246
qgsclipper.h
QgsPropertyDefinition::Double0To1
@ Double0To1
Double value between 0-1 (inclusive)
Definition: qgsproperty.h:60
qgsstyle.h
DEG2RAD
#define DEG2RAD(x)
Definition: qgsdistancearea.cpp:40
QgsSymbolLayer::PropertyLayerEnabled
@ PropertyLayerEnabled
Whether symbol layer is enabled.
Definition: qgssymbollayer.h:176
QgsSymbolLayer::PropertyOffsetAlongLine
@ PropertyOffsetAlongLine
Offset along line.
Definition: qgssymbollayer.h:172
QgsSymbolLayer::PropertyOffsetY
@ PropertyOffsetY
Vertical offset.
Definition: qgssymbollayer.h:184
qgsvectorlayer.h
QgsPropertyDefinition::IntegerPositive
@ IntegerPositive
Positive integer values (including 0)
Definition: qgsproperty.h:56
QgsSymbolLayer::dxfBrushStyle
virtual Qt::BrushStyle dxfBrushStyle() const
Gets brush/fill style.
Definition: qgssymbollayer.cpp:180
QgsPropertyDefinition::Size
@ Size
1D size (eg marker radius, or square marker height/width)
Definition: qgsproperty.h:70
QgsStringMap
QMap< QString, QString > QgsStringMap
Definition: qgis.h:714
QgsMarkerSymbolLayer::mOffset
QPointF mOffset
Marker offset.
Definition: qgssymbollayer.h:869
QgsSymbolLayer::masks
virtual QgsSymbolLayerReferenceList masks() const
Returns masks defined by this symbol layer.
Definition: qgssymbollayer.cpp:800
QgsStyle::defaultPatchAsQPolygonF
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 (...
Definition: qgsstyle.cpp:1072
QgsSymbolLayer::setDataDefinedProperties
void setDataDefinedProperties(const QgsPropertyCollection &collection)
Sets the symbol layer's property collection, used for data defined overrides.
Definition: qgssymbollayer.h:495
QgsSymbolLayer::PropertyGradientReference2X
@ PropertyGradientReference2X
Gradient reference point 2 x.
Definition: qgssymbollayer.h:154
QgsMarkerSymbolLayer::mHorizontalAnchorPoint
HorizontalAnchorPoint mHorizontalAnchorPoint
Horizontal anchor point.
Definition: qgssymbollayer.h:877
QgsLineSymbolLayer::QgsLineSymbolLayer
QgsLineSymbolLayer(const QgsLineSymbolLayer &other)=delete
QgsLineSymbolLayer cannot be copied.
QgsPropertyDefinition::Boolean
@ Boolean
Boolean value.
Definition: qgsproperty.h:54
QgsSymbolLayer::PropertyCoordinateMode
@ PropertyCoordinateMode
Gradient coordinate mode.
Definition: qgssymbollayer.h:150
QgsPropertyCollection::value
QVariant value(int key, const QgsExpressionContext &context, const QVariant &defaultValue=QVariant()) const override
Returns the calculated value of the property with the specified key from within the collection.
Definition: qgspropertycollection.cpp:218
c
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
Definition: porting_processing.dox:1
QgsSymbolLayerReferenceList
QList< QgsSymbolLayerReference > QgsSymbolLayerReferenceList
Definition: qgssymbollayerreference.h:160
QgsPropertyDefinition::LineStyle
@ LineStyle
Line style (eg solid/dashed)
Definition: qgsproperty.h:72
QgsSymbolLayer::PropertyDistanceY
@ PropertyDistanceY
Vertical distance between points.
Definition: qgssymbollayer.h:164
QgsLineSymbolLayer::ringFilter
RenderRingFilter ringFilter() const
Returns the line symbol layer's ring filter, which controls which rings are rendered when the line sy...
Definition: qgssymbollayer.cpp:428
QgsSymbolLayer::PropertyDistanceX
@ PropertyDistanceX
Horizontal distance between points.
Definition: qgssymbollayer.h:163
QgsSymbolLayer::PropertyFile
@ PropertyFile
Filename, eg for svg files.
Definition: qgssymbollayer.h:162
QgsSymbolLayer::PropertyCustomDash
@ PropertyCustomDash
Custom dash pattern.
Definition: qgssymbollayer.h:168
QgsPaintEffect
Base class for visual effects which can be applied to QPicture drawings.
Definition: qgspainteffect.h:53
QgsSymbolLayer::PropertyAngle
@ PropertyAngle
Symbol angle.
Definition: qgssymbollayer.h:133
QgsMarkerSymbolLayer::renderPoint
virtual void renderPoint(QPointF point, QgsSymbolRenderContext &context)=0
Renders a marker at the specified point.
QgsUnitTypes::RenderMetersInMapUnits
@ RenderMetersInMapUnits
Meters value as Map units.
Definition: qgsunittypes.h:175
qgsproperty.h
QgsSymbol::Line
@ Line
Line symbol.
Definition: qgssymbol.h:88
QgsSymbolLayer::PropertyArrowType
@ PropertyArrowType
Arrow type.
Definition: qgssymbollayer.h:182
QgsUnitTypes::RenderUnknownUnit
@ RenderUnknownUnit
Mixed or unknown units.
Definition: qgsunittypes.h:174
QgsLineSymbolLayer::setOutputUnit
void setOutputUnit(QgsUnitTypes::RenderUnit unit) override
Sets the units to use for sizes and widths within the symbol layer.
Definition: qgssymbollayer.cpp:636
QgsLineSymbolLayer::AllRings
@ AllRings
Render both exterior and interior rings.
Definition: qgssymbollayer.h:901
QgsSymbolLayer::stopRender
virtual void stopRender(QgsSymbolRenderContext &context)=0
Called after a set of rendering operations has finished on the supplied render context.
QgsSymbolLayer::PropertyShapeburstMaxDistance
@ PropertyShapeburstMaxDistance
Shapeburst fill from edge distance.
Definition: qgssymbollayer.h:160
QgsMarkerSymbolLayer::horizontalAnchorPoint
HorizontalAnchorPoint horizontalAnchorPoint() const
Returns the horizontal anchor point for positioning the symbol.
Definition: qgssymbollayer.h:772
QgsSymbol::type
SymbolType type() const
Returns the symbol's type.
Definition: qgssymbol.h:122
QgsSymbol::Marker
@ Marker
Marker symbol.
Definition: qgssymbol.h:87
QgsMarkerSymbolLayer::writeSldMarker
virtual void writeSldMarker(QDomDocument &doc, QDomElement &element, const QgsStringMap &props) const
Writes the symbol layer definition as a SLD XML element.
Definition: qgssymbollayer.h:799
QgsSymbolLayer::restoreOldDataDefinedProperties
void restoreOldDataDefinedProperties(const QgsStringMap &stringMap)
Restores older data defined properties from string map.
Definition: qgssymbollayer.cpp:277
QgsSymbolLayer::Property
Property
Data definable properties.
Definition: qgssymbollayer.h:130
QgsSymbolLayer::dxfColor
virtual QColor dxfColor(QgsSymbolRenderContext &context) const
Gets color.
Definition: qgssymbollayer.cpp:151
QgsMarkerSymbolLayer::_rotatedOffset
static QPointF _rotatedOffset(QPointF offset, double angle)
Adjusts a marker offset to account for rotation.
Definition: qgssymbollayer.cpp:567
QgsMarkerSymbolLayer::offset
QPointF offset() const
Returns the marker's offset, which is the horizontal and vertical displacement which the rendered mar...
Definition: qgssymbollayer.h:721
qgsdxfexport.h
QgsVectorSimplifyMethod::simplifyHints
SimplifyHints simplifyHints() const
Gets the simplification hints of the vector layer managed.
Definition: qgsvectorsimplifymethod.h:64
QgsSymbolLayer::type
QgsSymbol::SymbolType type() const
Definition: qgssymbollayer.h:353
QgsSymbolLayer::PropertyGradientReference1X
@ PropertyGradientReference1X
Gradient reference point 1 x.
Definition: qgssymbollayer.h:152
QgsRenderContext::RenderSymbolPreview
@ RenderSymbolPreview
The render is for a symbol preview only and map based properties may not be available,...
Definition: qgsrendercontext.h:82
QgsFeature
Definition: qgsfeature.h:55
QgsPropertyCollection::setProperty
void setProperty(int key, const QgsProperty &property)
Adds a property to the collection and takes ownership of it.
Definition: qgspropertycollection.cpp:177
QgsSymbolLayer::PropertyOpacity
@ PropertyOpacity
Opacity.
Definition: qgssymbollayer.h:167
QgsSymbolRenderContext::renderContext
QgsRenderContext & renderContext()
Returns a reference to the context's render context.
Definition: qgssymbol.h:708
QgsDxfExport::symbologyScale
double symbologyScale() const
Returns the reference scale for output.
Definition: qgsdxfexport.h:227
QgsPropertyDefinition::Opacity
@ Opacity
Opacity (0-100)
Definition: qgsproperty.h:63
QgsSymbol::SymbolType
SymbolType
Type of the symbol.
Definition: qgssymbol.h:85
QgsSymbolLayer::PropertyHeight
@ PropertyHeight
Symbol height.
Definition: qgssymbollayer.h:142
QgsSymbolLayer::startRender
virtual void startRender(QgsSymbolRenderContext &context)=0
Called before a set of rendering operations commences on the supplied render context.
QgsLineSymbolLayer::widthUnit
QgsUnitTypes::RenderUnit widthUnit() const
Returns the units for the line's width.
Definition: qgssymbollayer.h:1041
QgsLineSymbolLayer::ExteriorRingOnly
@ ExteriorRingOnly
Render the exterior ring only.
Definition: qgssymbollayer.h:902
QgsSymbolLayer::PropertyOffsetX
@ PropertyOffsetX
Horizontal offset.
Definition: qgssymbollayer.h:183
QgsPaintEffect::enabled
bool enabled() const
Returns whether the effect is enabled.
Definition: qgspainteffect.h:198
QgsPropertyCollection::isActive
bool isActive(int key) const override
Returns true if the collection contains an active property with the specified key.
Definition: qgspropertycollection.cpp:258
QgsSymbolLayer::dxfWidth
virtual double dxfWidth(const QgsDxfExport &e, QgsSymbolRenderContext &context) const
Gets line width.
Definition: qgssymbollayer.cpp:137
QgsMarkerSymbolLayer::mOffsetMapUnitScale
QgsMapUnitScale mOffsetMapUnitScale
Offset map unit scale.
Definition: qgssymbollayer.h:873
QgsSymbolLayer::PropertyDisplacementY
@ PropertyDisplacementY
Vertical displacement.
Definition: qgssymbollayer.h:166
MathUtils::angle
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)
Definition: MathUtils.cpp:786
QgsMarkerSymbolLayer::stopRender
void stopRender(QgsSymbolRenderContext &context) override
Called after a set of rendering operations has finished on the supplied render context.
Definition: qgssymbollayer.cpp:448
QgsSymbolLayer::copyDataDefinedProperties
void copyDataDefinedProperties(QgsSymbolLayer *destLayer) const
Copies all data defined properties of this layer to another symbol layer.
Definition: qgssymbollayer.cpp:398
QgsSymbolLayer::PropertyPlacement
@ PropertyPlacement
Line marker placement.
Definition: qgssymbollayer.h:170
QgsSymbolLayer::PropertyPreserveAspectRatio
@ PropertyPreserveAspectRatio
Preserve aspect ratio between width and height.
Definition: qgssymbollayer.h:143
QgsPropertyDefinition::StrokeWidth
@ StrokeWidth
Line stroke width.
Definition: qgsproperty.h:73
QgsSymbolLayer::PropertyLineAngle
@ PropertyLineAngle
Line angle, or angle of hash lines for hash line symbols.
Definition: qgssymbollayer.h:147
QgsLineSymbolLayer::setMapUnitScale
void setMapUnitScale(const QgsMapUnitScale &scale) override
Definition: qgssymbollayer.cpp:646
QgsMarkerSymbolLayer::angle
double angle() const
Returns the rotation angle for the marker, in degrees clockwise from north.
Definition: qgssymbollayer.h:627
QgsSymbolLayer::PropertySecondaryColor
@ PropertySecondaryColor
Secondary color (eg for gradient fills)
Definition: qgssymbollayer.h:146
QgsSymbolLayer::dxfBrushColor
virtual QColor dxfBrushColor(QgsSymbolRenderContext &context) const
Gets brush/fill color.
Definition: qgssymbollayer.cpp:174
QgsAbstractGeometrySimplifier::isGeneralizableByDeviceBoundingBox
static bool isGeneralizableByDeviceBoundingBox(const QgsRectangle &envelope, float mapToPixelTol=1.0f)
Returns whether the device-envelope can be replaced by its BBOX when is applied the specified toleran...
Definition: qgsgeometrysimplifier.cpp:22
QgsSymbolLayer::setDataDefinedProperty
virtual void setDataDefinedProperty(Property key, const QgsProperty &property)
Sets a data defined property for the layer.
Definition: qgssymbollayer.cpp:112
QgsSymbolLayer::PropertyJoinStyle
@ PropertyJoinStyle
Line join style.
Definition: qgssymbollayer.h:145
QgsRenderContext::flags
Flags flags() const
Returns combination of flags used for rendering.
Definition: qgsrendercontext.cpp:160
QgsSymbolLayer::PropertyWidth
@ PropertyWidth
Symbol width.
Definition: qgssymbollayer.h:141
QgsPropertyDefinition::DoublePositive
@ DoublePositive
Positive double value (including 0)
Definition: qgsproperty.h:59