17 #include "qgsdxfexport.h"
26 #include <QDomDocument>
27 #include <QDomElement>
33 mUseCustomDashPattern( false ), mCustomDashPatternUnit(
QgsSymbolV2::MM ), mDrawInsidePolygon( false )
83 if ( props.contains(
"color" ) )
85 if ( props.contains(
"width" ) )
86 width = props[
"width"].toDouble();
87 if ( props.contains(
"penstyle" ) )
92 if ( props.contains(
"width_unit" ) )
94 if ( props.contains(
"offset" ) )
95 l->
setOffset( props[
"offset"].toDouble() );
96 if ( props.contains(
"offset_unit" ) )
98 if ( props.contains(
"offset_map_unit_scale" ) )
100 if ( props.contains(
"joinstyle" ) )
102 if ( props.contains(
"capstyle" ) )
105 if ( props.contains(
"use_custom_dash" ) )
109 if ( props.contains(
"customdash" ) )
113 if ( props.contains(
"customdash_unit" ) )
117 if ( props.contains(
"customdash_map_unit_scale" ) )
122 if ( props.contains(
"draw_inside_polygon" ) )
128 if ( props.contains(
"color_expression" ) )
130 if ( props.contains(
"width_expression" ) )
132 if ( props.contains(
"offset_expression" ) )
134 if ( props.contains(
"customdash_expression" ) )
136 if ( props.contains(
"joinstyle_expression" ) )
138 if ( props.contains(
"capstyle_expression" ) )
153 penColor.setAlphaF(
mColor.alphaF() * context.
alpha() );
154 mPen.setColor( penColor );
156 mPen.setWidthF( scaledWidth );
159 mPen.setStyle( Qt::CustomDashLine );
162 double dashWidthDiv = scaledWidth;
164 QStringList versionSplit = QString( qVersion() ).split(
"." );
165 if ( versionSplit.size() > 1
166 && versionSplit.at( 1 ).toInt() >= 8
171 QVector<qreal> scaledVector;
178 mPen.setDashPattern( scaledVector );
190 selColor.setAlphaF( context.
alpha() );
214 QPainterPath clipPath;
215 clipPath.addPolygon( points );
220 QList<QPolygonF>::const_iterator it = rings->constBegin();
221 for ( ; it != rings->constEnd(); ++it )
223 QPolygonF ring = *it;
224 clipPath.addPolygon( ring );
229 p->setClipPath( clipPath, Qt::IntersectClip );
235 foreach (
const QPolygonF& ring, *rings )
263 p->setRenderHint( QPainter::Antialiasing,
false );
264 p->drawPolyline( points );
265 p->setRenderHint( QPainter::Antialiasing,
true );
271 p->drawPolyline( points );
277 for (
int part = 0; part < mline.count(); ++part )
278 p->drawPolyline( mline[ part ] );
286 map[
"width"] = QString::number(
mWidth );
292 map[
"offset"] = QString::number(
mOffset );
328 QDomElement symbolizerElem = doc.createElement(
"se:LineSymbolizer" );
329 if ( !props.value(
"uom",
"" ).isEmpty() )
330 symbolizerElem.setAttribute(
"uom", props.value(
"uom",
"" ) );
331 element.appendChild( symbolizerElem );
337 QDomElement strokeElem = doc.createElement(
"se:Stroke" );
338 symbolizerElem.appendChild( strokeElem );
347 QDomElement perpOffsetElem = doc.createElement(
"se:PerpendicularOffset" );
348 perpOffsetElem.appendChild( doc.createTextNode( QString::number(
mOffset ) ) );
349 symbolizerElem.appendChild( perpOffsetElem );
372 QDomElement strokeElem = element.firstChildElement(
"Stroke" );
373 if ( strokeElem.isNull() )
385 &penJoinStyle, &penCapStyle,
386 &customDashVector ) )
390 QDomElement perpOffsetElem = element.firstChildElement(
"PerpendicularOffset" );
391 if ( !perpOffsetElem.isNull() )
394 double d = perpOffsetElem.firstChild().nodeValue().toDouble( &ok );
411 double scaledWidth = 0;
413 if ( strokeWidthExpression )
415 scaledWidth = strokeWidthExpression->
evaluate( const_cast<QgsFeature*>( context.
feature() ) ).toDouble()
417 pen.setWidthF( scaledWidth );
418 selPen.setWidthF( scaledWidth );
423 pen.setWidthF( scaledWidth );
424 selPen.setWidthF( scaledWidth );
429 if ( strokeColorExpression )
437 if ( lineOffsetExpression )
439 offset = lineOffsetExpression->
evaluate( const_cast<QgsFeature*>( context.
feature() ) ).toDouble();
444 if ( dashPatternExpression )
449 double dashWidthDiv =
mPen.widthF();
451 if ( strokeWidthExpression )
453 dashWidthDiv = pen.widthF();
454 scaledWidth = pen.widthF();
458 QStringList versionSplit = QString( qVersion() ).split(
"." );
459 if ( versionSplit.size() > 1
460 && versionSplit.at( 1 ).toInt() >= 8
466 QVector<qreal> dashVector;
467 QStringList dashList = dashPatternExpression->
evaluate( const_cast<QgsFeature*>( context.
feature() ) ).toString().split(
";" );
468 QStringList::const_iterator dashIt = dashList.constBegin();
469 for ( ; dashIt != dashList.constEnd(); ++dashIt )
473 pen.setDashPattern( dashVector );
478 if ( joinStyleExpression )
480 QString joinStyleString = joinStyleExpression->
evaluate( const_cast<QgsFeature*>( context.
feature() ) ).toString();
486 if ( capStyleExpression )
488 QString capStyleString = capStyleExpression->
evaluate( const_cast<QgsFeature*>( context.
feature() ) ).toString();
521 if ( strokeWidthExpression )
523 width = strokeWidthExpression->
evaluate( const_cast<QgsFeature*>( context.
feature() ) ).toDouble() * e.mapUnitScaleFactor( e.symbologyScaleDenominator(),
widthUnit(), e.mapUnits() );
530 return width * e.mapUnitScaleFactor( e.symbologyScaleDenominator(),
widthUnit(), e.mapUnits() );
536 if ( strokeColorExpression )
555 if ( p1.x() == p2.x() )
564 mT = float( p2.y() - p1.y() ) / ( p2.x() - p1.x() );
569 double x = ( p2.x() - p1.x() );
570 double y = ( p2.y() - p1.y() );
571 mLength = sqrt( x * x + y * y );
588 return (
mIncreasing ? QPointF( 0, interval ) : QPointF( 0, -interval ) );
590 double alpha = atan(
mT );
591 double dx = cos( alpha ) * interval;
592 double dy = sin( alpha ) * interval;
593 return (
mIncreasing ? QPointF( dx, dy ) : QPointF( -dx, -dy ) );
632 if ( props.contains(
"interval" ) )
633 interval = props[
"interval"].toDouble();
634 if ( props.contains(
"rotate" ) )
635 rotate = ( props[
"rotate"] ==
"1" );
638 if ( props.contains(
"offset" ) )
640 x->
setOffset( props[
"offset"].toDouble() );
642 if ( props.contains(
"offset_unit" ) )
646 if ( props.contains(
"interval_unit" ) )
650 if ( props.contains(
"offset_along_line" ) )
654 if ( props.contains(
"offset_along_line_unit" ) )
658 if ( props.contains((
"offset_along_line_map_unit_scale" ) ) )
663 if ( props.contains(
"offset_map_unit_scale" ) )
667 if ( props.contains(
"interval_map_unit_scale" ) )
672 if ( props.contains(
"placement" ) )
674 if ( props[
"placement"] ==
"vertex" )
676 else if ( props[
"placement"] ==
"lastvertex" )
678 else if ( props[
"placement"] ==
"firstvertex" )
680 else if ( props[
"placement"] ==
"centralpoint" )
687 if ( props.contains(
"interval_expression" ) )
691 if ( props.contains(
"offset_expression" ) )
695 if ( props.contains(
"placement_expression" ) )
699 if ( props.contains(
"offset_along_line_expression" ) )
745 if ( offsetExpression )
747 offset = offsetExpression->
evaluate( const_cast<QgsFeature*>( context.
feature() ) ).toDouble();
752 if ( placementExpression )
754 QString placementString = placementExpression->
evaluate( const_cast<QgsFeature*>( context.
feature() ) ).toString();
755 if ( placementString.compare(
"vertex", Qt::CaseInsensitive ) == 0 )
759 else if ( placementString.compare(
"lastvertex", Qt::CaseInsensitive ) == 0 )
763 else if ( placementString.compare(
"firstvertex", Qt::CaseInsensitive ) == 0 )
767 else if ( placementString.compare(
"centerpoint", Qt::CaseInsensitive ) == 0 )
790 for (
int part = 0; part < mline.count(); ++part )
792 const QPolygonF &points2 = mline[ part ];
806 if ( points.isEmpty() )
809 QPointF lastPt = points[0];
810 double lengthLeft = 0;
818 if ( intervalExpression )
820 interval = intervalExpression->
evaluate( const_cast<QgsFeature*>( context.
feature() ) ).toDouble();
828 if ( offsetAlongLineExpression )
830 offsetAlongLine = offsetAlongLineExpression->
evaluate( const_cast<QgsFeature*>( context.
feature() ) ).toDouble();
836 for (
int i = 1; i < points.count(); ++i )
838 const QPointF& pt = points[i];
849 double c = 1 - lengthLeft / painterUnitInterval;
867 while ( lengthLeft > painterUnitInterval )
871 lengthLeft -= painterUnitInterval;
884 static double _averageAngle(
const QPointF& prevPt,
const QPointF& pt,
const QPointF& nextPt )
889 double unitX = cos( a1 ) + cos( a2 ), unitY = sin( a1 ) + sin( a2 );
891 return atan2( unitY, unitX );
896 if ( points.isEmpty() )
907 if ( offsetAlongLineExpression )
909 offsetAlongLine = offsetAlongLineExpression->
evaluate( const_cast<QgsFeature*>( context.
feature() ) ).toDouble();
911 if ( offsetAlongLine != 0 )
924 i = points.count() - 1;
925 maxCount = points.count();
930 maxCount = points.count();
931 if ( points.first() == points.last() )
945 for ( ; i < maxCount; ++i )
947 if ( isRing && placement ==
Vertex && i == points.count() - 1 )
968 const QPointF& pt = points[vertex];
970 if ( isRing || ( vertex > 0 && vertex < points.count() - 1 ) )
972 int prevIndex = vertex - 1;
973 int nextIndex = vertex + 1;
975 if ( isRing && ( vertex == 0 || vertex == points.count() - 1 ) )
977 prevIndex = points.count() - 2;
981 QPointF prevPoint, nextPoint;
982 while ( prevIndex >= 0 )
984 prevPoint = points[ prevIndex ];
985 if ( prevPoint != pt )
992 while ( nextIndex < points.count() )
994 nextPoint = points[ nextIndex ];
995 if ( nextPoint != pt )
1002 if ( prevIndex >= 0 && nextIndex < points.count() )
1011 while ( vertex < points.size() - 1 )
1013 const QPointF& nextPt = points[vertex+1];
1025 while ( vertex >= 1 )
1027 const QPointF& prevPt = points[vertex-1];
1042 if ( points.isEmpty() )
1047 if ( distance == 0 )
1052 bool isRing =
false;
1053 if ( points.first() == points.last() )
1062 int pointIncrement = distance > 0 ? 1 : -1;
1063 QPointF previousPoint = points[vertex];
1064 int startPoint = distance > 0 ? qMin( vertex + 1, points.count() - 1 ) : qMax( vertex - 1, 0 );
1065 int endPoint = distance > 0 ? points.count() - 1 : 0;
1066 double distanceLeft = qAbs( distance );
1068 for (
int i = startPoint; pointIncrement > 0 ? i <= endPoint : i >= endPoint; i += pointIncrement )
1070 const QPointF& pt = points[i];
1072 if ( previousPoint == pt )
1076 MyLine l( previousPoint, pt );
1078 if ( distanceLeft < l.
length() )
1081 QPointF markerPoint = previousPoint + l.
diffForInterval( distanceLeft );
1091 distanceLeft -= l.
length();
1101 if ( points.size() > 0 )
1105 QPolygonF::const_iterator it = points.constBegin();
1107 for ( ++it; it != points.constEnd(); ++it )
1109 length += sqrt(( last.x() - it->x() ) * ( last.x() - it->x() ) +
1110 ( last.y() - it->y() ) * ( last.y() - it->y() ) );
1115 it = points.constBegin();
1117 qreal last_at = 0, next_at = 0;
1120 for ( ++it; it != points.constEnd(); ++it )
1123 next_at += sqrt(( last.x() - it->x() ) * ( last.x() - it->x() ) +
1124 ( last.y() - it->y() ) * ( last.y() - it->y() ) );
1125 if ( next_at >= length / 2 )
1134 qreal k = ( length * 0.5 - last_at ) / ( next_at - last_at );
1135 QPointF pt = last + ( next - last ) * k;
1152 map[
"interval"] = QString::number(
mInterval );
1153 map[
"offset"] = QString::number(
mOffset );
1162 map[
"placement"] =
"vertex";
1164 map[
"placement"] =
"lastvertex";
1166 map[
"placement"] =
"firstvertex";
1168 map[
"placement"] =
"centralpoint";
1170 map[
"placement"] =
"interval";
1216 QDomElement symbolizerElem = doc.createElement(
"se:LineSymbolizer" );
1217 if ( !props.value(
"uom",
"" ).isEmpty() )
1218 symbolizerElem.setAttribute(
"uom", props.value(
"uom",
"" ) );
1219 element.appendChild( symbolizerElem );
1253 QDomElement strokeElem = doc.createElement(
"se:Stroke" );
1254 symbolizerElem.appendChild( strokeElem );
1257 QDomElement graphicStrokeElem = doc.createElement(
"se:GraphicStroke" );
1258 strokeElem.appendChild( graphicStrokeElem );
1264 graphicStrokeElem.appendChild( doc.createComment( QString(
"MarkerSymbolLayerV2 expected, %1 found. Skip it." ).arg( markerLayer->
layerType() ) ) );
1271 if ( !gap.isEmpty() )
1273 QDomElement gapElem = doc.createElement(
"se:Gap" );
1275 graphicStrokeElem.appendChild( gapElem );
1280 QDomElement perpOffsetElem = doc.createElement(
"se:PerpendicularOffset" );
1281 perpOffsetElem.appendChild( doc.createTextNode( QString::number(
mOffset ) ) );
1282 symbolizerElem.appendChild( perpOffsetElem );
1291 QDomElement strokeElem = element.firstChildElement(
"Stroke" );
1292 if ( strokeElem.isNull() )
1295 QDomElement graphicStrokeElem = strokeElem.firstChildElement(
"GraphicStroke" );
1296 if ( graphicStrokeElem.isNull() )
1304 for ( QgsStringMap::iterator it = vendorOptions.begin(); it != vendorOptions.end(); ++it )
1306 if ( it.key() ==
"placement" )
1308 if ( it.value() ==
"points" ) placement =
Vertex;
1309 else if ( it.value() ==
"firstPoint" ) placement =
FirstVertex;
1310 else if ( it.value() ==
"lastPoint" ) placement =
LastVertex;
1311 else if ( it.value() ==
"centralPoint" ) placement =
CentralPoint;
1313 else if ( it.value() ==
"rotateMarker" )
1315 rotateMarker = it.value() ==
"0";
1333 QDomElement gapElem = graphicStrokeElem.firstChildElement(
"Gap" );
1334 if ( !gapElem.isNull() )
1337 double d = gapElem.firstChild().nodeValue().toDouble( &ok );
1343 QDomElement perpOffsetElem = graphicStrokeElem.firstChildElement(
"PerpendicularOffset" );
1344 if ( !perpOffsetElem.isNull() )
1347 double d = perpOffsetElem.firstChild().nodeValue().toDouble( &ok );
static double _averageAngle(const QPointF &prevPt, const QPointF &pt, const QPointF &nextPt)
void setIntervalUnit(QgsSymbolV2::OutputUnit unit)
static QString encodeOutputUnit(QgsSymbolV2::OutputUnit unit)
void renderPolygonOutline(const QPolygonF &points, QList< QPolygonF > *rings, QgsSymbolV2RenderContext &context)
QgsMapUnitScale mOffsetMapUnitScale
double estimateMaxBleed() const
Returns the estimated maximum distance which the layer style will bleed outside the drawn shape...
Class for parsing and evaluation of expressions (formerly called "search strings").
#define DEFAULT_SIMPLELINE_PENSTYLE
void startRender(QgsSymbolV2RenderContext &context)
#define DEFAULT_MARKERLINE_ROTATE
void setOutputUnit(QgsSymbolV2::OutputUnit unit)
float threshold() const
Gets the simplification threshold of the vector layer managed.
virtual double width() const
double markerAngle(const QPolygonF &points, bool isRing, int vertex)
QgsMapUnitScale mapUnitScale() const
QgsSymbolV2::OutputUnit outputUnit() const
#define DEFAULT_MARKERLINE_INTERVAL
QVariant evaluate(const QgsFeature *f=NULL)
Evaluate the feature and return the result.
QColor selectionColor() const
Added in QGIS v2.0.
const QgsVectorSimplifyMethod & vectorSimplifyMethod() const
Added in QGIS v2.4.
QgsSymbolV2 * subSymbol()
void setCustomDashPatternUnit(QgsSymbolV2::OutputUnit unit)
QgsMapUnitScale mCustomDashPatternMapUnitScale
double rendererScale() const
static QgsStringMap getVendorOptionList(QDomElement &element)
QgsGeometry * geometry() const
Get the geometry object associated with this feature.
void setUseCustomDashPattern(bool b)
static QVector< qreal > decodeRealVector(const QString &s)
void renderPolylineInterval(const QPolygonF &points, QgsSymbolV2RenderContext &context)
QVector< qreal > customDashVector() const
void setPenJoinStyle(Qt::PenJoinStyle style)
void setOffsetUnit(QgsSymbolV2::OutputUnit unit)
QgsSymbolV2::OutputUnit outputUnit() const
QGis::GeometryType type()
Returns type of the vector.
QgsSymbolV2::OutputUnit outputUnit() const
static QDomElement createVendorOptionElement(QDomDocument &doc, QString name, QString value)
Qt::PenCapStyle mPenCapStyle
static QColor decodeColor(QString str)
QgsSymbolLayerV2 * clone() const
static const bool selectionIsOpaque
static QString encodeMapUnitScale(const QgsMapUnitScale &mapUnitScale)
bool setSubSymbol(QgsSymbolV2 *symbol)
QVector< qreal > dxfCustomDashPattern(QgsSymbolV2::OutputUnit &unit) const
QgsMapUnitScale mWidthMapUnitScale
void setIntervalMapUnitScale(const QgsMapUnitScale &scale)
void renderPolyline(const QPolygonF &points, QgsSymbolV2RenderContext &context)
void setOffsetMapUnitScale(const QgsMapUnitScale &scale)
QString layerType() const
QMap< QString, QString > QgsStringMap
QString layerType() const
bool qgsDoubleNear(double a, double b, double epsilon=4 *DBL_EPSILON)
Qt::PenStyle penStyle() const
void setWidthUnit(QgsSymbolV2::OutputUnit unit)
QgsMapUnitScale mOffsetAlongLineMapUnitScale
void setOffsetAlongLine(double offsetAlongLine)
Sets the the offset along the line for the marker placement.
static QString encodeColor(QColor color)
void setInterval(double interval)
virtual QgsExpression * expression(const QString &property) const
QgsSymbolV2::OutputUnit mOffsetUnit
qreal alpha() const
Get alpha transparency 1 for opaque, 0 for invisible.
bool mUseCustomDashPattern
void setDrawInsidePolygon(bool drawInsidePolygon)
static QString encodePenStyle(Qt::PenStyle style)
QPointF diffForInterval(double interval)
void setColor(const QColor &color)
QgsSymbolV2::OutputUnit mIntervalUnit
virtual void writeSldMarker(QDomDocument &doc, QDomElement &element, QgsStringMap props) const
static QgsSymbolLayerV2 * createMarkerLayerFromSld(QDomElement &element)
QgsStringMap properties() const
double offsetAlongLine() const
Returns the offset along the line for the marker placement.
static QString ogrFeatureStylePen(double width, double mmScaleFactor, double mapUnitsScaleFactor, const QColor &c, Qt::PenJoinStyle joinStyle=Qt::MiterJoin, Qt::PenCapStyle capStyle=Qt::FlatCap, double offset=0.0, const QVector< qreal > *dashPattern=0)
Create ogr feature style string for pen.
const QgsFeature * feature() const
Current feature being rendered - may be null.
void startRender(QgsRenderContext &context, const QgsFields *fields=0)
The geometries can be rendered with 'AntiAliasing' disabled because of it is '1-pixel size'...
Qt::PenJoinStyle mPenJoinStyle
static Qt::PenCapStyle decodePenCapStyle(QString str)
static QgsSymbolLayerV2 * create(const QgsStringMap &properties=QgsStringMap())
static Qt::PenStyle decodePenStyle(QString str)
QgsSymbolV2::OutputUnit mWidthUnit
void setMapUnitScale(const QgsMapUnitScale &scale)
void setWidthMapUnitScale(const QgsMapUnitScale &scale)
static bool createFunctionElement(QDomDocument &doc, QDomElement &element, QString function)
QVector< qreal > mCustomDashVector
Vector with an even number of entries for the.
#define DEFAULT_SIMPLELINE_WIDTH
static QString encodePenJoinStyle(Qt::PenJoinStyle style)
static QgsSymbolLayerV2 * createFromSld(QDomElement &element)
void setAngle(double angle)
bool rotateMarker() const
#define DEFAULT_SIMPLELINE_CAPSTYLE
#define DEFAULT_SIMPLELINE_JOINSTYLE
void setOutputUnit(QgsSymbolV2::OutputUnit unit)
void setSize(double size)
double rasterScaleFactor() const
void startRender(QgsSymbolV2RenderContext &context)
QgsMapUnitScale mapUnitScale() const
virtual QColor color() const
void setOffsetAlongLineMapUnitScale(const QgsMapUnitScale &scale)
Sets the map unit scale used for calculating the offset in map units along line for markers...
QString ogrFeatureStyle(double mmScaleFactor, double mapUnitScaleFactor) const
void setOffset(double offset)
void renderOffsetVertexAlongLine(const QPolygonF &points, int vertex, double distance, QgsSymbolV2RenderContext &context)
Renders a marker by offseting a vertex along the line by a specified distance.
void setOffsetAlongLineUnit(QgsSymbolV2::OutputUnit unit)
Sets the unit used for calculating the offset along line for markers.
void renderPoint(const QPointF &point, const QgsFeature *f, QgsRenderContext &context, int layer=-1, bool selected=false)
virtual void prepareExpressions(const QgsFields *fields, double scale=-1.0)
QgsMapUnitScale mOffsetMapUnitScale
QgsStringMap properties() const
void setPenCapStyle(Qt::PenCapStyle style)
void setCustomDashVector(const QVector< qreal > &vector)
static QgsSymbolLayerV2 * create(const QgsStringMap &properties=QgsStringMap())
void setMapUnitScale(const QgsMapUnitScale &scale)
QgsMarkerSymbolV2 * mMarker
QgsMapUnitScale mapUnitScale() const
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 setOffsetMapUnitScale(const QgsMapUnitScale &scale)
void setOffset(double offset)
virtual void setWidth(double width)
void setColor(const QColor &color)
static QString encodeRealVector(const QVector< qreal > &v)
QgsSymbolV2::OutputUnit mCustomDashPatternUnit
virtual QString layerType() const =0
void renderPolyline(const QPolygonF &points, QgsSymbolV2RenderContext &context)
QgsSymbolLayerV2 * clone() const
~QgsMarkerLineSymbolLayerV2()
static QgsSymbolLayerV2 * createFromSld(QDomElement &element)
void applyDataDefinedSymbology(QgsSymbolV2RenderContext &context, QPen &pen, QPen &selPen, double &offset)
static void lineToSld(QDomDocument &doc, QDomElement &element, Qt::PenStyle penStyle, QColor color, double width=-1, const Qt::PenJoinStyle *penJoinStyle=0, const Qt::PenCapStyle *penCapStyle=0, const QVector< qreal > *customDashPattern=0, double dashOffset=0.0)
#define DEFAULT_SIMPLELINE_COLOR
static void createGeometryElement(QDomDocument &doc, QDomElement &element, QString geomFunc)
QgsMapUnitScale mIntervalMapUnitScale
Contains information about the context of a rendering operation.
QgsSymbolV2::OutputUnit mOffsetAlongLineUnit
void stopRender(QgsRenderContext &context)
QgsSimpleLineSymbolLayerV2(QColor color=DEFAULT_SIMPLELINE_COLOR, double width=DEFAULT_SIMPLELINE_WIDTH, Qt::PenStyle penStyle=DEFAULT_SIMPLELINE_PENSTYLE)
void stopRender(QgsSymbolV2RenderContext &context)
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 setPlacement(Placement p)
void toSld(QDomDocument &doc, QDomElement &element, QgsStringMap props) const
QList< QPolygonF > offsetLine(QPolygonF polyline, double dist, QGis::GeometryType geometryType)
calculate geometry shifted by a specified distance
virtual QgsSymbolV2 * clone() const
QList< QgsSymbolLayerV2 * > QgsSymbolLayerV2List
virtual double width() const
void setCustomDashPatternMapUnitScale(const QgsMapUnitScale &scale)
double dxfWidth(const QgsDxfExport &e, const QgsSymbolV2RenderContext &context) const
QgsRenderContext & renderContext()
double estimateMaxBleed() const
Returns the estimated maximum distance which the layer style will bleed outside the drawn shape...
SimplifyHints simplifyHints() const
Gets the simplification hints of the vector layer managed.
const QgsFields * fields() const
Fields of the layer.
void setRenderHints(int hints)
static Qt::PenJoinStyle decodePenJoinStyle(QString str)
void setOutputUnit(QgsSymbolV2::OutputUnit unit)
MyLine(QPointF p1, QPointF p2)
Placement placement() const
void toSld(QDomDocument &doc, QDomElement &element, QgsStringMap props) const
QgsSymbolV2::OutputUnit mOffsetUnit
static QgsMapUnitScale decodeMapUnitScale(const QString &str)
QgsSymbolLayerV2 * symbolLayer(int layer)
Qt::PenStyle dxfPenStyle() const
static bool lineFromSld(QDomElement &element, Qt::PenStyle &penStyle, QColor &color, double &width, Qt::PenJoinStyle *penJoinStyle=0, Qt::PenCapStyle *penCapStyle=0, QVector< qreal > *customDashPattern=0, double *dashOffset=0)
QgsMarkerLineSymbolLayerV2(bool rotateMarker=DEFAULT_MARKERLINE_ROTATE, double interval=DEFAULT_MARKERLINE_INTERVAL)
void saveDataDefinedProperties(QgsStringMap &stringMap) const
Saves data defined properties to string map.
void setOffsetUnit(QgsSymbolV2::OutputUnit unit)
void setAlpha(qreal alpha)
Set alpha transparency 1 for opaque, 0 for invisible.
void renderPolylineCentral(const QPolygonF &points, QgsSymbolV2RenderContext &context)
QColor dxfColor(const QgsSymbolV2RenderContext &context) const
static bool canbeGeneralizedByDeviceBoundingBox(const QgsRectangle &envelope, float mapToPixelTol=1.0f)
Returns whether the device-envelope can be replaced by its BBOX when is applied the specified toleran...
void stopRender(QgsSymbolV2RenderContext &context)
QgsSymbolV2::OutputUnit widthUnit() const
static QgsSymbolV2::OutputUnit decodeOutputUnit(QString str)
Qt::PenJoinStyle penJoinStyle() const
void renderPolylineVertex(const QPolygonF &points, QgsSymbolV2RenderContext &context, Placement placement=Vertex)
void copyDataDefinedProperties(QgsSymbolLayerV2 *destLayer) const
Copies data defined properties of this layer to another symbol layer.
void setMapUnitScale(const QgsMapUnitScale &scale)
Qt::PenCapStyle penCapStyle() const
static QString encodePenCapStyle(Qt::PenCapStyle style)
virtual void setDataDefinedProperty(const QString &property, const QString &expressionString)