|
26 | 26 | #include <QDomElement>
|
27 | 27 |
|
28 | 28 | QgsEllipseSymbolLayerV2::QgsEllipseSymbolLayerV2()
|
29 |
| - : mSymbolName( "circle" ) |
| 29 | + : QgsMarkerSymbolLayerV2() |
| 30 | + , mSymbolName( "circle" ) |
30 | 31 | , mSymbolWidth( 4 )
|
31 | 32 | , mSymbolWidthUnit( QgsSymbolV2::MM )
|
32 | 33 | , mSymbolHeight( 3 )
|
33 | 34 | , mSymbolHeightUnit( QgsSymbolV2::MM )
|
34 |
| - , mFillColor( Qt::white ) |
35 | 35 | , mOutlineColor( Qt::black )
|
36 | 36 | , mOutlineStyle( Qt::SolidLine )
|
37 | 37 | , mOutlineWidth( 0 )
|
38 | 38 | , mOutlineWidthUnit( QgsSymbolV2::MM )
|
39 | 39 | {
|
| 40 | + mColor = Qt::white; |
40 | 41 | mPen.setColor( mOutlineColor );
|
41 | 42 | mPen.setStyle( mOutlineStyle );
|
42 | 43 | mPen.setWidth( 1.0 );
|
43 | 44 | mPen.setJoinStyle( Qt::MiterJoin );
|
44 |
| - mBrush.setColor( mFillColor ); |
| 45 | + mBrush.setColor( mColor ); |
45 | 46 | mBrush.setStyle( Qt::SolidPattern );
|
46 | 47 | mOffset = QPointF( 0, 0 );
|
47 | 48 |
|
@@ -340,7 +341,7 @@ void QgsEllipseSymbolLayerV2::startRender( QgsSymbolV2RenderContext& context )
|
340 | 341 | mPen.setColor( mOutlineColor );
|
341 | 342 | mPen.setStyle( mOutlineStyle );
|
342 | 343 | mPen.setWidthF( mOutlineWidth * QgsSymbolLayerV2Utils::lineWidthScaleFactor( context.renderContext(), mOutlineWidthUnit, mOutlineWidthMapUnitScale ) );
|
343 |
| - mBrush.setColor( mFillColor ); |
| 344 | + mBrush.setColor( mColor ); |
344 | 345 | prepareExpressions( context.fields(), context.renderContext().rendererScale() );
|
345 | 346 | }
|
346 | 347 |
|
@@ -372,7 +373,7 @@ void QgsEllipseSymbolLayerV2::writeSldMarker( QDomDocument &doc, QDomElement &el
|
372 | 373 | QDomElement graphicElem = doc.createElement( "se:Graphic" );
|
373 | 374 | element.appendChild( graphicElem );
|
374 | 375 |
|
375 |
| - QgsSymbolLayerV2Utils::wellKnownMarkerToSld( doc, graphicElem, mSymbolName, mFillColor, mOutlineColor, mOutlineStyle, mOutlineWidth, mSymbolWidth ); |
| 376 | + QgsSymbolLayerV2Utils::wellKnownMarkerToSld( doc, graphicElem, mSymbolName, mColor, mOutlineColor, mOutlineStyle, mOutlineWidth, mSymbolWidth ); |
376 | 377 |
|
377 | 378 | // store w/h factor in a <VendorOption>
|
378 | 379 | double widthHeightFactor = mSymbolWidth / mSymbolHeight;
|
@@ -481,7 +482,7 @@ QgsStringMap QgsEllipseSymbolLayerV2::properties() const
|
481 | 482 | map["outline_width"] = QString::number( mOutlineWidth );
|
482 | 483 | map["outline_width_unit"] = QgsSymbolLayerV2Utils::encodeOutputUnit( mOutlineWidthUnit );
|
483 | 484 | map["outline_width_map_unit_scale"] = QgsSymbolLayerV2Utils::encodeMapUnitScale( mOutlineWidthMapUnitScale );
|
484 |
| - map["color"] = QgsSymbolLayerV2Utils::encodeColor( mFillColor ); |
| 485 | + map["color"] = QgsSymbolLayerV2Utils::encodeColor( mColor ); |
485 | 486 | map["outline_color"] = QgsSymbolLayerV2Utils::encodeColor( mOutlineColor );
|
486 | 487 | map["offset"] = QgsSymbolLayerV2Utils::encodePoint( mOffset );
|
487 | 488 | map["offset_unit"] = QgsSymbolLayerV2Utils::encodeOutputUnit( mOffsetUnit );
|
@@ -656,7 +657,7 @@ bool QgsEllipseSymbolLayerV2::writeDxf( QgsDxfExport& e, double mmMapUnitScaleFa
|
656 | 657 | }
|
657 | 658 |
|
658 | 659 | //fill color
|
659 |
| - QColor fc = mFillColor; |
| 660 | + QColor fc = mColor; |
660 | 661 | QgsExpression* fillColorExpression = expression( "fill_color" );
|
661 | 662 | if ( fillColorExpression )
|
662 | 663 | {
|
|
0 commit comments