QGIS API Documentation  3.26.3-Buenos Aires (65e4edfdad)
qgsellipsesymbollayer.cpp
Go to the documentation of this file.
1 /***************************************************************************
2  qgsellipsesymbollayer.cpp
3  ---------------------
4  begin : June 2011
5  copyright : (C) 2011 by Marco Hugentobler
6  email : marco dot hugentobler at sourcepole dot ch
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 #include "qgsellipsesymbollayer.h"
16 #include "qgsdxfexport.h"
17 #include "qgsexpression.h"
18 #include "qgsfeature.h"
19 #include "qgsrendercontext.h"
20 #include "qgsvectorlayer.h"
21 #include "qgslogger.h"
22 #include "qgsunittypes.h"
23 #include "qgsproperty.h"
24 #include "qgssymbollayerutils.h"
25 
26 #include <QPainter>
27 #include <QSet>
28 #include <QDomDocument>
29 #include <QDomElement>
30 
32  : mStrokeColor( QColor( 35, 35, 35 ) )
33 {
34  mColor = Qt::white;
35  mPen.setColor( mStrokeColor );
36  mPen.setStyle( mStrokeStyle );
37  mPen.setJoinStyle( mPenJoinStyle );
38  mPen.setWidth( 1.0 );
39  mBrush.setColor( mColor );
40  mBrush.setStyle( Qt::SolidPattern );
41  mOffset = QPointF( 0, 0 );
42  mAngle = 0;
43 }
44 
46 
47 QgsSymbolLayer *QgsEllipseSymbolLayer::create( const QVariantMap &properties )
48 {
50  if ( properties.contains( QStringLiteral( "symbol_name" ) ) )
51  {
52  layer->setShape( decodeShape( properties[ QStringLiteral( "symbol_name" )].toString() ) );
53  }
54  if ( properties.contains( QStringLiteral( "size" ) ) )
55  {
56  layer->setSize( properties[QStringLiteral( "size" )].toDouble() );
57  }
58  if ( properties.contains( QStringLiteral( "size_unit" ) ) )
59  {
60  layer->setSizeUnit( QgsUnitTypes::decodeRenderUnit( properties[QStringLiteral( "size_unit" )].toString() ) );
61  }
62  if ( properties.contains( QStringLiteral( "size_map_unit_scale" ) ) )
63  {
64  layer->setSizeMapUnitScale( QgsSymbolLayerUtils::decodeMapUnitScale( properties[QStringLiteral( "size_map_unit_scale" )].toString() ) );
65  }
66  if ( properties.contains( QStringLiteral( "symbol_width" ) ) )
67  {
68  layer->setSymbolWidth( properties[QStringLiteral( "symbol_width" )].toDouble() );
69  }
70  if ( properties.contains( QStringLiteral( "symbol_width_unit" ) ) )
71  {
72  layer->setSymbolWidthUnit( QgsUnitTypes::decodeRenderUnit( properties[QStringLiteral( "symbol_width_unit" )].toString() ) );
73  }
74  if ( properties.contains( QStringLiteral( "symbol_width_map_unit_scale" ) ) )
75  {
76  layer->setSymbolWidthMapUnitScale( QgsSymbolLayerUtils::decodeMapUnitScale( properties[QStringLiteral( "symbol_width_map_unit_scale" )].toString() ) );
77  }
78  if ( properties.contains( QStringLiteral( "symbol_height" ) ) )
79  {
80  layer->setSymbolHeight( properties[QStringLiteral( "symbol_height" )].toDouble() );
81  }
82  if ( properties.contains( QStringLiteral( "symbol_height_unit" ) ) )
83  {
84  layer->setSymbolHeightUnit( QgsUnitTypes::decodeRenderUnit( properties[QStringLiteral( "symbol_height_unit" )].toString() ) );
85  }
86  if ( properties.contains( QStringLiteral( "symbol_height_map_unit_scale" ) ) )
87  {
88  layer->setSymbolHeightMapUnitScale( QgsSymbolLayerUtils::decodeMapUnitScale( properties[QStringLiteral( "symbol_height_map_unit_scale" )].toString() ) );
89  }
90  if ( properties.contains( QStringLiteral( "angle" ) ) )
91  {
92  layer->setAngle( properties[QStringLiteral( "angle" )].toDouble() );
93  }
94  if ( properties.contains( QStringLiteral( "outline_style" ) ) )
95  {
96  layer->setStrokeStyle( QgsSymbolLayerUtils::decodePenStyle( properties[QStringLiteral( "outline_style" )].toString() ) );
97  }
98  else if ( properties.contains( QStringLiteral( "line_style" ) ) )
99  {
100  layer->setStrokeStyle( QgsSymbolLayerUtils::decodePenStyle( properties[QStringLiteral( "line_style" )].toString() ) );
101  }
102  if ( properties.contains( QStringLiteral( "joinstyle" ) ) )
103  {
104  layer->setPenJoinStyle( QgsSymbolLayerUtils::decodePenJoinStyle( properties[QStringLiteral( "joinstyle" )].toString() ) );
105  }
106  if ( properties.contains( QStringLiteral( "cap_style" ) ) )
107  {
108  layer->setPenCapStyle( QgsSymbolLayerUtils::decodePenCapStyle( properties[QStringLiteral( "cap_style" )].toString() ) );
109  }
110  if ( properties.contains( QStringLiteral( "outline_width" ) ) )
111  {
112  layer->setStrokeWidth( properties[QStringLiteral( "outline_width" )].toDouble() );
113  }
114  else if ( properties.contains( QStringLiteral( "line_width" ) ) )
115  {
116  layer->setStrokeWidth( properties[QStringLiteral( "line_width" )].toDouble() );
117  }
118  if ( properties.contains( QStringLiteral( "outline_width_unit" ) ) )
119  {
120  layer->setStrokeWidthUnit( QgsUnitTypes::decodeRenderUnit( properties[QStringLiteral( "outline_width_unit" )].toString() ) );
121  }
122  else if ( properties.contains( QStringLiteral( "line_width_unit" ) ) )
123  {
124  layer->setStrokeWidthUnit( QgsUnitTypes::decodeRenderUnit( properties[QStringLiteral( "line_width_unit" )].toString() ) );
125  }
126  if ( properties.contains( QStringLiteral( "outline_width_map_unit_scale" ) ) )
127  {
128  layer->setStrokeWidthMapUnitScale( QgsSymbolLayerUtils::decodeMapUnitScale( properties[QStringLiteral( "outline_width_map_unit_scale" )].toString() ) );
129  }
130  if ( properties.contains( QStringLiteral( "fill_color" ) ) )
131  {
132  //pre 2.5 projects used "fill_color"
133  layer->setFillColor( QgsSymbolLayerUtils::decodeColor( properties[QStringLiteral( "fill_color" )].toString() ) );
134  }
135  else if ( properties.contains( QStringLiteral( "color" ) ) )
136  {
137  layer->setFillColor( QgsSymbolLayerUtils::decodeColor( properties[QStringLiteral( "color" )].toString() ) );
138  }
139  if ( properties.contains( QStringLiteral( "outline_color" ) ) )
140  {
141  layer->setStrokeColor( QgsSymbolLayerUtils::decodeColor( properties[QStringLiteral( "outline_color" )].toString() ) );
142  }
143  else if ( properties.contains( QStringLiteral( "line_color" ) ) )
144  {
145  layer->setStrokeColor( QgsSymbolLayerUtils::decodeColor( properties[QStringLiteral( "line_color" )].toString() ) );
146  }
147  if ( properties.contains( QStringLiteral( "offset" ) ) )
148  {
149  layer->setOffset( QgsSymbolLayerUtils::decodePoint( properties[QStringLiteral( "offset" )].toString() ) );
150  }
151  if ( properties.contains( QStringLiteral( "offset_unit" ) ) )
152  {
153  layer->setOffsetUnit( QgsUnitTypes::decodeRenderUnit( properties[QStringLiteral( "offset_unit" )].toString() ) );
154  }
155  if ( properties.contains( QStringLiteral( "offset_map_unit_scale" ) ) )
156  {
157  layer->setOffsetMapUnitScale( QgsSymbolLayerUtils::decodeMapUnitScale( properties[QStringLiteral( "offset_map_unit_scale" )].toString() ) );
158  }
159  if ( properties.contains( QStringLiteral( "horizontal_anchor_point" ) ) )
160  {
161  layer->setHorizontalAnchorPoint( QgsMarkerSymbolLayer::HorizontalAnchorPoint( properties[ QStringLiteral( "horizontal_anchor_point" )].toInt() ) );
162  }
163  if ( properties.contains( QStringLiteral( "vertical_anchor_point" ) ) )
164  {
165  layer->setVerticalAnchorPoint( QgsMarkerSymbolLayer::VerticalAnchorPoint( properties[ QStringLiteral( "vertical_anchor_point" )].toInt() ) );
166  }
167 
168  //data defined properties
170 
171  return layer;
172 }
173 
175 {
176  double scaledWidth = mSymbolWidth;
177  double scaledHeight = mSymbolHeight;
178 
179  QColor brushColor = mColor;
180  brushColor.setAlphaF( brushColor.alphaF() * context.opacity() );
181  mBrush.setColor( brushColor );
182 
183  QColor penColor = mStrokeColor;
184  penColor.setAlphaF( penColor.alphaF() * context.opacity() );
185  mPen.setColor( penColor );
186 
187  bool ok;
189  {
190  context.setOriginalValueVariable( mStrokeWidth );
192  if ( !exprVal.isNull() )
193  {
194  double width = exprVal.toDouble( &ok );
195  if ( ok )
196  {
197  width = context.renderContext().convertToPainterUnits( width, mStrokeWidthUnit, mStrokeWidthMapUnitScale );
198  mPen.setWidthF( width );
199  mSelPen.setWidthF( width );
200  }
201  }
202  }
203 
205  {
208  if ( !exprVal.isNull() )
209  {
210  mPen.setStyle( QgsSymbolLayerUtils::decodePenStyle( exprVal.toString() ) );
211  mSelPen.setStyle( mPen.style() );
212  }
213  }
214 
216  {
219  if ( !exprVal.isNull() )
220  {
221  mPen.setJoinStyle( QgsSymbolLayerUtils::decodePenJoinStyle( exprVal.toString() ) );
222  mSelPen.setJoinStyle( mPen.joinStyle() );
223  }
224  }
225 
227  {
229  const QString style = mDataDefinedProperties.valueAsString( QgsSymbolLayer::PropertyCapStyle, context.renderContext().expressionContext(), QString(), &ok );
230  if ( ok )
231  {
232  mPen.setCapStyle( QgsSymbolLayerUtils::decodePenCapStyle( style ) );
233  mSelPen.setCapStyle( QgsSymbolLayerUtils::decodePenCapStyle( style ) );
234  }
235  }
236 
238  {
241  brushColor.setAlphaF( brushColor.alphaF() * context.opacity() );
242  mBrush.setColor( brushColor );
243  }
244 
246  {
249  penColor.setAlphaF( penColor.alphaF() * context.opacity() );
250  mPen.setColor( penColor );
251  }
252 
255  {
258  if ( !exprVal.isNull() )
259  {
260  shape = decodeShape( exprVal.toString() );
261  }
262  preparePath( shape, context, &scaledWidth, &scaledHeight, context.feature() );
263  }
264 
265  //offset and rotation
266  bool hasDataDefinedRotation = false;
267  QPointF offset;
268  double angle = 0;
269  calculateOffsetAndRotation( context, scaledWidth, scaledHeight, hasDataDefinedRotation, offset, angle );
270 
271  QPainter *p = context.renderContext().painter();
272  if ( !p )
273  {
274  return;
275  }
276 
277  QTransform transform;
278  transform.translate( point.x() + offset.x(), point.y() + offset.y() );
279  if ( !qgsDoubleNear( angle, 0.0 ) )
280  {
281  transform.rotate( angle );
282  }
283 
284  if ( shapeIsFilled( shape ) )
285  {
286  p->setPen( context.selected() ? mSelPen : mPen );
287  p->setBrush( context.selected() ? mSelBrush : mBrush );
288  }
289  else
290  {
291  p->setPen( context.selected() ? mSelPen : mPen );
292  p->setBrush( QBrush() );
293  }
294  p->drawPath( transform.map( mPainterPath ) );
295 }
296 
297 
298 void QgsEllipseSymbolLayer::calculateOffsetAndRotation( QgsSymbolRenderContext &context,
299  double scaledWidth,
300  double scaledHeight,
301  bool &hasDataDefinedRotation,
302  QPointF &offset,
303  double &angle ) const
304 {
305  double offsetX = 0;
306  double offsetY = 0;
307  markerOffset( context, scaledWidth, scaledHeight, mSymbolWidthUnit, mSymbolHeightUnit, offsetX, offsetY, mSymbolWidthMapUnitScale, mSymbolHeightMapUnitScale );
308  offset = QPointF( offsetX, offsetY );
309 
310 //priority for rotation: 1. data defined symbol level, 2. symbol layer rotation (mAngle)
311  const bool ok = true;
312  angle = mAngle + mLineAngle;
313  bool usingDataDefinedRotation = false;
315  {
316  context.setOriginalValueVariable( angle );
318  usingDataDefinedRotation = ok;
319  }
320 
321  hasDataDefinedRotation = context.renderHints() & Qgis::SymbolRenderHint::DynamicRotation || usingDataDefinedRotation;
322  if ( hasDataDefinedRotation )
323  {
324  // For non-point markers, "dataDefinedRotation" means following the
325  // shape (shape-data defined). For them, "field-data defined" does
326  // not work at all. TODO: if "field-data defined" ever gets implemented
327  // we'll need a way to distinguish here between the two, possibly
328  // using another flag in renderHints()
329  const QgsFeature *f = context.feature();
330  if ( f )
331  {
332  const QgsGeometry g = f->geometry();
333  if ( !g.isNull() && g.type() == QgsWkbTypes::PointGeometry )
334  {
335  const QgsMapToPixel &m2p = context.renderContext().mapToPixel();
336  angle += m2p.mapRotation();
337  }
338  }
339  }
340 
341  if ( angle )
343 }
344 
346 {
347  return QStringLiteral( "EllipseMarker" );
348 }
349 
351 {
352  QgsMarkerSymbolLayer::startRender( context ); // get anchor point expressions
353  if ( !context.feature() || !dataDefinedProperties().hasActiveProperties() )
354  {
355  preparePath( mShape, context );
356  }
357  mPen.setColor( mStrokeColor );
358  mPen.setStyle( mStrokeStyle );
359  mPen.setJoinStyle( mPenJoinStyle );
360  mPen.setCapStyle( mPenCapStyle );
361  mPen.setWidthF( context.renderContext().convertToPainterUnits( mStrokeWidth, mStrokeWidthUnit, mStrokeWidthMapUnitScale ) );
362  mBrush.setColor( mColor );
363 
364  QColor selBrushColor = context.renderContext().selectionColor();
365  QColor selPenColor = selBrushColor == mColor ? selBrushColor : mStrokeColor;
366  if ( context.opacity() < 1 && !SELECTION_IS_OPAQUE )
367  {
368  selBrushColor.setAlphaF( context.opacity() );
369  selPenColor.setAlphaF( context.opacity() );
370  }
371  mSelBrush = QBrush( selBrushColor );
372  mSelPen = QPen( !shapeIsFilled( mShape ) ? selBrushColor : selPenColor );
373  mSelPen.setStyle( mStrokeStyle );
374  mSelPen.setWidthF( context.renderContext().convertToPainterUnits( mStrokeWidth, mStrokeWidthUnit, mStrokeWidthMapUnitScale ) );
375 }
376 
378 {
379 }
380 
382 {
384  m->setShape( mShape );
385  m->setSymbolWidth( mSymbolWidth );
386  m->setSymbolHeight( mSymbolHeight );
387  m->setStrokeStyle( mStrokeStyle );
388  m->setOffset( mOffset );
391  m->setStrokeStyle( mStrokeStyle );
392  m->setPenJoinStyle( mPenJoinStyle );
393  m->setPenCapStyle( mPenCapStyle );
394  m->setStrokeWidth( mStrokeWidth );
395  m->setColor( color() );
396  m->setStrokeColor( mStrokeColor );
397  m->setSymbolWidthUnit( mSymbolWidthUnit );
398  m->setSymbolWidthMapUnitScale( mSymbolWidthMapUnitScale );
399  m->setSymbolHeightUnit( mSymbolHeightUnit );
400  m->setSymbolHeightMapUnitScale( mSymbolHeightMapUnitScale );
401  m->setStrokeWidthUnit( mStrokeWidthUnit );
402  m->setStrokeWidthMapUnitScale( mStrokeWidthMapUnitScale );
403  m->setAngle( mAngle );
406 
408  copyPaintEffect( m );
409  return m;
410 }
411 
412 void QgsEllipseSymbolLayer::toSld( QDomDocument &doc, QDomElement &element, const QVariantMap &props ) const
413 {
414  QDomElement symbolizerElem = doc.createElement( QStringLiteral( "se:PointSymbolizer" ) );
415  if ( !props.value( QStringLiteral( "uom" ), QString() ).toString().isEmpty() )
416  symbolizerElem.setAttribute( QStringLiteral( "uom" ), props.value( QStringLiteral( "uom" ), QString() ).toString() );
417  element.appendChild( symbolizerElem );
418 
419  // <Geometry>
420  QgsSymbolLayerUtils::createGeometryElement( doc, symbolizerElem, props.value( QStringLiteral( "geom" ), QString() ).toString() );
421 
422  writeSldMarker( doc, symbolizerElem, props );
423 }
424 
425 void QgsEllipseSymbolLayer::writeSldMarker( QDomDocument &doc, QDomElement &element, const QVariantMap &props ) const
426 {
427  // <Graphic>
428  QDomElement graphicElem = doc.createElement( QStringLiteral( "se:Graphic" ) );
429  element.appendChild( graphicElem );
430 
431  const double strokeWidth = QgsSymbolLayerUtils::rescaleUom( mStrokeWidth, mStrokeWidthUnit, props );
432  const double symbolWidth = QgsSymbolLayerUtils::rescaleUom( mSymbolWidth, mSymbolWidthUnit, props );
433  QgsSymbolLayerUtils::wellKnownMarkerToSld( doc, graphicElem, encodeShape( mShape ), mColor, mStrokeColor, mStrokeStyle, strokeWidth, symbolWidth );
434 
435  // <Rotation>
437 
438  QString angleFunc = props.value( QStringLiteral( "angle" ), QString() ).toString();
439  if ( angleFunc.isEmpty() ) // symbol has no angle set
440  {
441  if ( ddRotation && ddRotation.isActive() )
442  {
443  angleFunc = ddRotation.asExpression();
444  }
445  else if ( !qgsDoubleNear( mAngle, 0.0 ) )
446  angleFunc = QString::number( mAngle );
447  }
448  else if ( ddRotation && ddRotation.isActive() )
449  {
450  // the symbol has an angle and the symbol layer have a rotation
451  // property set
452  angleFunc = QStringLiteral( "%1 + %2" ).arg( angleFunc, ddRotation.asExpression() );
453  }
454  else if ( !qgsDoubleNear( mAngle, 0.0 ) )
455  {
456  // both the symbol and the symbol layer have angle value set
457  bool ok;
458  const double angle = angleFunc.toDouble( &ok );
459  if ( !ok )
460  {
461  // its a string (probably a property name or a function)
462  angleFunc = QStringLiteral( "%1 + %2" ).arg( angleFunc ).arg( mAngle );
463  }
464  else if ( !qgsDoubleNear( angle + mAngle, 0.0 ) )
465  {
466  // it's a double value
467  angleFunc = QString::number( angle + mAngle );
468  }
469  }
470  QgsSymbolLayerUtils::createRotationElement( doc, graphicElem, angleFunc );
471 
472  // <Displacement>
473  const QPointF offset = QgsSymbolLayerUtils::rescaleUom( mOffset, mOffsetUnit, props );
475 
476  // store w/h factor in a <VendorOption>
477  const double widthHeightFactor = mSymbolWidth / mSymbolHeight;
478  const QDomElement factorElem = QgsSymbolLayerUtils::createVendorOptionElement( doc, QStringLiteral( "widthHeightFactor" ), QString::number( widthHeightFactor ) );
479  graphicElem.appendChild( factorElem );
480 }
481 
483 {
484  QgsDebugMsgLevel( QStringLiteral( "Entered." ), 4 );
485 
486  QDomElement graphicElem = element.firstChildElement( QStringLiteral( "Graphic" ) );
487  if ( graphicElem.isNull() )
488  return nullptr;
489 
490  QString name = QStringLiteral( "circle" );
491  QColor fillColor, strokeColor;
492  double strokeWidth, size;
493  double widthHeightFactor = 1.0;
494  Qt::PenStyle strokeStyle;
495 
496  QgsStringMap vendorOptions = QgsSymbolLayerUtils::getVendorOptionList( graphicElem );
497  for ( QgsStringMap::iterator it = vendorOptions.begin(); it != vendorOptions.end(); ++it )
498  {
499  if ( it.key() == QLatin1String( "widthHeightFactor" ) )
500  {
501  bool ok;
502  const double v = it.value().toDouble( &ok );
503  if ( ok && !qgsDoubleNear( v, 0.0 ) && v > 0 )
504  widthHeightFactor = v;
505  }
506  }
507 
509  return nullptr;
510 
511  double scaleFactor = 1.0;
512  const QString uom = element.attribute( QStringLiteral( "uom" ) );
513  QgsUnitTypes::RenderUnit sldUnitSize = QgsSymbolLayerUtils::decodeSldUom( uom, &scaleFactor );
514  size = size * scaleFactor;
515  strokeWidth = strokeWidth * scaleFactor;
516 
517  double angle = 0.0;
518  QString angleFunc;
519  if ( QgsSymbolLayerUtils::rotationFromSldElement( graphicElem, angleFunc ) )
520  {
521  bool ok;
522  const double d = angleFunc.toDouble( &ok );
523  if ( ok )
524  angle = d;
525  }
526 
528  m->setOutputUnit( sldUnitSize );
529  m->setShape( decodeShape( name ) );
530  m->setFillColor( fillColor );
534  m->setSymbolWidth( size );
535  m->setSymbolHeight( size / widthHeightFactor );
536  m->setAngle( angle );
537  return m;
538 }
539 
541 {
542  QVariantMap map;
543  map[QStringLiteral( "symbol_name" )] = encodeShape( mShape );
544  map[QStringLiteral( "symbol_width" )] = QString::number( mSymbolWidth );
545  map[QStringLiteral( "symbol_width_unit" )] = QgsUnitTypes::encodeUnit( mSymbolWidthUnit );
546  map[QStringLiteral( "symbol_width_map_unit_scale" )] = QgsSymbolLayerUtils::encodeMapUnitScale( mSymbolWidthMapUnitScale );
547  map[QStringLiteral( "symbol_height" )] = QString::number( mSymbolHeight );
548  map[QStringLiteral( "symbol_height_unit" )] = QgsUnitTypes::encodeUnit( mSymbolHeightUnit );
549  map[QStringLiteral( "symbol_height_map_unit_scale" )] = QgsSymbolLayerUtils::encodeMapUnitScale( mSymbolHeightMapUnitScale );
550  map[QStringLiteral( "angle" )] = QString::number( mAngle );
551  map[QStringLiteral( "outline_style" )] = QgsSymbolLayerUtils::encodePenStyle( mStrokeStyle );
552  map[QStringLiteral( "outline_width" )] = QString::number( mStrokeWidth );
553  map[QStringLiteral( "outline_width_unit" )] = QgsUnitTypes::encodeUnit( mStrokeWidthUnit );
554  map[QStringLiteral( "outline_width_map_unit_scale" )] = QgsSymbolLayerUtils::encodeMapUnitScale( mStrokeWidthMapUnitScale );
555  map[QStringLiteral( "joinstyle" )] = QgsSymbolLayerUtils::encodePenJoinStyle( mPenJoinStyle );
556  map[QStringLiteral( "cap_style" )] = QgsSymbolLayerUtils::encodePenCapStyle( mPenCapStyle );
557  map[QStringLiteral( "color" )] = QgsSymbolLayerUtils::encodeColor( mColor );
558  map[QStringLiteral( "outline_color" )] = QgsSymbolLayerUtils::encodeColor( mStrokeColor );
559  map[QStringLiteral( "offset" )] = QgsSymbolLayerUtils::encodePoint( mOffset );
560  map[QStringLiteral( "offset_unit" )] = QgsUnitTypes::encodeUnit( mOffsetUnit );
561  map[QStringLiteral( "offset_map_unit_scale" )] = QgsSymbolLayerUtils::encodeMapUnitScale( mOffsetMapUnitScale );
562  map[QStringLiteral( "size" )] = QString::number( mSize );
563  map[QStringLiteral( "size_unit" )] = QgsUnitTypes::encodeUnit( mSizeUnit );
564  map[QStringLiteral( "size_map_unit_scale" )] = QgsSymbolLayerUtils::encodeMapUnitScale( mSizeMapUnitScale );
565  map[QStringLiteral( "horizontal_anchor_point" )] = QString::number( mHorizontalAnchorPoint );
566  map[QStringLiteral( "vertical_anchor_point" )] = QString::number( mVerticalAnchorPoint );
567  return map;
568 }
569 
570 QSizeF QgsEllipseSymbolLayer::calculateSize( QgsSymbolRenderContext &context, double *scaledWidth, double *scaledHeight )
571 {
572  double width = 0;
573 
574  if ( mDataDefinedProperties.isActive( QgsSymbolLayer::PropertyWidth ) ) //1. priority: data defined setting on symbol layer le
575  {
576  context.setOriginalValueVariable( mSymbolWidth );
578  }
579  else //2. priority: global width setting
580  {
581  width = mSymbolWidth;
582  }
583  if ( scaledWidth )
584  {
585  *scaledWidth = width;
586  }
587  width = context.renderContext().convertToPainterUnits( width, mSymbolWidthUnit, mSymbolHeightMapUnitScale );
588 
589  double height = 0;
590  if ( mDataDefinedProperties.isActive( QgsSymbolLayer::PropertyHeight ) ) //1. priority: data defined setting on symbol layer level
591  {
592  context.setOriginalValueVariable( mSymbolHeight );
594  }
595  else //2. priority: global height setting
596  {
597  height = mSymbolHeight;
598  }
599  if ( scaledHeight )
600  {
601  *scaledHeight = height;
602  }
603  height = context.renderContext().convertToPainterUnits( height, mSymbolHeightUnit, mSymbolHeightMapUnitScale );
604  return QSizeF( width, height );
605 }
606 
607 void QgsEllipseSymbolLayer::preparePath( const QgsEllipseSymbolLayer::Shape &shape, QgsSymbolRenderContext &context, double *scaledWidth, double *scaledHeight, const QgsFeature * )
608 {
609  mPainterPath = QPainterPath();
610 
611  const QSizeF size = calculateSize( context, scaledWidth, scaledHeight );
612 
613  switch ( shape )
614  {
615  case Circle:
616  mPainterPath.addEllipse( QRectF( -size.width() / 2.0, -size.height() / 2.0, size.width(), size.height() ) );
617  return;
618 
619  case SemiCircle:
620  mPainterPath.arcTo( -size.width() / 2.0, -size.height() / 2.0, size.width(), size.height(), 0, 180 );
621  mPainterPath.lineTo( 0, 0 );
622  return;
623 
624  case Rectangle:
625  mPainterPath.addRect( QRectF( -size.width() / 2.0, -size.height() / 2.0, size.width(), size.height() ) );
626  return;
627 
628  case Diamond:
629  mPainterPath.moveTo( -size.width() / 2.0, 0 );
630  mPainterPath.lineTo( 0, size.height() / 2.0 );
631  mPainterPath.lineTo( size.width() / 2.0, 0 );
632  mPainterPath.lineTo( 0, -size.height() / 2.0 );
633  mPainterPath.lineTo( -size.width() / 2.0, 0 );
634  return;
635 
636  case Cross:
637  mPainterPath.moveTo( 0, -size.height() / 2.0 );
638  mPainterPath.lineTo( 0, size.height() / 2.0 );
639  mPainterPath.moveTo( -size.width() / 2.0, 0 );
640  mPainterPath.lineTo( size.width() / 2.0, 0 );
641  return;
642 
643  case Arrow:
644  mPainterPath.moveTo( -size.width() / 2.0, size.height() / 2.0 );
645  mPainterPath.lineTo( 0, -size.height() / 2.0 );
646  mPainterPath.lineTo( size.width() / 2.0, size.height() / 2.0 );
647  return;
648 
649  case HalfArc:
650  mPainterPath.moveTo( size.width() / 2.0, 0 );
651  mPainterPath.arcTo( -size.width() / 2.0, -size.height() / 2.0, size.width(), size.height(), 0, 180 );
652  return;
653 
654  case Triangle:
655  mPainterPath.moveTo( 0, -size.height() / 2.0 );
656  mPainterPath.lineTo( -size.width() / 2.0, size.height() / 2.0 );
657  mPainterPath.lineTo( size.width() / 2.0, size.height() / 2.0 );
658  mPainterPath.lineTo( 0, -size.height() / 2.0 );
659  return;
660 
661  case LeftHalfTriangle:
662  mPainterPath.moveTo( 0, size.height() / 2.0 );
663  mPainterPath.lineTo( size.width() / 2.0, size.height() / 2.0 );
664  mPainterPath.lineTo( 0, -size.height() / 2.0 );
665  mPainterPath.lineTo( 0, size.height() / 2.0 );
666  return;
667 
668  case RightHalfTriangle:
669  mPainterPath.moveTo( -size.width() / 2.0, size.height() / 2.0 );
670  mPainterPath.lineTo( 0, size.height() / 2.0 );
671  mPainterPath.lineTo( 0, -size.height() / 2.0 );
672  mPainterPath.lineTo( -size.width() / 2.0, size.height() / 2.0 );
673  return;
674  }
675 }
676 
678 {
679  switch ( shape )
680  {
681  case Circle:
682  case Rectangle:
683  case Diamond:
684  case Triangle:
685  case RightHalfTriangle:
686  case LeftHalfTriangle:
687  case SemiCircle:
688  return true;
689 
690  case Cross:
691  case Arrow:
692  case HalfArc:
693  return false;
694  }
695 
696  return true;
697 }
698 
700 {
701  if ( mSymbolWidth >= mSymbolHeight )
702  {
703  mSymbolHeight = mSymbolHeight * size / mSymbolWidth;
704  mSymbolWidth = size;
705  }
706  else
707  {
708  mSymbolWidth = mSymbolWidth * size / mSymbolHeight;
709  mSymbolHeight = size;
710  }
712 }
713 
715 {
716  mSymbolWidth = w;
717  QgsMarkerSymbolLayer::setSize( mSymbolWidth >= mSymbolHeight ? mSymbolWidth : mSymbolHeight );
718 }
719 
721 {
722  mSymbolHeight = h;
723  QgsMarkerSymbolLayer::setSize( mSymbolWidth >= mSymbolHeight ? mSymbolWidth : mSymbolHeight );
724 }
725 
727 {
729  mSymbolWidthUnit = unit;
730  mSymbolHeightUnit = unit;
731  mStrokeWidthUnit = unit;
732 }
733 
735 {
737  if ( mSymbolWidthUnit != unit || mSymbolHeightUnit != unit || mStrokeWidthUnit != unit )
738  {
740  }
741  return unit;
742 }
743 
745 {
746  return mSymbolWidthUnit == QgsUnitTypes::RenderMapUnits || mSymbolWidthUnit == QgsUnitTypes::RenderMetersInMapUnits
747  || mSymbolHeightUnit == QgsUnitTypes::RenderMapUnits || mSymbolHeightUnit == QgsUnitTypes::RenderMetersInMapUnits
748  || mStrokeWidthUnit == QgsUnitTypes::RenderMapUnits || mStrokeWidthUnit == QgsUnitTypes::RenderMetersInMapUnits
750 }
751 
753 {
755  mSymbolWidthMapUnitScale = scale;
756  mSymbolHeightMapUnitScale = scale;
757  mStrokeWidthMapUnitScale = scale;
758 }
759 
761 {
762  if ( QgsMarkerSymbolLayer::mapUnitScale() == mSymbolWidthMapUnitScale &&
763  mSymbolWidthMapUnitScale == mSymbolHeightMapUnitScale &&
764  mSymbolHeightMapUnitScale == mStrokeWidthMapUnitScale )
765  {
766  return mSymbolWidthMapUnitScale;
767  }
768  return QgsMapUnitScale();
769 }
770 
771 QRectF QgsEllipseSymbolLayer::bounds( QPointF point, QgsSymbolRenderContext &context )
772 {
773  const QSizeF size = calculateSize( context );
774 
775  bool hasDataDefinedRotation = false;
776  QPointF offset;
777  double angle = 0;
778  calculateOffsetAndRotation( context, size.width(), size.height(), hasDataDefinedRotation, offset, angle );
779 
780  QTransform transform;
781 
782  // move to the desired position
783  transform.translate( point.x() + offset.x(), point.y() + offset.y() );
784 
785  if ( !qgsDoubleNear( angle, 0.0 ) )
786  transform.rotate( angle );
787 
788  double penWidth = mStrokeWidth;
790  {
791  context.setOriginalValueVariable( mStrokeWidth );
793 
794  if ( !exprVal.isNull() )
795  {
796  bool ok;
797  const double strokeWidth = exprVal.toDouble( &ok );
798  if ( ok )
799  {
800  penWidth = strokeWidth;
801  }
802  }
803  }
804  penWidth = context.renderContext().convertToPainterUnits( penWidth, mStrokeWidthUnit, mStrokeWidthMapUnitScale );
805 
807  {
810  if ( !exprVal.isNull() && exprVal.toString() == QLatin1String( "no" ) )
811  {
812  penWidth = 0.0;
813  }
814  }
815  else if ( mStrokeStyle == Qt::NoPen )
816  penWidth = 0;
817 
818  //antialiasing, add 1 pixel
819  penWidth += 1;
820 
821  QRectF symbolBounds = transform.mapRect( QRectF( -size.width() / 2.0,
822  -size.height() / 2.0,
823  size.width(),
824  size.height() ) );
825 
826  //extend bounds by pen width / 2.0
827  symbolBounds.adjust( -penWidth / 2.0, -penWidth / 2.0,
828  penWidth / 2.0, penWidth / 2.0 );
829 
830  return symbolBounds;
831 }
832 
833 bool QgsEllipseSymbolLayer::writeDxf( QgsDxfExport &e, double mmMapUnitScaleFactor, const QString &layerName, QgsSymbolRenderContext &context, QPointF shift ) const
834 {
835  //width
836  double symbolWidth = mSymbolWidth;
837 
838  if ( mDataDefinedProperties.isActive( QgsSymbolLayer::PropertyWidth ) ) //1. priority: data defined setting on symbol layer le
839  {
840  context.setOriginalValueVariable( mSymbolWidth );
842  }
843  if ( mSymbolWidthUnit == QgsUnitTypes::RenderMillimeters )
844  {
845  symbolWidth *= mmMapUnitScaleFactor;
846  }
847 
848  //height
849  double symbolHeight = mSymbolHeight;
850  if ( mDataDefinedProperties.isActive( QgsSymbolLayer::PropertyHeight ) ) //1. priority: data defined setting on symbol layer level
851  {
852  context.setOriginalValueVariable( mSymbolHeight );
854  }
855  if ( mSymbolHeightUnit == QgsUnitTypes::RenderMillimeters )
856  {
857  symbolHeight *= mmMapUnitScaleFactor;
858  }
859 
860  //stroke width
861  double strokeWidth = mStrokeWidth;
862 
864  {
865  context.setOriginalValueVariable( mStrokeWidth );
867  }
868  if ( mStrokeWidthUnit == QgsUnitTypes::RenderMillimeters )
869  {
871  }
872 
873  //fill color
874  QColor fc = mColor;
876  {
879  }
880 
881  //stroke color
882  QColor oc = mStrokeColor;
884  {
887  }
888 
889  //symbol name
892  {
895  }
896 
897  //offset
898  double offsetX = 0;
899  double offsetY = 0;
900  markerOffset( context, offsetX, offsetY );
901  QPointF off( offsetX, offsetY );
902 
903  //priority for rotation: 1. data defined symbol level, 2. symbol layer rotation (mAngle)
904  double rotation = 0.0;
906  {
907  context.setOriginalValueVariable( mAngle );
909  }
910  else if ( !qgsDoubleNear( mAngle + mLineAngle, 0.0 ) )
911  {
912  rotation = mAngle + mLineAngle;
913  }
914  rotation = -rotation; //rotation in Qt is counterclockwise
915  if ( rotation )
916  off = _rotatedOffset( off, rotation );
917 
918  QTransform t;
919  t.translate( shift.x() + offsetX, shift.y() + offsetY );
920 
921  if ( !qgsDoubleNear( rotation, 0.0 ) )
922  t.rotate( rotation );
923 
924  const double halfWidth = symbolWidth / 2.0;
925  const double halfHeight = symbolHeight / 2.0;
926 
927  switch ( shape )
928  {
929  case Circle:
930  {
931  if ( qgsDoubleNear( halfWidth, halfHeight ) )
932  {
933  const QgsPoint pt( t.map( QPointF( 0, 0 ) ) );
934  e.writeFilledCircle( layerName, oc, pt, halfWidth );
935  }
936  else
937  {
938  QgsPointSequence line;
939 
940  const double stepsize = 2 * M_PI / 40;
941  for ( int i = 0; i < 39; ++i )
942  {
943  const double angle = stepsize * i;
944  const double x = halfWidth * std::cos( angle );
945  const double y = halfHeight * std::sin( angle );
946  line << QgsPoint( t.map( QPointF( x, y ) ) );
947  }
948  //close ellipse with first point
949  line << line.at( 0 );
950 
951  if ( mBrush.style() != Qt::NoBrush )
952  e.writePolygon( QgsRingSequence() << line, layerName, QStringLiteral( "SOLID" ), fc );
953  if ( mPen.style() != Qt::NoPen )
954  e.writePolyline( line, layerName, QStringLiteral( "CONTINUOUS" ), oc, strokeWidth );
955  }
956  return true;
957  }
958 
959  case Rectangle:
960  {
962  p << QgsPoint( t.map( QPointF( -halfWidth, -halfHeight ) ) )
963  << QgsPoint( t.map( QPointF( halfWidth, -halfHeight ) ) )
964  << QgsPoint( t.map( QPointF( halfWidth, halfHeight ) ) )
965  << QgsPoint( t.map( QPointF( -halfWidth, halfHeight ) ) );
966  p << p[0];
967 
968  if ( mBrush.style() != Qt::NoBrush )
969  e.writePolygon( QgsRingSequence() << p, layerName, QStringLiteral( "SOLID" ), fc );
970  if ( mPen.style() != Qt::NoPen )
971  e.writePolyline( p, layerName, QStringLiteral( "CONTINUOUS" ), oc, strokeWidth );
972  return true;
973  }
974  case Cross:
975  {
976  if ( mPen.style() != Qt::NoPen )
977  {
979  << QgsPoint( t.map( QPointF( -halfWidth, 0 ) ) )
980  << QgsPoint( t.map( QPointF( halfWidth, 0 ) ) ),
981  layerName, QStringLiteral( "CONTINUOUS" ), oc, strokeWidth );
983  << QgsPoint( t.map( QPointF( 0, halfHeight ) ) )
984  << QgsPoint( t.map( QPointF( 0, -halfHeight ) ) ),
985  layerName, QStringLiteral( "CONTINUOUS" ), oc, strokeWidth );
986  return true;
987  }
988  break;
989  }
990 
991  case Triangle:
992  {
994  p << QgsPoint( t.map( QPointF( -halfWidth, -halfHeight ) ) )
995  << QgsPoint( t.map( QPointF( halfWidth, -halfHeight ) ) )
996  << QgsPoint( t.map( QPointF( 0, halfHeight ) ) );
997  p << p[0];
998  if ( mBrush.style() != Qt::NoBrush )
999  e.writePolygon( QgsRingSequence() << p, layerName, QStringLiteral( "SOLID" ), fc );
1000  if ( mPen.style() != Qt::NoPen )
1001  e.writePolyline( p, layerName, QStringLiteral( "CONTINUOUS" ), oc, strokeWidth );
1002  return true;
1003  }
1004 
1005  case Diamond:
1006  case Arrow:
1007  case HalfArc:
1008  case RightHalfTriangle:
1009  case LeftHalfTriangle:
1010  case SemiCircle:
1011  return false;
1012  }
1013 
1014  return false;
1015 }
1016 
1018 {
1019  if ( ok )
1020  *ok = true;
1021  const QString cleaned = name.toLower().trimmed();
1022 
1023  if ( cleaned == QLatin1String( "circle" ) )
1024  return Circle;
1025  else if ( cleaned == QLatin1String( "square" ) || cleaned == QLatin1String( "rectangle" ) )
1026  return Rectangle;
1027  else if ( cleaned == QLatin1String( "diamond" ) )
1028  return Diamond;
1029  else if ( cleaned == QLatin1String( "cross" ) )
1030  return Cross;
1031  else if ( cleaned == QLatin1String( "arrow" ) )
1032  return Arrow;
1033  else if ( cleaned == QLatin1String( "half_arc" ) )
1034  return HalfArc;
1035  else if ( cleaned == QLatin1String( "triangle" ) )
1036  return Triangle;
1037  else if ( cleaned == QLatin1String( "right_half_triangle" ) )
1038  return RightHalfTriangle;
1039  else if ( cleaned == QLatin1String( "left_half_triangle" ) )
1040  return LeftHalfTriangle;
1041  else if ( cleaned == QLatin1String( "semi_circle" ) )
1042  return SemiCircle;
1043 
1044  if ( ok )
1045  *ok = false;
1046  return Circle;
1047 }
1048 
1050 {
1051  switch ( shape )
1052  {
1053  case Circle:
1054  return QStringLiteral( "circle" );
1055  case Rectangle:
1056  return QStringLiteral( "rectangle" );
1057  case Diamond:
1058  return QStringLiteral( "diamond" );
1059  case Cross:
1060  return QStringLiteral( "cross" );
1061  case Arrow:
1062  return QStringLiteral( "arrow" );
1063  case HalfArc:
1064  return QStringLiteral( "half_arc" );
1065  case Triangle:
1066  return QStringLiteral( "triangle" );
1067  case RightHalfTriangle:
1068  return QStringLiteral( "right_half_triangle" );
1069  case LeftHalfTriangle:
1070  return QStringLiteral( "left_half_triangle" );
1071  case SemiCircle:
1072  return QStringLiteral( "semi_circle" );
1073  }
1074  return QString();
1075 }
1076 
1077 QList<QgsEllipseSymbolLayer::Shape> QgsEllipseSymbolLayer::availableShapes()
1078 {
1079  QList< Shape > shapes;
1080  shapes << Circle
1081  << Rectangle
1082  << Diamond
1083  << Cross
1084  << Arrow
1085  << HalfArc
1086  << Triangle
1087  << LeftHalfTriangle
1089  << SemiCircle;
1090  return shapes;
1091 }
QgsEllipseSymbolLayer::setStrokeWidthUnit
void setStrokeWidthUnit(QgsUnitTypes::RenderUnit unit)
Sets the units for the symbol's stroke width.
Definition: qgsellipsesymbollayer.h:223
QgsEllipseSymbolLayer::Cross
@ Cross
Stroke-only cross.
Definition: qgsellipsesymbollayer.h:41
QgsEllipseSymbolLayer::stopRender
void stopRender(QgsSymbolRenderContext &context) override
Called after a set of rendering operations has finished on the supplied render context.
Definition: qgsellipsesymbollayer.cpp:377
QgsSymbolRenderContext::setOriginalValueVariable
void setOriginalValueVariable(const QVariant &value)
Sets the original value variable value for data defined symbology.
Definition: qgssymbolrendercontext.cpp:36
QgsProperty::isActive
bool isActive() const
Returns whether the property is currently active.
Definition: qgsproperty.cpp:291
QgsEllipseSymbolLayer::strokeStyle
Qt::PenStyle strokeStyle() const
Definition: qgsellipsesymbollayer.h:138
QgsMarkerSymbolLayer::setSizeUnit
void setSizeUnit(QgsUnitTypes::RenderUnit unit)
Sets the units for the symbol's size.
Definition: qgssymbollayer.h:794
QgsEllipseSymbolLayer::strokeWidth
double strokeWidth() const
Definition: qgsellipsesymbollayer.h:174
QgsAbstractPropertyCollection::valueAsDouble
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.
Definition: qgspropertycollection.cpp:66
QgsSymbolLayerUtils::encodeColor
static QString encodeColor(const QColor &color)
Definition: qgssymbollayerutils.cpp:64
QgsMarkerSymbolLayer::setHorizontalAnchorPoint
void setHorizontalAnchorPoint(HorizontalAnchorPoint h)
Sets the horizontal anchor point for positioning the symbol.
Definition: qgssymbollayer.h:894
QgsMarkerSymbolLayer::VerticalAnchorPoint
VerticalAnchorPoint
Symbol vertical anchor points.
Definition: qgssymbollayer.h:718
QgsSymbolLayer::mColor
QColor mColor
Definition: qgssymbollayer.h:648
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:258
QgsMarkerSymbolLayer::size
double size() const
Returns the symbol size.
Definition: qgssymbollayer.h:785
QgsSymbolLayer::setColor
virtual void setColor(const QColor &color)
Sets the "representative" color for the symbol layer.
Definition: qgssymbollayer.cpp:252
QgsSymbolLayer::dataDefinedProperties
QgsPropertyCollection & dataDefinedProperties()
Returns a reference to the symbol layer's property collection, used for data defined overrides.
Definition: qgssymbollayer.h:595
QgsProperty
A store for object properties.
Definition: qgsproperty.h:230
QgsUnitTypes::RenderUnit
RenderUnit
Rendering size units.
Definition: qgsunittypes.h:167
QgsDxfExport
Exports QGIS layers to the DXF format.
Definition: qgsdxfexport.h:64
QgsMarkerSymbolLayer::mSizeMapUnitScale
QgsMapUnitScale mSizeMapUnitScale
Marker size map unit scale.
Definition: qgssymbollayer.h:997
QgsRenderContext::expressionContext
QgsExpressionContext & expressionContext()
Gets the expression context.
Definition: qgsrendercontext.h:625
QgsEllipseSymbolLayer::mapUnitScale
QgsMapUnitScale mapUnitScale() const override
Definition: qgsellipsesymbollayer.cpp:760
QgsSymbolLayerUtils::wellKnownMarkerFromSld
static bool wellKnownMarkerFromSld(QDomElement &element, QString &name, QColor &color, QColor &strokeColor, Qt::PenStyle &strokeStyle, double &strokeWidth, double &size)
Definition: qgssymbollayerutils.cpp:2660
QgsMarkerSymbolLayer::mapUnitScale
QgsMapUnitScale mapUnitScale() const override
Definition: qgssymbollayer.cpp:712
QgsSymbolLayerUtils::encodeMapUnitScale
static QString encodeMapUnitScale(const QgsMapUnitScale &mapUnitScale)
Definition: qgssymbollayerutils.cpp:666
QgsPoint
Point geometry type, with support for z-dimension and m-values.
Definition: qgspoint.h:48
QgsDxfExport::writePolygon
void writePolygon(const QgsRingSequence &polygon, const QString &layer, const QString &hatchPattern, const QColor &color)
Draw dxf filled polygon (HATCH)
Definition: qgsdxfexport.cpp:1183
QgsDebugMsgLevel
#define QgsDebugMsgLevel(str, level)
Definition: qgslogger.h:39
QgsSymbolRenderContext::feature
const QgsFeature * feature() const
Returns the current feature being rendered.
Definition: qgssymbolrendercontext.h:143
QgsEllipseSymbolLayer::strokeColor
QColor strokeColor() const override
Returns the stroke color for the symbol layer.
Definition: qgsellipsesymbollayer.h:180
QgsEllipseSymbolLayer::SemiCircle
@ SemiCircle
Semi circle.
Definition: qgsellipsesymbollayer.h:47
qgsexpression.h
QgsSymbolLayer::PropertyFillColor
@ PropertyFillColor
Fill color.
Definition: qgssymbollayer.h:147
QgsEllipseSymbolLayer::setOutputUnit
void setOutputUnit(QgsUnitTypes::RenderUnit unit) override
Sets the units to use for sizes and widths within the symbol layer.
Definition: qgsellipsesymbollayer.cpp:726
qgssymbollayerutils.h
QgsMarkerSymbolLayer::setAngle
void setAngle(double angle)
Sets the rotation angle for the marker.
Definition: qgssymbollayer.h:751
QgsEllipseSymbolLayer::shapeIsFilled
static bool shapeIsFilled(const QgsEllipseSymbolLayer::Shape &shape)
Returns true if a shape has a fill.
Definition: qgsellipsesymbollayer.cpp:677
QgsEllipseSymbolLayer::setFillColor
void setFillColor(const QColor &c) override
Sets the fill color for the symbol layer.
Definition: qgsellipsesymbollayer.h:176
QgsSymbolRenderContext::opacity
qreal opacity() const
Returns the opacity for the symbol.
Definition: qgssymbolrendercontext.h:105
QgsSymbolLayerUtils::encodePenCapStyle
static QString encodePenCapStyle(Qt::PenCapStyle style)
Definition: qgssymbollayerutils.cpp:235
QgsEllipseSymbolLayer::decodeShape
static QgsEllipseSymbolLayer::Shape decodeShape(const QString &name, bool *ok=nullptr)
Attempts to decode a string representation of a shape name to the corresponding shape.
Definition: qgsellipsesymbollayer.cpp:1017
qgsfeature.h
QgsProperty::asExpression
QString asExpression() const
Returns an expression string representing the state of the property, or an empty string if the proper...
Definition: qgsproperty.cpp:398
QgsFeature::geometry
QgsGeometry geometry
Definition: qgsfeature.h:71
QgsEllipseSymbolLayer::setMapUnitScale
void setMapUnitScale(const QgsMapUnitScale &scale) override
Definition: qgsellipsesymbollayer.cpp:752
QgsMarkerSymbolLayer::startRender
void startRender(QgsSymbolRenderContext &context) override
Called before a set of rendering operations commences on the supplied render context.
Definition: qgssymbollayer.cpp:528
QgsSymbolLayer::SELECTION_IS_OPAQUE
static const bool SELECTION_IS_OPAQUE
Whether styles for selected features ignore symbol alpha.
Definition: qgssymbollayer.h:661
qgsunittypes.h
QgsUnitTypes::RenderMillimeters
@ RenderMillimeters
Millimeters.
Definition: qgsunittypes.h:169
QgsEllipseSymbolLayer::outputUnit
QgsUnitTypes::RenderUnit outputUnit() const override
Returns the units to use for sizes and widths within the symbol layer.
Definition: qgsellipsesymbollayer.cpp:734
QgsEllipseSymbolLayer::renderPoint
void renderPoint(QPointF point, QgsSymbolRenderContext &context) override
Renders a marker at the specified point.
Definition: qgsellipsesymbollayer.cpp:174
QgsSymbolLayer::PropertyCapStyle
@ PropertyCapStyle
Line cap style.
Definition: qgssymbollayer.h:181
QgsSymbolLayerUtils::encodePenStyle
static QString encodePenStyle(Qt::PenStyle style)
Definition: qgssymbollayerutils.cpp:153
QgsMarkerSymbolLayer::setMapUnitScale
void setMapUnitScale(const QgsMapUnitScale &scale) override
Definition: qgssymbollayer.cpp:706
QgsMarkerSymbolLayer::mSizeUnit
QgsUnitTypes::RenderUnit mSizeUnit
Marker size unit.
Definition: qgssymbollayer.h:995
QgsEllipseSymbolLayer::setStrokeColor
void setStrokeColor(const QColor &c) override
Sets the stroke color for the symbol layer.
Definition: qgsellipsesymbollayer.h:179
QgsEllipseSymbolLayer::encodeShape
static QString encodeShape(QgsEllipseSymbolLayer::Shape shape)
Encodes a shape to its string representation.
Definition: qgsellipsesymbollayer.cpp:1049
QgsEllipseSymbolLayer::setSymbolHeightUnit
void setSymbolHeightUnit(QgsUnitTypes::RenderUnit unit)
Sets the units for the symbol's height.
Definition: qgsellipsesymbollayer.h:206
QgsSymbolLayer::PropertyStrokeColor
@ PropertyStrokeColor
Stroke color.
Definition: qgssymbollayer.h:148
QgsEllipseSymbolLayer
A symbol layer for rendering objects with major and minor axis (e.g. ellipse, rectangle,...
Definition: qgsellipsesymbollayer.h:31
QgsSymbolLayerUtils::decodeColor
static QColor decodeColor(const QString &str)
Definition: qgssymbollayerutils.cpp:69
QgsEllipseSymbolLayer::~QgsEllipseSymbolLayer
~QgsEllipseSymbolLayer() override
QgsEllipseSymbolLayer::properties
QVariantMap properties() const override
Should be reimplemented by subclasses to return a string map that contains the configuration informat...
Definition: qgsellipsesymbollayer.cpp:540
QgsMarkerSymbolLayer::mVerticalAnchorPoint
VerticalAnchorPoint mVerticalAnchorPoint
Vertical anchor point.
Definition: qgssymbollayer.h:1009
QgsSymbolLayerUtils::wellKnownMarkerToSld
static void wellKnownMarkerToSld(QDomDocument &doc, QDomElement &element, const QString &name, const QColor &color, const QColor &strokeColor, Qt::PenStyle strokeStyle, double strokeWidth=-1, double size=-1)
Definition: qgssymbollayerutils.cpp:2624
QgsProperty::value
QVariant value(const QgsExpressionContext &context, const QVariant &defaultValue=QVariant(), bool *ok=nullptr) const
Calculates the current value of the property, including any transforms which are set for the property...
Definition: qgsproperty.cpp:585
QgsSymbolLayerUtils::createGeometryElement
static void createGeometryElement(QDomDocument &doc, QDomElement &element, const QString &geomFunc)
Definition: qgssymbollayerutils.cpp:2923
QgsEllipseSymbolLayer::Rectangle
@ Rectangle
Rectangle.
Definition: qgsellipsesymbollayer.h:39
QgsPropertyCollection::property
QgsProperty property(int key) const override
Returns a matching property from the collection, if one exists.
Definition: qgspropertycollection.cpp:214
QgsEllipseSymbolLayer::setSymbolWidthMapUnitScale
void setSymbolWidthMapUnitScale(const QgsMapUnitScale &scale)
Definition: qgsellipsesymbollayer.h:197
QgsEllipseSymbolLayer::setPenJoinStyle
void setPenJoinStyle(Qt::PenJoinStyle style)
Set stroke join style.
Definition: qgsellipsesymbollayer.h:151
QgsMarkerSymbolLayer::mOffsetUnit
QgsUnitTypes::RenderUnit mOffsetUnit
Offset units.
Definition: qgssymbollayer.h:1001
QgsSymbolRenderContext::selected
bool selected() const
Returns true if symbols should be rendered using the selected symbol coloring and style.
Definition: qgssymbolrendercontext.h:118
QgsSymbolLayerUtils::createDisplacementElement
static void createDisplacementElement(QDomDocument &doc, QDomElement &element, QPointF offset)
Definition: qgssymbollayerutils.cpp:2748
QgsMarkerSymbolLayer::mSize
double mSize
Marker size.
Definition: qgssymbollayer.h:993
QgsUnitTypes::decodeRenderUnit
static Q_INVOKABLE QgsUnitTypes::RenderUnit decodeRenderUnit(const QString &string, bool *ok=nullptr)
Decodes a render unit from a string.
Definition: qgsunittypes.cpp:2948
QgsSymbolRenderContext
Definition: qgssymbolrendercontext.h:35
QgsEllipseSymbolLayer::availableShapes
static QList< QgsEllipseSymbolLayer::Shape > availableShapes()
Returns a list of all available shape types.
Definition: qgsellipsesymbollayer.cpp:1077
QgsMarkerSymbolLayer::HorizontalAnchorPoint
HorizontalAnchorPoint
Symbol horizontal anchor points.
Definition: qgssymbollayer.h:710
QgsMarkerSymbolLayer::setOutputUnit
void setOutputUnit(QgsUnitTypes::RenderUnit unit) override
Sets the units to use for sizes and widths within the symbol layer.
Definition: qgssymbollayer.cpp:691
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:558
QgsEllipseSymbolLayer::toSld
void toSld(QDomDocument &doc, QDomElement &element, const QVariantMap &props) const override
Saves the symbol layer as SLD.
Definition: qgsellipsesymbollayer.cpp:412
QgsEllipseSymbolLayer::writeSldMarker
void writeSldMarker(QDomDocument &doc, QDomElement &element, const QVariantMap &props) const override
Writes the symbol layer definition as a SLD XML element.
Definition: qgsellipsesymbollayer.cpp:425
QgsEllipseSymbolLayer::LeftHalfTriangle
@ LeftHalfTriangle
Left half of a triangle.
Definition: qgsellipsesymbollayer.h:46
QgsSymbolLayer
Definition: qgssymbollayer.h:54
QgsEllipseSymbolLayer::setPenCapStyle
void setPenCapStyle(Qt::PenCapStyle style)
Sets the marker's stroke cap style (e.g., flat, round, etc).
Definition: qgsellipsesymbollayer.h:171
QgsEllipseSymbolLayer::setShape
void setShape(QgsEllipseSymbolLayer::Shape shape)
Sets the rendered ellipse marker shape.
Definition: qgsellipsesymbollayer.h:108
QgsUnitTypes::encodeUnit
static Q_INVOKABLE QString encodeUnit(QgsUnitTypes::DistanceUnit unit)
Encodes a distance unit to a string.
Definition: qgsunittypes.cpp:122
QgsEllipseSymbolLayer::createFromSld
static QgsSymbolLayer * createFromSld(QDomElement &element)
Definition: qgsellipsesymbollayer.cpp:482
QgsEllipseSymbolLayer::setStrokeWidth
void setStrokeWidth(double w)
Definition: qgsellipsesymbollayer.h:173
QgsEllipseSymbolLayer::setSymbolWidthUnit
void setSymbolWidthUnit(QgsUnitTypes::RenderUnit unit)
Sets the units for the symbol's width.
Definition: qgsellipsesymbollayer.h:188
qgsDoubleNear
bool qgsDoubleNear(double a, double b, double epsilon=4 *std::numeric_limits< double >::epsilon())
Compare two doubles (but allow some difference)
Definition: qgis.h:2265
QgsMapToPixel::mapRotation
double mapRotation() const
Returns the current map rotation in degrees (clockwise).
Definition: qgsmaptopixel.h:269
QgsEllipseSymbolLayer::clone
QgsEllipseSymbolLayer * clone() const override
Shall be reimplemented by subclasses to create a deep copy of the instance.
Definition: qgsellipsesymbollayer.cpp:381
QgsSymbolLayer::copyPaintEffect
void copyPaintEffect(QgsSymbolLayer *destLayer) const
Copies paint effect of this layer to another symbol layer.
Definition: qgssymbollayer.cpp:491
QgsSymbolLayerUtils::decodePoint
static QPointF decodePoint(const QString &string)
Decodes a QSizeF from a string.
Definition: qgssymbollayerutils.cpp:543
Qgis::SymbolRenderHint::DynamicRotation
@ DynamicRotation
Rotation of symbol may be changed during rendering and symbol should not be cached.
QgsSymbolLayer::PropertyStrokeStyle
@ PropertyStrokeStyle
Stroke style (eg solid, dashed)
Definition: qgssymbollayer.h:150
QgsMarkerSymbolLayer::outputUnit
QgsUnitTypes::RenderUnit outputUnit() const override
Returns the units to use for sizes and widths within the symbol layer.
Definition: qgssymbollayer.cpp:697
QgsSymbolLayerUtils::rescaleUom
static double rescaleUom(double size, QgsUnitTypes::RenderUnit unit, const QVariantMap &props)
Rescales the given size based on the uomScale found in the props, if any is found,...
Definition: qgssymbollayerutils.cpp:4742
qgsrendercontext.h
QgsSymbolLayerUtils::createVendorOptionElement
static QDomElement createVendorOptionElement(QDomDocument &doc, const QString &name, const QString &value)
Definition: qgssymbollayerutils.cpp:3115
QgsSymbolLayer::restoreOldDataDefinedProperties
void restoreOldDataDefinedProperties(const QVariantMap &stringMap)
Restores older data defined properties from string map.
Definition: qgssymbollayer.cpp:362
QgsEllipseSymbolLayer::Shape
Shape
Marker symbol shapes.
Definition: qgsellipsesymbollayer.h:36
QgsSymbolLayer::PropertyName
@ PropertyName
Name, eg shape name for simple markers.
Definition: qgssymbollayer.h:146
QgsGeometry::isNull
bool isNull
Definition: qgsgeometry.h:127
QgsMarkerSymbolLayer::setOffset
void setOffset(QPointF offset)
Sets the marker's offset, which is the horizontal and vertical displacement which the rendered marker...
Definition: qgssymbollayer.h:842
QgsMapUnitScale
Struct for storing maximum and minimum scales for measurements in map units.
Definition: qgsmapunitscale.h:36
QgsEllipseSymbolLayer::shape
QgsEllipseSymbolLayer::Shape shape() const
Returns the shape for the rendered ellipse marker symbol.
Definition: qgsellipsesymbollayer.h:100
QgsEllipseSymbolLayer::HalfArc
@ HalfArc
Stroke-only half arc (since QGIS 3.20)
Definition: qgsellipsesymbollayer.h:43
QgsSymbolLayer::mDataDefinedProperties
QgsPropertyCollection mDataDefinedProperties
Definition: qgssymbollayer.h:651
QgsSymbolLayer::PropertyStrokeWidth
@ PropertyStrokeWidth
Stroke width.
Definition: qgssymbollayer.h:149
QgsRingSequence
QVector< QgsPointSequence > QgsRingSequence
Definition: qgsabstractgeometry.h:56
QgsEllipseSymbolLayer::fillColor
QColor fillColor() const override
Returns the fill color for the symbol layer.
Definition: qgsellipsesymbollayer.h:177
QgsMarkerSymbolLayer::setOffsetUnit
void setOffsetUnit(QgsUnitTypes::RenderUnit unit)
Sets the units for the symbol's offset.
Definition: qgssymbollayer.h:860
QgsSymbolLayerUtils::encodePoint
static QString encodePoint(QPointF point)
Encodes a QPointF to a string.
Definition: qgssymbollayerutils.cpp:538
QgsEllipseSymbolLayer::Arrow
@ Arrow
Stroke-only arrow (since QGIS 3.20)
Definition: qgsellipsesymbollayer.h:42
QgsAbstractPropertyCollection::valueAsString
QString valueAsString(int key, const QgsExpressionContext &context, const QString &defaultString=QString(), bool *ok=nullptr) const
Calculates the current value of the property with the specified key and interprets it as a string.
Definition: qgspropertycollection.cpp:42
QgsSymbolLayerUtils::decodeSldUom
static QgsUnitTypes::RenderUnit decodeSldUom(const QString &str, double *scaleFactor=nullptr)
Decodes a SLD unit of measure string to a render unit.
Definition: qgssymbollayerutils.cpp:740
QgsEllipseSymbolLayer::Diamond
@ Diamond
Diamond.
Definition: qgsellipsesymbollayer.h:40
QgsEllipseSymbolLayer::setSymbolHeight
void setSymbolHeight(double h)
Definition: qgsellipsesymbollayer.cpp:720
qgsvectorlayer.h
QgsRenderContext::convertToPainterUnits
double convertToPainterUnits(double size, QgsUnitTypes::RenderUnit unit, const QgsMapUnitScale &scale=QgsMapUnitScale(), Qgis::RenderSubcomponentProperty property=Qgis::RenderSubcomponentProperty::Generic) const
Converts a size from the specified units to painter units (pixels).
Definition: qgsrendercontext.cpp:367
QgsSymbolLayerUtils::decodePenCapStyle
static Qt::PenCapStyle decodePenCapStyle(const QString &str)
Definition: qgssymbollayerutils.cpp:250
QgsRenderContext::selectionColor
QColor selectionColor() const
Returns the color to use when rendering selected features.
Definition: qgsrendercontext.h:382
QgsMarkerSymbolLayer::setOffsetMapUnitScale
void setOffsetMapUnitScale(const QgsMapUnitScale &scale)
Sets the map unit scale for the symbol's offset.
Definition: qgssymbollayer.h:877
QgsStringMap
QMap< QString, QString > QgsStringMap
Definition: qgis.h:2781
QgsMarkerSymbolLayer::mOffset
QPointF mOffset
Marker offset.
Definition: qgssymbollayer.h:999
QgsWkbTypes::PointGeometry
@ PointGeometry
Definition: qgswkbtypes.h:142
QgsMarkerSymbolLayer::mHorizontalAnchorPoint
HorizontalAnchorPoint mHorizontalAnchorPoint
Horizontal anchor point.
Definition: qgssymbollayer.h:1007
QgsEllipseSymbolLayer::usesMapUnits
bool usesMapUnits() const override
Returns true if the symbol layer has any components which use map unit based sizes.
Definition: qgsellipsesymbollayer.cpp:744
QgsPointSequence
QVector< QgsPoint > QgsPointSequence
Definition: qgsabstractgeometry.h:52
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:228
QgsGeometry
A geometry is the spatial representation of a feature.
Definition: qgsgeometry.h:124
QgsMapToPixel
Perform transforms between map coordinates and device coordinates.
Definition: qgsmaptopixel.h:38
QgsDxfExport::writeFilledCircle
void writeFilledCircle(const QString &layer, const QColor &color, const QgsPoint &pt, double radius)
Write filled circle (as hatch)
Definition: qgsdxfexport.cpp:1423
QgsEllipseSymbolLayer::RightHalfTriangle
@ RightHalfTriangle
Right half of a triangle.
Definition: qgsellipsesymbollayer.h:45
QgsSymbolLayerUtils::getVendorOptionList
static QgsStringMap getVendorOptionList(QDomElement &element)
Definition: qgssymbollayerutils.cpp:3123
QgsMarkerSymbolLayer::mLineAngle
double mLineAngle
Line rotation angle (see setLineAngle() for details)
Definition: qgssymbollayer.h:991
QgsEllipseSymbolLayer::writeDxf
bool writeDxf(QgsDxfExport &e, double mmMapUnitScaleFactor, const QString &layerName, QgsSymbolRenderContext &context, QPointF shift=QPointF(0.0, 0.0)) const override
write as DXF
Definition: qgsellipsesymbollayer.cpp:833
qgsellipsesymbollayer.h
QgsSymbolLayerUtils::rotationFromSldElement
static bool rotationFromSldElement(QDomElement &element, QString &rotationFunc)
Definition: qgssymbollayerutils.cpp:2717
QgsEllipseSymbolLayer::startRender
void startRender(QgsSymbolRenderContext &context) override
Called before a set of rendering operations commences on the supplied render context.
Definition: qgsellipsesymbollayer.cpp:350
QgsSymbolLayer::PropertyAngle
@ PropertyAngle
Symbol angle.
Definition: qgssymbollayer.h:145
QgsEllipseSymbolLayer::symbolWidth
double symbolWidth() const
Definition: qgsellipsesymbollayer.h:133
QgsUnitTypes::RenderMetersInMapUnits
@ RenderMetersInMapUnits
Meters value as Map units.
Definition: qgsunittypes.h:176
qgsproperty.h
QgsUnitTypes::RenderUnknownUnit
@ RenderUnknownUnit
Mixed or unknown units.
Definition: qgsunittypes.h:175
QgsSymbolLayerUtils::decodePenJoinStyle
static Qt::PenJoinStyle decodePenJoinStyle(const QString &str)
Definition: qgssymbollayerutils.cpp:200
QgsSymbolLayerUtils::createRotationElement
static void createRotationElement(QDomDocument &doc, QDomElement &element, const QString &rotationFunc)
Definition: qgssymbollayerutils.cpp:2707
QgsMarkerSymbolLayer::_rotatedOffset
static QPointF _rotatedOffset(QPointF offset, double angle)
Adjusts a marker offset to account for rotation.
Definition: qgssymbollayer.cpp:652
QgsMarkerSymbolLayer::setSize
virtual void setSize(double size)
Sets the symbol size.
Definition: qgssymbollayer.h:777
QgsEllipseSymbolLayer::create
static QgsSymbolLayer * create(const QVariantMap &properties=QVariantMap())
Creates the symbol layer.
Definition: qgsellipsesymbollayer.cpp:47
QgsMarkerSymbolLayer::offset
QPointF offset() const
Returns the marker's offset, which is the horizontal and vertical displacement which the rendered mar...
Definition: qgssymbollayer.h:851
QgsMarkerSymbolLayer::setSizeMapUnitScale
void setSizeMapUnitScale(const QgsMapUnitScale &scale)
Sets the map unit scale for the symbol's size.
Definition: qgssymbollayer.h:811
QgsMarkerSymbolLayer::setVerticalAnchorPoint
void setVerticalAnchorPoint(VerticalAnchorPoint v)
Sets the vertical anchor point for positioning the symbol.
Definition: qgssymbollayer.h:911
qgsdxfexport.h
QgsMarkerSymbolLayer::mAngle
double mAngle
Marker rotation angle, in degrees clockwise from north.
Definition: qgssymbollayer.h:989
QgsSymbolLayer::color
virtual QColor color() const
Returns the "representative" color of the symbol layer.
Definition: qgssymbollayer.cpp:247
QgsSymbolLayerUtils::encodePenJoinStyle
static QString encodePenJoinStyle(Qt::PenJoinStyle style)
Definition: qgssymbollayerutils.cpp:185
QgsSymbolRenderContext::renderHints
Qgis::SymbolRenderHints renderHints() const
Returns the rendering hint flags for the symbol.
Definition: qgssymbolrendercontext.h:130
QgsFeature
The feature class encapsulates a single feature including its unique ID, geometry and a list of field...
Definition: qgsfeature.h:55
QgsSymbolRenderContext::renderContext
QgsRenderContext & renderContext()
Returns a reference to the context's render context.
Definition: qgssymbolrendercontext.h:62
QgsEllipseSymbolLayer::QgsEllipseSymbolLayer
QgsEllipseSymbolLayer()
Definition: qgsellipsesymbollayer.cpp:31
QgsSymbolLayer::PropertyHeight
@ PropertyHeight
Symbol height.
Definition: qgssymbollayer.h:154
QgsEllipseSymbolLayer::setStrokeStyle
void setStrokeStyle(Qt::PenStyle strokeStyle)
Definition: qgsellipsesymbollayer.h:139
qgslogger.h
QgsRenderContext::painter
QPainter * painter()
Returns the destination QPainter for the render operation.
Definition: qgsrendercontext.h:112
QgsSymbolLayerUtils::decodePenStyle
static Qt::PenStyle decodePenStyle(const QString &str)
Definition: qgssymbollayerutils.cpp:174
QgsPropertyCollection::isActive
bool isActive(int key) const override
Returns true if the collection contains an active property with the specified key.
Definition: qgspropertycollection.cpp:268
QgsEllipseSymbolLayer::setSize
void setSize(double size) override
Sets the symbol size.
Definition: qgsellipsesymbollayer.cpp:699
QgsEllipseSymbolLayer::setStrokeWidthMapUnitScale
void setStrokeWidthMapUnitScale(const QgsMapUnitScale &scale)
Definition: qgsellipsesymbollayer.h:231
QgsGeometry::type
QgsWkbTypes::GeometryType type
Definition: qgsgeometry.h:128
QgsEllipseSymbolLayer::Triangle
@ Triangle
Triangle.
Definition: qgsellipsesymbollayer.h:44
QgsMarkerSymbolLayer::mOffsetMapUnitScale
QgsMapUnitScale mOffsetMapUnitScale
Offset map unit scale.
Definition: qgssymbollayer.h:1003
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
QgsSymbolLayer::copyDataDefinedProperties
void copyDataDefinedProperties(QgsSymbolLayer *destLayer) const
Copies all data defined properties of this layer to another symbol layer.
Definition: qgssymbollayer.cpp:483
QgsEllipseSymbolLayer::setSymbolHeightMapUnitScale
void setSymbolHeightMapUnitScale(const QgsMapUnitScale &scale)
Definition: qgsellipsesymbollayer.h:215
QgsUnitTypes::RenderMapUnits
@ RenderMapUnits
Map units.
Definition: qgsunittypes.h:170
QgsSymbolLayerUtils::decodeMapUnitScale
static QgsMapUnitScale decodeMapUnitScale(const QString &str)
Definition: qgssymbollayerutils.cpp:676
QgsMarkerSymbolLayer::angle
double angle() const
Returns the rotation angle for the marker, in degrees clockwise from north.
Definition: qgssymbollayer.h:757
QgsEllipseSymbolLayer::Circle
@ Circle
Circle.
Definition: qgsellipsesymbollayer.h:38
QgsEllipseSymbolLayer::bounds
QRectF bounds(QPointF point, QgsSymbolRenderContext &context) override
Returns the approximate bounding box of the marker symbol layer, taking into account any data defined...
Definition: qgsellipsesymbollayer.cpp:771
QgsEllipseSymbolLayer::layerType
QString layerType() const override
Returns a string that represents this layer type.
Definition: qgsellipsesymbollayer.cpp:345
QgsEllipseSymbolLayer::symbolHeight
double symbolHeight() const
Definition: qgsellipsesymbollayer.h:136
QgsAbstractPropertyCollection::valueAsColor
QColor valueAsColor(int key, const QgsExpressionContext &context, const QColor &defaultColor=QColor(), bool *ok=nullptr) const
Calculates the current value of the property with the specified key and interprets it as a color.
Definition: qgspropertycollection.cpp:54
QgsEllipseSymbolLayer::setSymbolWidth
void setSymbolWidth(double w)
Definition: qgsellipsesymbollayer.cpp:714
QgsDxfExport::writePolyline
void writePolyline(const QgsPointSequence &line, const QString &layer, const QString &lineStyleName, const QColor &color, double width=-1)
Draw dxf primitives (LWPOLYLINE)
Definition: qgsdxfexport.cpp:957
QgsSymbolLayer::PropertyJoinStyle
@ PropertyJoinStyle
Line join style.
Definition: qgssymbollayer.h:157
QgsSymbolLayer::PropertyWidth
@ PropertyWidth
Symbol width.
Definition: qgssymbollayer.h:153