27 #include <QSvgRenderer>
30 #include <QDomDocument>
31 #include <QDomElement>
51 : mOutlineStyle( Qt::SolidLine ), mOutlineWidth( 0 ), mOutlineWidthUnit(
QgsSymbolV2::MM )
78 if ( props.
contains(
"color_border" ) )
83 else if ( props.
contains(
"outline_color" ) )
87 else if ( props.
contains(
"line_color" ) )
92 size = props[
"size"].toDouble();
94 angle = props[
"angle"].toDouble();
95 if ( props.
contains(
"scale_method" ) )
101 if ( props.
contains(
"offset_unit" ) )
103 if ( props.
contains(
"offset_map_unit_scale" ) )
105 if ( props.
contains(
"size_unit" ) )
107 if ( props.
contains(
"size_map_unit_scale" ) )
110 if ( props.
contains(
"outline_style" ) )
114 else if ( props.
contains(
"line_style" ) )
118 if ( props.
contains(
"outline_width" ) )
122 else if ( props.
contains(
"line_width" ) )
126 if ( props.
contains(
"outline_width_unit" ) )
130 if ( props.
contains(
"line_width_unit" ) )
134 if ( props.
contains(
"outline_width_map_unit_scale" ) )
139 if ( props.
contains(
"horizontal_anchor_point" ) )
143 if ( props.
contains(
"vertical_anchor_point" ) )
156 return "SimpleMarker";
174 if ( context.
alpha() < 1 )
204 if (
mName !=
"circle" )
217 if ( !hasDataDefinedSize )
222 double half = scaledSize / 2.0;
223 transform.
scale( half, half );
227 if ( !hasDataDefinedRotation &&
mAngle != 0 )
262 int imageSize = (( int ) scaledSize + pw ) / 2 * 2 + 1;
263 double center = imageSize / 2.0;
270 mCache =
QImage(
QSize( imageSize, imageSize ), QImage::Format_ARGB32_Premultiplied );
305 p.
fillRect( 0, 0, imageSize, imageSize, selColor );
330 if ( name ==
"square" || name ==
"rectangle" )
335 else if ( name ==
"diamond" )
341 else if ( name ==
"pentagon" )
350 else if ( name ==
"triangle" )
355 else if ( name ==
"equilateral_triangle" )
362 else if ( name ==
"star" )
364 double sixth = 1.0 / 3;
378 else if ( name ==
"regular_star" )
394 else if ( name ==
"arrow" )
405 else if ( name ==
"filled_arrowhead" )
422 if ( name ==
"circle" )
427 else if ( name ==
"cross" )
435 else if ( name ==
"x" || name ==
"cross2" )
443 else if ( name ==
"line" )
449 else if ( name ==
"arrowhead" )
469 double scaledSize =
mSize;
479 if ( hasDataDefinedSize && ok )
484 scaledSize = sqrt( scaledSize );
494 markerOffset( context, scaledSize, scaledSize, offsetX, offsetY );
495 QPointF off( offsetX, offsetY );
499 bool usingDataDefinedRotation =
false;
503 usingDataDefinedRotation = ok;
507 if ( hasDataDefinedRotation )
530 bool createdNewPath =
false;
540 createdNewPath =
true;
551 point.
y() - s / 2.0 + off.
y(),
559 transform.
translate( point.
x() + off.
x(), point.
y() + off.
y() );
562 if ( hasDataDefinedSize || createdNewPath )
565 double half = s / 2.0;
566 transform.
scale( half, half );
569 if ( angle != 0 && ( hasDataDefinedRotation || createdNewPath ) )
570 transform.
rotate( angle );
674 double angle = props.
value(
"angle",
"0" ).toDouble( &ok );
679 else if ( angle +
mAngle != 0 )
691 Q_UNUSED( mmScaleFactor );
692 Q_UNUSED( mapUnitScaleFactor );
695 if (
mName ==
"square" )
699 else if (
mName ==
"triangle" )
703 else if (
mName ==
"star" )
707 else if (
mName ==
"circle" )
711 else if (
mName ==
"cross" )
719 else if (
mName ==
"line" )
725 ogrString.
append(
"SYMBOL(" );
726 ogrString.
append(
"id:" );
728 ogrString.
append(
"ogr-sym-" );
729 ogrString.
append( ogrType );
731 ogrString.
append(
",c:" );
733 ogrString.
append(
",o:" );
741 ogrString.
append(
"PEN(" );
744 ogrString.
append(
",w:" );
756 if ( graphicElem.
isNull() )
761 double borderWidth,
size;
762 Qt::PenStyle borderStyle;
772 double d = angleFunc.
toDouble( &ok );
806 bool hasDataDefinedSize =
false;
814 if ( hasDataDefinedSize )
837 size *= mmMapUnitScaleFactor;
839 double halfSize = size / 2.0;
850 outlineWidth *= mmMapUnitScaleFactor;
876 QPointF off( offsetX, offsetY );
897 off *= mmMapUnitScaleFactor;
901 t.
translate( shift.
x() + offsetX, shift.
y() + offsetY );
909 t.
scale( halfSize, -halfSize );
911 polygon = t.
map( polygon );
917 for ( i = 0; i < polygon.
size(); i++ )
918 p[0][i] = polygon[i];
924 e.
writePolyline( p[0], layerName,
"CONTINUOUS", pc, outlineWidth );
926 else if ( name ==
"circle" )
931 e.
writeCircle( layerName, pc, shift, halfSize,
"CONTINUOUS", outlineWidth );
933 else if ( name ==
"line" )
939 e.
writeLine( pt1, pt2, layerName,
"CONTINUOUS", pc, outlineWidth );
941 else if ( name ==
"cross" )
950 e.
writeLine( pt1, pt2, layerName,
"CONTINUOUS", pc, outlineWidth );
951 e.
writeLine( pt3, pt4, layerName,
"CONTINUOUS", pc, outlineWidth );
954 else if ( name ==
"x" || name ==
"cross2" )
963 e.
writeLine( pt1, pt2, layerName,
"CONTINUOUS", pc, outlineWidth );
964 e.
writeLine( pt3, pt4, layerName,
"CONTINUOUS", pc, outlineWidth );
967 else if ( name ==
"arrowhead" )
975 e.
writeLine( pt1, pt2, layerName,
"CONTINUOUS", pc, outlineWidth );
976 e.
writeLine( pt3, pt2, layerName,
"CONTINUOUS", pc, outlineWidth );
1044 name = props[
"name"];
1046 size = props[
"size"].toDouble();
1048 angle = props[
"angle"].toDouble();
1049 if ( props.
contains(
"scale_method" ) )
1060 bool hasFillParam, hasOutlineParam, hasOutlineWidthParam;
1066 if ( hasOutlineParam )
1070 if ( hasOutlineWidthParam )
1076 if ( props.
contains(
"size_unit" ) )
1078 if ( props.
contains(
"size_map_unit_scale" ) )
1082 if ( props.
contains(
"offset_unit" ) )
1084 if ( props.
contains(
"offset_map_unit_scale" ) )
1091 else if ( props.
contains(
"color" ) )
1100 else if ( props.
contains(
"outline_color" ) )
1104 else if ( props.
contains(
"line_color" ) )
1109 if ( props.
contains(
"outline-width" ) )
1114 else if ( props.
contains(
"outline_width" ) )
1118 else if ( props.
contains(
"line_width" ) )
1123 if ( props.
contains(
"outline_width_unit" ) )
1127 else if ( props.
contains(
"line_width_unit" ) )
1131 if ( props.
contains(
"outline_width_map_unit_scale" ) )
1134 if ( props.
contains(
"horizontal_anchor_point" ) )
1138 if ( props.
contains(
"vertical_anchor_point" ) )
1153 bool hasFillParam, hasOutlineParam, hasOutlineWidthParam;
1159 if ( hasOutlineParam )
1163 if ( hasOutlineWidthParam )
1178 Q_UNUSED( context );
1184 Q_UNUSED( context );
1193 double scaledSize =
mSize;
1203 if ( hasDataDefinedSize && ok )
1208 scaledSize = sqrt( scaledSize );
1218 if ((
int )size < 1 || 10000.0 <
size )
1228 markerOffset( context, scaledSize, scaledSize, offsetX, offsetY );
1229 QPointF outputOffset( offsetX, offsetY );
1238 if ( hasDataDefinedRotation )
1293 bool fitsInCache =
true;
1294 bool usePict =
true;
1295 double hwRatio = 1.0;
1301 if ( fitsInCache && img.
width() > 1 )
1308 p->
drawImage( -transparentImage.
width() / 2.0, -transparentImage.
height() / 2.0, transparentImage );
1309 hwRatio = ( double )transparentImage.
height() / ( double )transparentImage.
width();
1314 hwRatio = ( double )img.
height() / ( double )img.
width();
1319 if ( usePict || !fitsInCache )
1325 if ( pct.
width() > 1 )
1331 hwRatio = ( double )pct.
height() / ( double )pct.
width();
1339 if ( penWidth > size / 20 )
1342 penWidth = size / 20;
1344 double penOffset = penWidth / 2;
1345 pen.setWidth( penWidth );
1348 double wSize = size + penOffset;
1349 double hSize = size * hwRatio + penOffset;
1350 p->
drawRect(
QRectF( -wSize / 2.0, -hSize / 2.0, wSize, hSize ) );
1443 double angle = props.
value(
"angle",
"0" ).toDouble( &ok );
1448 else if ( angle +
mAngle != 0 )
1464 if ( graphicElem.
isNull() )
1474 if ( mimeType !=
"image/svg+xml" )
1482 double d = angleFunc.
toDouble( &ok );
1502 Q_UNUSED( layerName );
1516 if ( hasDataDefinedSize && ok )
1521 size = sqrt( size );
1530 size *= mmMapUnitScaleFactor;
1533 double halfSize = size / 2.0;
1544 double offsetX = offset.
x();
1545 double offsetY = offset.
y();
1548 offsetX *= mmMapUnitScaleFactor;
1549 offsetY *= mmMapUnitScaleFactor;
1552 QPointF outputOffset( offsetX, offsetY );
1653 fontFamily = props[
"font"];
1654 if ( props.
contains(
"chr" ) && props[
"chr"].length() > 0 )
1655 chr = props[
"chr"].at( 0 );
1657 pointSize = props[
"size"].toDouble();
1661 angle = props[
"angle"].toDouble();
1666 if ( props.
contains(
"offset_unit" ) )
1668 if ( props.
contains(
"offset_map_unit_scale" ) )
1670 if ( props.
contains(
"size_unit" ) )
1672 if ( props.
contains(
"size_map_unit_scale" ) )
1674 if ( props.
contains(
"horizontal_anchor_point" ) )
1678 if ( props.
contains(
"vertical_anchor_point" ) )
1690 return "FontMarker";
1706 Q_UNUSED( context );
1736 if ( charToRender !=
mChr )
1742 double scaledSize =
mSize;
1752 if ( hasDataDefinedSize && ok )
1757 scaledSize = sqrt( scaledSize );
1767 markerOffset( context, scaledSize, scaledSize , offsetX, offsetY );
1768 QPointF outputOffset( offsetX, offsetY );
1777 if ( hasDataDefinedRotation )
1810 p->
drawText( -chrOffset, charToRender );
1818 props[
"chr"] =
mChr;
1864 double angle = props.
value(
"angle",
"0" ).toDouble( &ok );
1869 else if ( angle +
mAngle != 0 )
1884 if ( graphicElem.
isNull() )
1895 if ( !name.
startsWith(
"ttf://" ) || format !=
"ttf" )
1905 double d = angleFunc.
toDouble( &ok );
void addEllipse(const QRectF &boundingRectangle)
QgsSymbolV2::OutputUnit outputUnit() const override
QColor borderColor() const
static QString encodeOutputUnit(QgsSymbolV2::OutputUnit unit)
Q_GUI_EXPORT int qt_defaultDpiX()
static const QString EXPR_CHAR
void setOutlineStyle(Qt::PenStyle outlineStyle)
void setOpacity(qreal opacity)
double outlineWidth() const
Qt::PenStyle style() const
void stopRender(QgsSymbolV2RenderContext &context) override
QgsSymbolV2::OutputUnit outputUnit() const override
void setStyle(Qt::PenStyle style)
QString & append(QChar ch)
static void multiplyImageOpacity(QImage *image, qreal alpha)
Multiplies opacity of image pixel values with a (global) transparency value.
QgsMapUnitScale mSizeMapUnitScale
QgsMapUnitScale mOutlineWidthMapUnitScale
Q_GUI_EXPORT int qt_defaultDpiY()
QString layerType() const override
bool contains(const Key &key) const
QgsStringMap properties() const override
static Q_DECL_DEPRECATED bool wellKnownMarkerFromSld(QDomElement &element, QString &name, QColor &color, QColor &borderColor, double &borderWidth, double &size)
void fillRect(const QRectF &rectangle, const QBrush &brush)
A paint device for drawing into dxf files.
void setRenderHint(RenderHint hint, bool on)
QString layerType() const override
QDomNode appendChild(const QDomNode &newChild)
#define DEFAULT_FONTMARKER_COLOR
void render(QPainter *painter)
const QPicture & svgAsPicture(const QString &file, double size, const QColor &fill, const QColor &outline, double outlineWidth, double widthScaleFactor, double rasterScaleFactor, bool forceVectorOutput=false)
Get SVG as QPicture&.
Qt::BrushStyle style() const
QColor selectionColor() const
QgsSymbolLayerV2 * clone() const override
QgsSymbolV2::OutputUnit mOutlineWidthUnit
void setOutlineColor(const QColor &c) override
Set outline color.
QString layerType() const override
#define DEFAULT_SIMPLEMARKER_ANGLE
void writePolygon(const QgsPolygon &polygon, const QString &layer, const QString &hatchPattern, QColor color)
Draw dxf polygon (HATCH)
static void createRotationElement(QDomDocument &doc, QDomElement &element, QString rotationFunc)
double rendererScale() const
void scale(qreal sx, qreal sy)
#define DEFAULT_FONTMARKER_CHR
void setOffset(QPointF offset)
QString ogrFeatureStyle(double mmScaleFactor, double mapUnitScaleFactor) const override
void setHorizontalAnchorPoint(HorizontalAnchorPoint h)
void setOutlineWidth(double w)
QGis::GeometryType type() const
Returns type of the geometry as a QGis::GeometryType.
#define DEFAULT_SIMPLEMARKER_COLOR
void writeSldMarker(QDomDocument &doc, QDomElement &element, QgsStringMap props) const override
QgsSymbolLayerV2 * clone() const override
void drawPolygon(const QPointF *points, int pointCount, Qt::FillRule fillRule)
static QPointF decodePoint(QString str)
void setVerticalAnchorPoint(VerticalAnchorPoint v)
static bool externalGraphicFromSld(QDomElement &element, QString &path, QString &mime, QColor &color, double &size)
A geometry is the spatial representation of a feature.
void moveTo(const QPointF &point)
static QColor decodeColor(QString str)
void copyPaintEffect(QgsSymbolLayerV2 *destLayer) const
Copies paint effect of this layer to another symbol layer.
void stopRender(QgsSymbolV2RenderContext &context) override
static QString encodeMapUnitScale(const QgsMapUnitScale &mapUnitScale)
virtual bool hasDataDefinedProperty(const QString &property) const
Checks whether the layer has a matching data defined property and if that property is currently activ...
void setOutlineWidth(double w)
double scaleFactor() const
QColor fillColor() const override
Get fill color.
static QgsSymbolLayerV2 * create(const QgsStringMap &properties=QgsStringMap())
The feature class encapsulates a single feature including its id, geometry and a list of field/values...
static void _fixQPictureDPI(QPainter *p)
void setOffsetMapUnitScale(const QgsMapUnitScale &scale)
QImage copy(const QRect &rectangle) const
static void createDisplacementElement(QDomDocument &doc, QDomElement &element, QPointF offset)
void writeSldMarker(QDomDocument &doc, QDomElement &element, QgsStringMap props) const override
double toDouble(bool *ok) const
static QgsSymbolLayerV2 * create(const QgsStringMap &properties=QgsStringMap())
QgsSymbolLayerV2 * clone() const override
double mapRotation() const
Return current map rotation in degrees.
bool qgsDoubleNear(double a, double b, double epsilon=4 *DBL_EPSILON)
static const QString EXPR_OFFSET
void setMapUnitScale(const QgsMapUnitScale &scale) override
static QgsSymbolLayerV2 * createFromSld(QDomElement &element)
QSize defaultSize() const
void writeCircle(const QString &layer, QColor color, const QgsPoint &pt, double radius, const QString &lineStyleName, double width)
Write circle (as polyline)
#define DEFAULT_SVGMARKER_ANGLE
static const QString EXPR_SIZE
void setOffsetUnit(QgsSymbolV2::OutputUnit unit)
static QString encodeColor(QColor color)
#define DEFAULT_SIMPLEMARKER_NAME
void containsParams(const QString &path, bool &hasFillParam, QColor &defaultFillColor, bool &hasOutlineParam, QColor &defaultOutlineColor, bool &hasOutlineWidthParam, double &defaultOutlineWidth) const
Tests if an svg file contains parameters for fill, outline color, outline width.
static bool displacementFromSldElement(QDomElement &element, QPointF &offset)
qreal alpha() const
Get alpha transparency 1 for opaque, 0 for invisible.
void drawMarker(QPainter *p, QgsSymbolV2RenderContext &context)
const QColor & color() const
static QgsSvgCache * instance()
static QString encodePenStyle(Qt::PenStyle style)
void setOutlineWidthUnit(QgsSymbolV2::OutputUnit unit)
bool writeDxf(QgsDxfExport &e, double mmMapUnitScaleFactor, const QString &layerName, const QgsSymbolV2RenderContext *context, const QgsFeature *f, const QPointF &shift=QPointF(0.0, 0.0)) const override
const QImage & svgAsImage(const QString &file, double size, const QColor &fill, const QColor &outline, double outlineWidth, double widthScaleFactor, double rasterScaleFactor, bool &fitsInCache)
Get SVG as QImage.
QgsFontMarkerSymbolLayerV2(QString fontFamily=DEFAULT_FONTMARKER_FONT, QChar chr=DEFAULT_FONTMARKER_CHR, double pointSize=DEFAULT_FONTMARKER_SIZE, QColor color=DEFAULT_FONTMARKER_COLOR, double angle=DEFAULT_FONTMARKER_ANGLE)
void drawRect(const QRectF &rectangle)
Perform transforms between map coordinates and device coordinates.
void setPixelSize(int pixelSize)
static QString symbolPathToName(QString path)
Get symbols's name from its path.
void setFont(const QFont &font)
void setMapUnitScale(const QgsMapUnitScale &scale) override
QString number(int n, int base)
void setOutlineWidthUnit(QgsSymbolV2::OutputUnit u)
const QgsFeature * feature() const
Current feature being rendered - may be null.
void fill(uint pixelValue)
static QString encodePoint(QPointF point)
QgsStringMap properties() const override
static Qt::PenStyle decodePenStyle(QString str)
void setPen(const QColor &color)
void renderPoint(const QPointF &point, QgsSymbolV2RenderContext &context) override
void lineTo(const QPointF &endPoint)
#define DEFAULT_SCALE_METHOD
void setOutputUnit(QgsSymbolV2::OutputUnit unit) override
Qt::PenStyle mOutlineStyle
QMatrix & translate(qreal dx, qreal dy)
void setMapUnitScale(const QgsMapUnitScale &scale) override
QString fontFamily() const
double outlineWidth() const
QgsSymbolV2::ScaleMethod mScaleMethod
static QString symbolNameToPath(QString name)
Get symbol's path from its name.
bool startsWith(const QString &s, Qt::CaseSensitivity cs) const
bool forceVectorOutput() const
void setLayer(const QString &layer)
void setSizeUnit(QgsSymbolV2::OutputUnit unit)
static bool externalMarkerFromSld(QDomElement &element, QString &path, QString &format, int &markIndex, QColor &color, double &size)
QPaintDevice * device() const
void setPath(QString path)
QgsMapUnitScale mapUnitScale() const override
void setWidthF(qreal width)
QgsStringMap properties() const override
void stopRender(QgsSymbolV2RenderContext &context) override
void setBrush(const QBrush &brush)
void drawText(const QPointF &position, const QString &text)
double rasterScaleFactor() const
#define DEFAULT_FONTMARKER_ANGLE
QgsSymbolV2::OutputUnit outputUnit() const override
QgsMapUnitScale mOutlineWidthMapUnitScale
void writeLine(const QgsPoint &pt1, const QgsPoint &pt2, const QString &layer, const QString &lineStyleName, QColor color, double width=-1)
Write line (as a polyline)
static const QString EXPR_FILL
virtual QColor color() const
const QByteArray & svgContent(const QString &file, double size, const QColor &fill, const QColor &outline, double outlineWidth, double widthScaleFactor, double rasterScaleFactor)
Get SVG content.
QgsSvgMarkerSymbolLayerV2(QString name=DEFAULT_SVGMARKER_NAME, double size=DEFAULT_SVGMARKER_SIZE, double angle=DEFAULT_SVGMARKER_ANGLE, QgsSymbolV2::ScaleMethod scaleMethod=DEFAULT_SCALE_METHOD)
static QgsSymbolLayerV2 * createFromSld(QDomElement &element)
HorizontalAnchorPoint mHorizontalAnchorPoint
void setColor(const QColor &color)
virtual void prepareExpressions(const QgsFields *fields, double scale=-1.0)
Prepares all data defined property expressions for evaluation.
void setOutlineWidthMapUnitScale(const QgsMapUnitScale &scale)
QgsSymbolV2::ScaleMethod scaleMethod() const
static const QString EXPR_OUTLINE_STYLE
QgsSymbolV2::OutputUnit mOutlineWidthUnit
#define DEFAULT_SVGMARKER_SIZE
~QgsFontMarkerSymbolLayerV2()
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)
QFontMetrics * mFontMetrics
static const QString EXPR_COLOR
static const QString EXPR_ANGLE
int width(const QString &text, int len) const
void setOutlineWidthMapUnitScale(const QgsMapUnitScale &scale)
QgsMapUnitScale mapUnitScale() const override
void startRender(QgsSymbolV2RenderContext &context) override
#define DEFAULT_FONTMARKER_SIZE
void startRender(QgsSymbolV2RenderContext &context) override
static const QString EXPR_OUTLINE_WIDTH
#define DEFAULT_FONTMARKER_FONT
#define DEFAULT_SVGMARKER_NAME
QMatrix & rotate(qreal degrees)
#define DEFAULT_SIMPLEMARKER_SIZE
void drawImage(const QRectF &target, const QImage &image, const QRectF &source, QFlags< Qt::ImageConversionFlag > flags)
QString mid(int position, int n) const
void drawPath(const QPainterPath &path)
static double lineWidthScaleFactor(const QgsRenderContext &c, QgsSymbolV2::OutputUnit u, const QgsMapUnitScale &scale=QgsMapUnitScale())
Returns the line width scale factor depending on the unit and the paint device.
void renderPoint(const QPointF &point, QgsSymbolV2RenderContext &context) override
static QgsSymbolLayerV2 * create(const QgsStringMap &properties=QgsStringMap())
virtual QVariant evaluateDataDefinedProperty(const QString &property, const QgsFeature *feature, const QVariant &defaultVal=QVariant(), bool *ok=0) const
Evaluates the matching data defined property and returns the calculated value.
void setOutputUnit(QgsSymbolV2::OutputUnit unit) override
QgsMapUnitScale mapUnitScale() const override
Qt::PenStyle outlineStyle() const
static const QString EXPR_NAME
void setShift(const QPointF &shift)
QgsSimpleMarkerSymbolLayerV2(QString name=DEFAULT_SIMPLEMARKER_NAME, QColor color=DEFAULT_SIMPLEMARKER_COLOR, QColor borderColor=DEFAULT_SIMPLEMARKER_BORDERCOLOR, double size=DEFAULT_SIMPLEMARKER_SIZE, double angle=DEFAULT_SIMPLEMARKER_ANGLE, QgsSymbolV2::ScaleMethod scaleMethod=DEFAULT_SCALE_METHOD)
static QString encodeScaleMethod(QgsSymbolV2::ScaleMethod scaleMethod)
QgsRenderContext & renderContext()
QDomElement firstChildElement(const QString &tagName) const
bool preparePath(QString name=QString())
void writeFilledCircle(const QString &layer, QColor color, const QgsPoint &pt, double radius)
Write filled circle (as hatch)
int count(const T &value) const
static const QString EXPR_COLOR_BORDER
static void externalGraphicToSld(QDomDocument &doc, QDomElement &element, QString path, QString mime, QColor color, double size=-1)
const QgsGeometry * constGeometry() const
Gets a const pointer to the geometry object associated with this feature.
bool writeDxf(QgsDxfExport &e, double mmMapUnitScaleFactor, const QString &layerName, const QgsSymbolV2RenderContext *context, const QgsFeature *f, const QPointF &shift=QPointF(0.0, 0.0)) const override
void translate(const QPointF &offset)
static Q_DECL_DEPRECATED void wellKnownMarkerToSld(QDomDocument &doc, QDomElement &element, QString name, QColor color, QColor borderColor=QColor(), double borderWidth=-1, double size=-1)
const QgsMapToPixel & mapToPixel() const
const QgsFields * fields() const
Fields of the layer.
QgsSymbolV2::OutputUnit mOffsetUnit
void setAlphaF(qreal alpha)
void startRender(QgsSymbolV2RenderContext &context) override
static bool rotationFromSldElement(QDomElement &element, QString &rotationFunc)
static QgsSymbolV2::ScaleMethod decodeScaleMethod(QString str)
double toDouble(bool *ok) const
void startRender(QgsSymbolV2RenderContext &context) override
VerticalAnchorPoint mVerticalAnchorPoint
bool prepareShape(QString name=QString())
QgsSymbolV2::OutputUnit mSizeUnit
void setDrawingSize(const QSizeF &size)
QgsMapUnitScale mOffsetMapUnitScale
void drawPicture(const QPointF &point, const QPicture &picture)
static const QString EXPR_OUTLINE
void markerOffset(const QgsSymbolV2RenderContext &context, double &offsetX, double &offsetY) const
void restoreDataDefinedProperties(const QgsStringMap &stringMap)
Restores all data defined properties from string map.
static QgsMapUnitScale decodeMapUnitScale(const QString &str)
void writeSldMarker(QDomDocument &doc, QDomElement &element, QgsStringMap props) const override
QDomElement createElement(const QString &tagName)
void map(int x, int y, int *tx, int *ty) const
void writePolyline(const QgsPolyline &line, const QString &layer, const QString &lineStyleName, QColor color, double width=-1)
Draw dxf primitives (LWPOLYLINE)
void setAngle(double angle)
bool begin(QPaintDevice *device)
static QgsSymbolLayerV2 * createFromSld(QDomElement &element)
void setColor(const QColor &color)
QString arg(qlonglong a, int fieldWidth, int base, const QChar &fillChar) const
void saveDataDefinedProperties(QgsStringMap &stringMap) const
Saves all data defined properties to a string map.
void setSizeMapUnitScale(const QgsMapUnitScale &scale)
QColor outlineColor() const override
Get outline color.
void setOutputUnit(QgsSymbolV2::OutputUnit unit) override
bool prepareCache(QgsSymbolV2RenderContext &context)
Prepares cache image.
static QgsSymbolV2::OutputUnit decodeOutputUnit(QString str)
void renderPoint(const QPointF &point, QgsSymbolV2RenderContext &context) override
static void externalMarkerToSld(QDomDocument &doc, QDomElement &element, QString path, QString format, int *markIndex=0, QColor color=QColor(), double size=-1)
static const int mMaximumCacheWidth
void copyDataDefinedProperties(QgsSymbolLayerV2 *destLayer) const
Copies all data defined properties of this layer to another symbol layer.
QMatrix & scale(qreal sx, qreal sy)
void setFillColor(const QColor &c) override
Set fill color.
void setOutputSize(const QRectF &r)
const T value(const Key &key) const
static QPointF _rotatedOffset(const QPointF &offset, double angle)
#define DEFAULT_SIMPLEMARKER_BORDERCOLOR