92 it.value()->prepare( fields );
106 columns.append( ddIt.value()->referencedColumns() );
110 QSet<QString> attributes;
111 QStringList::const_iterator it = columns.constBegin();
112 for ( ; it != columns.constEnd(); ++it )
114 attributes.insert( *it );
127 stringMap.insert( ddIt.key() +
"_expression", ddIt.value()->expression() );
168 renderPoint( QPointF( size.width() / 2, size.height() / 2 ), context );
184 if ( offsetExpression )
187 offsetX = offset.x();
188 offsetY = offset.y();
198 double c = cos( angle ), s = sin( angle );
199 return QPointF( offset.x() * c - offset.y() * s, offset.x() * s + offset.y() * c );
217 points << QPointF( 0, size.height() / 2 + 0.5 ) << QPointF( size.width(), size.height() / 2 + 0.5 );
229 foreach (
const QPolygonF& ring, *rings )
237 QPolygonF poly = QRectF( QPointF( 0, 0 ), QPointF( size.width() - 1, size.height() - 1 ) );
253 p->drawPolygon( points );
259 QPolygonF outerRing = points;
260 path.addPolygon( outerRing );
262 QList<QPolygonF>::const_iterator it = rings->constBegin();
263 for ( ; it != rings->constEnd(); ++it )
265 QPolygonF ring = *it;
266 path.addPolygon( ring );
275 QDomElement symbolizerElem = doc.createElement(
"se:PointSymbolizer" );
276 if ( !props.value(
"uom",
"" ).isEmpty() )
277 symbolizerElem.setAttribute(
"uom", props.value(
"uom",
"" ) );
278 element.appendChild( symbolizerElem );
virtual QSet< QString > usedAttributes() const
void drawPreviewIcon(QgsSymbolV2RenderContext &context, QSize size)
Class for parsing and evaluation of expressions (formerly called "search strings").
virtual void removeDataDefinedProperties()
QMap< QString, QgsExpression * > mDataDefinedProperties
void markerOffset(QgsSymbolV2RenderContext &context, double &offsetX, double &offsetY)
virtual QgsSymbolV2::OutputUnit outputUnit() const
QVariant evaluate(const QgsFeature *f=NULL)
Evaluate the feature and return the result.
virtual void toSld(QDomDocument &doc, QDomElement &element, QgsStringMap props) const
static QPointF decodePoint(QString str)
Container of fields for a vector layer.
virtual void renderPolygon(const QPolygonF &points, QList< QPolygonF > *rings, QgsSymbolV2RenderContext &context)=0
virtual void setOutputUnit(QgsSymbolV2::OutputUnit unit)
virtual void removeDataDefinedProperty(const QString &property)
QMap< QString, QString > QgsStringMap
virtual QString dataDefinedPropertyString(const QString &property) const
virtual void startRender(QgsSymbolV2RenderContext &context)=0
virtual void writeSldMarker(QDomDocument &doc, QDomElement &element, QgsStringMap props) const
const QgsFeature * feature() const
virtual void renderPoint(const QPointF &point, QgsSymbolV2RenderContext &context)=0
virtual void prepareExpressions(const QgsVectorLayer *vl)
QgsMarkerSymbolLayerV2(bool locked=false)
const QString & expression() const
virtual void renderPolygonOutline(const QPolygonF &points, QList< QPolygonF > *rings, QgsSymbolV2RenderContext &context)
double ANALYSIS_EXPORT angle(Point3D *p1, Point3D *p2, Point3D *p3, Point3D *p4)
Calculates the angle between two segments (in 2 dimension, z-values are ignored)
void drawPreviewIcon(QgsSymbolV2RenderContext &context, QSize size)
virtual void renderPolyline(const QPolygonF &points, QgsSymbolV2RenderContext &context)=0
void _renderPolygon(QPainter *p, const QPolygonF &points, const QList< QPolygonF > *rings)
Default method to render polygon.
void drawPreviewIcon(QgsSymbolV2RenderContext &context, QSize size)
QgsFillSymbolLayerV2(bool locked=false)
static void createGeometryElement(QDomDocument &doc, QDomElement &element, QString geomFunc)
QgsLineSymbolLayerV2(bool locked=false)
virtual const QgsExpression * dataDefinedProperty(const QString &property) const
QgsRenderContext & renderContext()
static double lineWidthScaleFactor(const QgsRenderContext &c, QgsSymbolV2::OutputUnit u)
Returns the line width scale factor depending on the unit and the paint device.
QgsSymbolV2::OutputUnit mOffsetUnit
QgsSymbolV2::OutputUnit mSizeUnit
const QgsFields & pendingFields() const
returns field list in the to-be-committed state
Represents a vector layer which manages a vector based data sets.
void saveDataDefinedProperties(QgsStringMap &stringMap) const
Saves data defined properties to string map.
virtual void stopRender(QgsSymbolV2RenderContext &context)=0
virtual QgsExpression * expression(const QString &property)
void copyDataDefinedProperties(QgsSymbolLayerV2 *destLayer) const
Copies data defined properties of this layer to another symbol layer.
virtual void setDataDefinedProperty(const QString &property, const QString &expressionString)
static QPointF _rotatedOffset(const QPointF &offset, double angle)