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;
480 if ( hasDataDefinedSize && ok )
485 scaledSize = sqrt( scaledSize );
495 markerOffset( context, scaledSize, scaledSize, offsetX, offsetY );
496 QPointF off( offsetX, offsetY );
500 bool usingDataDefinedRotation =
false;
505 usingDataDefinedRotation = ok;
509 if ( hasDataDefinedRotation )
532 bool createdNewPath =
false;
543 createdNewPath =
true;
554 point.
y() - s / 2.0 + off.
y(),
562 transform.
translate( point.
x() + off.
x(), point.
y() + off.
y() );
565 if ( hasDataDefinedSize || createdNewPath )
568 double half = s / 2.0;
569 transform.
scale( half, half );
572 if ( angle != 0 && ( hasDataDefinedRotation || createdNewPath ) )
573 transform.
rotate( angle );
681 double angle = props.
value(
"angle",
"0" ).toDouble( &ok );
686 else if ( angle +
mAngle != 0 )
698 Q_UNUSED( mmScaleFactor );
699 Q_UNUSED( mapUnitScaleFactor );
702 if (
mName ==
"square" )
706 else if (
mName ==
"triangle" )
710 else if (
mName ==
"star" )
714 else if (
mName ==
"circle" )
718 else if (
mName ==
"cross" )
726 else if (
mName ==
"line" )
732 ogrString.
append(
"SYMBOL(" );
733 ogrString.
append(
"id:" );
735 ogrString.
append(
"ogr-sym-" );
736 ogrString.
append( ogrType );
738 ogrString.
append(
",c:" );
740 ogrString.
append(
",o:" );
748 ogrString.
append(
"PEN(" );
751 ogrString.
append(
",w:" );
763 if ( graphicElem.
isNull() )
768 double borderWidth,
size;
769 Qt::PenStyle borderStyle;
779 double d = angleFunc.
toDouble( &ok );
813 bool hasDataDefinedSize =
false;
821 if ( hasDataDefinedSize )
845 size *= mmMapUnitScaleFactor;
847 double halfSize = size / 2.0;
859 outlineWidth *= mmMapUnitScaleFactor;
887 QPointF off( offsetX, offsetY );
910 off *= mmMapUnitScaleFactor;
914 t.
translate( shift.
x() + offsetX, shift.
y() + offsetY );
922 t.
scale( halfSize, -halfSize );
924 polygon = t.
map( polygon );
930 for ( i = 0; i < polygon.
size(); i++ )
931 p[0][i] = polygon[i];
937 e.
writePolyline( p[0], layerName,
"CONTINUOUS", pc, outlineWidth );
939 else if ( name ==
"circle" )
944 e.
writeCircle( layerName, pc, shift, halfSize,
"CONTINUOUS", outlineWidth );
946 else if ( name ==
"line" )
952 e.
writeLine( pt1, pt2, layerName,
"CONTINUOUS", pc, outlineWidth );
954 else if ( name ==
"cross" )
963 e.
writeLine( pt1, pt2, layerName,
"CONTINUOUS", pc, outlineWidth );
964 e.
writeLine( pt3, pt4, layerName,
"CONTINUOUS", pc, outlineWidth );
967 else if ( name ==
"x" || name ==
"cross2" )
976 e.
writeLine( pt1, pt2, layerName,
"CONTINUOUS", pc, outlineWidth );
977 e.
writeLine( pt3, pt4, layerName,
"CONTINUOUS", pc, outlineWidth );
980 else if ( name ==
"arrowhead" )
988 e.
writeLine( pt1, pt2, layerName,
"CONTINUOUS", pc, outlineWidth );
989 e.
writeLine( pt3, pt2, layerName,
"CONTINUOUS", pc, outlineWidth );
1057 name = props[
"name"];
1059 size = props[
"size"].toDouble();
1061 angle = props[
"angle"].toDouble();
1062 if ( props.
contains(
"scale_method" ) )
1073 bool hasFillParam =
false, hasOutlineParam =
false, hasOutlineWidthParam =
false;
1074 bool hasDefaultFillColor =
false, hasDefaultOutlineColor =
false, hasDefaultOutlineWidth =
false;
1076 hasOutlineParam, hasDefaultOutlineColor, outlineColor,
1077 hasOutlineWidthParam, hasDefaultOutlineWidth, outlineWidth );
1078 if ( hasDefaultFillColor )
1082 if ( hasDefaultOutlineColor )
1086 if ( hasDefaultOutlineWidth )
1092 if ( props.
contains(
"size_unit" ) )
1094 if ( props.
contains(
"size_map_unit_scale" ) )
1098 if ( props.
contains(
"offset_unit" ) )
1100 if ( props.
contains(
"offset_map_unit_scale" ) )
1107 else if ( props.
contains(
"color" ) )
1116 else if ( props.
contains(
"outline_color" ) )
1120 else if ( props.
contains(
"line_color" ) )
1125 if ( props.
contains(
"outline-width" ) )
1130 else if ( props.
contains(
"outline_width" ) )
1134 else if ( props.
contains(
"line_width" ) )
1139 if ( props.
contains(
"outline_width_unit" ) )
1143 else if ( props.
contains(
"line_width_unit" ) )
1147 if ( props.
contains(
"outline_width_map_unit_scale" ) )
1150 if ( props.
contains(
"horizontal_anchor_point" ) )
1154 if ( props.
contains(
"vertical_anchor_point" ) )
1169 bool hasFillParam =
false, hasOutlineParam =
false, hasOutlineWidthParam =
false;
1170 bool hasDefaultFillColor =
false, hasDefaultOutlineColor =
false, hasDefaultOutlineWidth =
false;
1172 hasOutlineParam, hasDefaultOutlineColor, outlineColor,
1173 hasOutlineWidthParam, hasDefaultOutlineWidth, outlineWidth );
1174 if ( hasDefaultFillColor )
1178 if ( hasDefaultOutlineColor )
1182 if ( hasDefaultOutlineWidth )
1197 Q_UNUSED( context );
1203 Q_UNUSED( context );
1212 double scaledSize =
mSize;
1223 if ( hasDataDefinedSize && ok )
1228 scaledSize = sqrt( scaledSize );
1238 if ((
int )size < 1 || 10000.0 <
size )
1248 markerOffset( context, scaledSize, scaledSize, offsetX, offsetY );
1249 QPointF outputOffset( offsetX, offsetY );
1259 if ( hasDataDefinedRotation )
1319 bool fitsInCache =
true;
1320 bool usePict =
true;
1321 double hwRatio = 1.0;
1327 if ( fitsInCache && img.
width() > 1 )
1334 p->
drawImage( -transparentImage.
width() / 2.0, -transparentImage.
height() / 2.0, transparentImage );
1335 hwRatio = ( double )transparentImage.
height() / ( double )transparentImage.
width();
1340 hwRatio = ( double )img.
height() / ( double )img.
width();
1345 if ( usePict || !fitsInCache )
1351 if ( pct.
width() > 1 )
1357 hwRatio = ( double )pct.
height() / ( double )pct.
width();
1365 if ( penWidth > size / 20 )
1368 penWidth = size / 20;
1370 double penOffset = penWidth / 2;
1371 pen.setWidth( penWidth );
1374 double wSize = size + penOffset;
1375 double hSize = size * hwRatio + penOffset;
1376 p->
drawRect(
QRectF( -wSize / 2.0, -hSize / 2.0, wSize, hSize ) );
1469 double angle = props.
value(
"angle",
"0" ).toDouble( &ok );
1474 else if ( angle +
mAngle != 0 )
1490 if ( graphicElem.
isNull() )
1500 if ( mimeType !=
"image/svg+xml" )
1508 double d = angleFunc.
toDouble( &ok );
1528 Q_UNUSED( layerName );
1543 if ( hasDataDefinedSize && ok )
1548 size = sqrt( size );
1557 size *= mmMapUnitScaleFactor;
1560 double halfSize = size / 2.0;
1572 double offsetX = offset.
x();
1573 double offsetY = offset.
y();
1576 offsetX *= mmMapUnitScaleFactor;
1577 offsetY *= mmMapUnitScaleFactor;
1580 QPointF outputOffset( offsetX, offsetY );
1687 fontFamily = props[
"font"];
1688 if ( props.
contains(
"chr" ) && props[
"chr"].length() > 0 )
1689 chr = props[
"chr"].at( 0 );
1691 pointSize = props[
"size"].toDouble();
1695 angle = props[
"angle"].toDouble();
1700 if ( props.
contains(
"offset_unit" ) )
1702 if ( props.
contains(
"offset_map_unit_scale" ) )
1704 if ( props.
contains(
"size_unit" ) )
1706 if ( props.
contains(
"size_map_unit_scale" ) )
1708 if ( props.
contains(
"horizontal_anchor_point" ) )
1712 if ( props.
contains(
"vertical_anchor_point" ) )
1724 return "FontMarker";
1740 Q_UNUSED( context );
1772 if ( charToRender !=
mChr )
1778 double scaledSize =
mSize;
1789 if ( hasDataDefinedSize && ok )
1794 scaledSize = sqrt( scaledSize );
1804 markerOffset( context, scaledSize, scaledSize , offsetX, offsetY );
1805 QPointF outputOffset( offsetX, offsetY );
1815 if ( hasDataDefinedRotation )
1848 p->
drawText( -chrOffset, charToRender );
1856 props[
"chr"] =
mChr;
1902 double angle = props.
value(
"angle",
"0" ).toDouble( &ok );
1907 else if ( angle +
mAngle != 0 )
1922 if ( graphicElem.
isNull() )
1933 if ( !name.
startsWith(
"ttf://" ) || format !=
"ttf" )
1943 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)
static void createRotationElement(QDomDocument &doc, QDomElement &element, const QString &rotationFunc)
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)
QgsSimpleMarkerSymbolLayerV2(const QString &name=DEFAULT_SIMPLEMARKER_NAME, const QColor &color=DEFAULT_SIMPLEMARKER_COLOR, const QColor &borderColor=DEFAULT_SIMPLEMARKER_BORDERCOLOR, double size=DEFAULT_SIMPLEMARKER_SIZE, double angle=DEFAULT_SIMPLEMARKER_ANGLE, QgsSymbolV2::ScaleMethod scaleMethod=DEFAULT_SCALE_METHOD)
static void multiplyImageOpacity(QImage *image, qreal alpha)
Multiplies opacity of image pixel values with a (global) transparency value.
OutputUnit
The unit of the output.
void writeLine(const QgsPoint &pt1, const QgsPoint &pt2, const QString &layer, const QString &lineStyleName, const QColor &color, double width=-1)
Write line (as a polyline)
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
static QString encodeColor(const QColor &color)
#define DEFAULT_SIMPLEMARKER_ANGLE
static void externalGraphicToSld(QDomDocument &doc, QDomElement &element, const QString &path, const QString &mime, const QColor &color, double size=-1)
void scale(qreal sx, qreal sy)
#define DEFAULT_FONTMARKER_CHR
bool writeDxf(QgsDxfExport &e, double mmMapUnitScaleFactor, const QString &layerName, QgsSymbolV2RenderContext *context, const QgsFeature *f, const QPointF &shift=QPointF(0.0, 0.0)) const override
static QgsSymbolV2::ScaleMethod decodeScaleMethod(const QString &str)
Calculate scale by the diameter.
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 setOriginalValueVariable(const QVariant &value)
Sets the original value variable value for data defined symbology.
void writeSldMarker(QDomDocument &doc, QDomElement &element, const QgsStringMap &props) const override
QgsSymbolLayerV2 * clone() const override
void drawPolygon(const QPointF *points, int pointCount, Qt::FillRule fillRule)
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 QPointF decodePoint(const 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 writeSldMarker(QDomDocument &doc, QDomElement &element, const QgsStringMap &props) const override
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)
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
#define DEFAULT_SVGMARKER_ANGLE
static const QString EXPR_SIZE
void setOffsetUnit(QgsSymbolV2::OutputUnit unit)
#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 QgsSymbolV2::OutputUnit decodeOutputUnit(const QString &str)
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)
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.
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.
Mixed units in symbol layers.
void setFont(const QFont &font)
The output shall be in millimeters.
void setMapUnitScale(const QgsMapUnitScale &scale) override
QString number(int n, int base)
void setOutlineWidthUnit(QgsSymbolV2::OutputUnit u)
void markerOffset(QgsSymbolV2RenderContext &context, double &offsetX, double &offsetY) const
const QgsFeature * feature() const
Current feature being rendered - may be null.
void fill(uint pixelValue)
static QString encodePoint(QPointF point)
static double convertToPainterUnits(const QgsRenderContext &c, double size, QgsSymbolV2::OutputUnit unit, const QgsMapUnitScale &scale=QgsMapUnitScale())
Converts a size from the specied units to painter units.
QgsStringMap properties() const override
void setPath(const QString &path)
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
void setFillColor(const QColor &color) override
Set fill color.
QgsFontMarkerSymbolLayerV2(const QString &fontFamily=DEFAULT_FONTMARKER_FONT, QChar chr=DEFAULT_FONTMARKER_CHR, double pointSize=DEFAULT_FONTMARKER_SIZE, const QColor &color=DEFAULT_FONTMARKER_COLOR, double angle=DEFAULT_FONTMARKER_ANGLE)
double outlineWidth() const
bool prepareShape(const QString &name=QString())
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
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
void writeFilledCircle(const QString &layer, const QColor &color, const QgsPoint &pt, double radius)
Write filled circle (as hatch)
#define DEFAULT_FONTMARKER_ANGLE
QgsSymbolV2::OutputUnit outputUnit() const override
QgsMapUnitScale mOutlineWidthMapUnitScale
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.
static QgsSymbolLayerV2 * createFromSld(QDomElement &element)
HorizontalAnchorPoint mHorizontalAnchorPoint
void setColor(const QColor &color)
virtual Q_DECL_DEPRECATED void prepareExpressions(const QgsFields *fields, double scale=-1.0)
Prepares all data defined property expressions for evaluation.
void setOutlineWidthMapUnitScale(const QgsMapUnitScale &scale)
static Qt::PenStyle decodePenStyle(const QString &str)
QgsSymbolV2::ScaleMethod scaleMethod() const
static const QString EXPR_OUTLINE_STYLE
void writePolyline(const QgsPolyline &line, const QString &layer, const QString &lineStyleName, const QColor &color, double width=-1)
Draw dxf primitives (LWPOLYLINE)
bool writeDxf(QgsDxfExport &e, double mmMapUnitScaleFactor, const QString &layerName, QgsSymbolV2RenderContext *context, const QgsFeature *f, const QPointF &shift=QPointF(0.0, 0.0)) const override
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 writeCircle(const QString &layer, const QColor &color, const QgsPoint &pt, double radius, const QString &lineStyleName, double width)
Write circle (as polyline)
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 Q_DECL_DEPRECATED 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
Struct for storing maximum and minimum scales for measurements in map units.
QgsMapUnitScale mapUnitScale() const override
Qt::PenStyle outlineStyle() const
static const QString EXPR_NAME
QgsSvgMarkerSymbolLayerV2(const QString &name=DEFAULT_SVGMARKER_NAME, double size=DEFAULT_SVGMARKER_SIZE, double angle=DEFAULT_SVGMARKER_ANGLE, QgsSymbolV2::ScaleMethod scaleMethod=DEFAULT_SCALE_METHOD)
void setShift(const QPointF &shift)
void writeSldMarker(QDomDocument &doc, QDomElement &element, const QgsStringMap &props) const override
static QString encodeScaleMethod(QgsSymbolV2::ScaleMethod scaleMethod)
QgsRenderContext & renderContext()
QDomElement firstChildElement(const QString &tagName) const
bool preparePath(QString name=QString())
int count(const T &value) const
static const QString EXPR_COLOR_BORDER
const QgsGeometry * constGeometry() const
Gets a const pointer to the geometry object associated with this feature.
void writePolygon(const QgsPolygon &polygon, const QString &layer, const QString &hatchPattern, const QColor &color)
Draw dxf polygon (HATCH)
void translate(const QPointF &offset)
const QgsMapToPixel & mapToPixel() const
QgsSymbolV2::OutputUnit mOffsetUnit
void setAlphaF(qreal alpha)
virtual void setColor(const QColor &color)
void startRender(QgsSymbolV2RenderContext &context) override
static bool rotationFromSldElement(QDomElement &element, QString &rotationFunc)
double toDouble(bool *ok) const
static QColor decodeColor(const QString &str)
void startRender(QgsSymbolV2RenderContext &context) override
VerticalAnchorPoint mVerticalAnchorPoint
QgsSymbolV2::OutputUnit mSizeUnit
Calculate scale by the area.
void setDrawingSize(const QSizeF &size)
QgsMapUnitScale mOffsetMapUnitScale
void drawPicture(const QPointF &point, const QPicture &picture)
static const QString EXPR_OUTLINE
void restoreDataDefinedProperties(const QgsStringMap &stringMap)
Restores all data defined properties from string map.
static QgsMapUnitScale decodeMapUnitScale(const QString &str)
QDomElement createElement(const QString &tagName)
static void externalMarkerToSld(QDomDocument &doc, QDomElement &element, const QString &path, const QString &format, int *markIndex=0, const QColor &color=QColor(), double size=-1)
void map(int x, int y, int *tx, int *ty) const
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.
void renderPoint(const QPointF &point, QgsSymbolV2RenderContext &context) override
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 setOutputSize(const QRectF &r)
const T value(const Key &key) const
static Q_DECL_DEPRECATED void wellKnownMarkerToSld(QDomDocument &doc, QDomElement &element, const QString &name, const QColor &color, const QColor &borderColor=QColor(), double borderWidth=-1, double size=-1)
static QPointF _rotatedOffset(const QPointF &offset, double angle)
#define DEFAULT_SIMPLEMARKER_BORDERCOLOR