82 double mmMapUnitScaleFactor,
83 const QString& layerName,
86 const QPointF& shift )
const
89 Q_UNUSED( mmMapUnitScaleFactor );
90 Q_UNUSED( layerName );
120 return QVector<qreal>();
125 return Qt::SolidLine;
151 it.value()->prepare( *fields );
154 it.value()->setScale( scale );
169 columns.append( ddIt.value()->referencedColumns() );
173 QSet<QString> attributes;
174 QStringList::const_iterator it = columns.constBegin();
175 for ( ; it != columns.constEnd(); ++it )
177 attributes.insert( *it );
190 stringMap.insert( ddIt.key() +
"_expression", ddIt.value()->expression() );
220 , mHorizontalAnchorPoint( HCenter )
221 , mVerticalAnchorPoint( VCenter )
223 mOffsetExpression = NULL;
224 mHorizontalAnchorExpression = NULL;
225 mVerticalAnchorExpression = NULL;
247 mHorizontalAnchorExpression =
expression(
"horizontal_anchor_point" );
248 mVerticalAnchorExpression =
expression(
"vertical_anchor_point" );
254 renderPoint( QPointF( size.width() / 2, size.height() / 2 ), context );
275 if ( mOffsetExpression )
278 offsetX = offset.x();
279 offsetY = offset.y();
287 if ( mHorizontalAnchorExpression )
289 horizontalAnchorPoint = decodeHorizontalAnchorPoint( mHorizontalAnchorExpression->
evaluate( const_cast<QgsFeature*>( context.
feature() ) ).toString() );
291 if ( mVerticalAnchorExpression )
293 verticalAnchorPoint = decodeVerticalAnchorPoint( mVerticalAnchorExpression->
evaluate( const_cast<QgsFeature*>( context.
feature() ) ).toString() );
297 if ( horizontalAnchorPoint ==
HCenter && verticalAnchorPoint ==
VCenter )
304 if ( horizontalAnchorPoint ==
Left )
306 offsetX += anchorPointCorrectionX;
308 else if ( horizontalAnchorPoint ==
Right )
310 offsetX -= anchorPointCorrectionX;
314 if ( verticalAnchorPoint ==
Top )
316 offsetY += anchorPointCorrectionY;
318 else if ( verticalAnchorPoint ==
Bottom )
320 offsetY -= anchorPointCorrectionY;
327 double c = cos( angle ), s = sin( angle );
328 return QPointF( offset.x() * c - offset.y() * s, offset.x() * s + offset.y() * c );
333 if ( str.compare(
"left", Qt::CaseInsensitive ) == 0 )
337 else if ( str.compare(
"right", Qt::CaseInsensitive ) == 0 )
349 if ( str.compare(
"top", Qt::CaseInsensitive ) == 0 )
353 else if ( str.compare(
"bottom", Qt::CaseInsensitive ) == 0 )
419 points << QPointF( 0,
int( size.height() / 2 ) + 0.5 ) << QPointF( size.width(), int( size.height() / 2 ) + 0.5 );
431 foreach (
const QPolygonF& ring, *rings )
445 QPolygonF poly = QRectF( QPointF( 0, 0 ), QPointF( size.width(), size.height() ) );
459 if ( points.size() <= 5 &&
462 ( p->renderHints() & QPainter::Antialiasing ) )
464 p->setRenderHint( QPainter::Antialiasing,
false );
465 p->drawRect( points.boundingRect() );
466 p->setRenderHint( QPainter::Antialiasing,
true );
473 p->drawPolygon( points );
479 QPolygonF outerRing = points;
480 path.addPolygon( outerRing );
482 QList<QPolygonF>::const_iterator it = rings->constBegin();
483 for ( ; it != rings->constEnd(); ++it )
485 QPolygonF ring = *it;
486 path.addPolygon( ring );
495 QDomElement symbolizerElem = doc.createElement(
"se:PointSymbolizer" );
496 if ( !props.value(
"uom",
"" ).isEmpty() )
497 symbolizerElem.setAttribute(
"uom", props.value(
"uom",
"" ) );
498 element.appendChild( symbolizerElem );