28 #include <QSvgRenderer>    31 #include <QDomDocument>    32 #include <QDomElement>   145   if ( !hasDataDefinedSize )
   148     double half = scaledSize / 2.0;
   149     transform.
scale( half, half );
   184   bool hasDataDefinedSize = 
false;
   185   double scaledSize = 
calculateSize( context, hasDataDefinedSize );
   187   bool hasDataDefinedRotation = 
false;
   193   bool createdNewPath = 
false;
   211         createdNewPath = 
true;
   223   transform.
translate( point.
x() + offset.
x(), point.
y() + offset.
y() );
   226   if ( hasDataDefinedSize || createdNewPath )
   229     double half = s / 2.0;
   230     transform.
scale( half, half );
   233   if ( !
qgsDoubleNear( angle, 0.0 ) && ( hasDataDefinedRotation || createdNewPath ) )
   234     transform.
rotate( angle );
   248   draw( context, symbol, polygon, path );
   253   bool hasDataDefinedSize = 
false;
   254   double scaledSize = 
calculateSize( context, hasDataDefinedSize );
   256   bool hasDataDefinedRotation = 
false;
   266   transform.
translate( point.
x() + offset.
x(), point.
y() + offset.
y() );
   269     transform.
rotate( angle );
   283   if ( cleaned ==  
"square" || cleaned ==  
"rectangle" )
   285   else if ( cleaned ==  
"diamond" )
   287   else if ( cleaned ==  
"pentagon" )
   289   else if ( cleaned ==  
"hexagon" )
   291   else if ( cleaned ==  
"triangle" )
   293   else if ( cleaned ==  
"equilateral_triangle" )
   295   else if ( cleaned ==  
"star" || cleaned == 
"regular_star" )
   297   else if ( cleaned ==  
"arrow" )
   299   else if ( cleaned ==  
"circle" )
   301   else if ( cleaned ==  
"cross" )
   303   else if ( cleaned ==  
"cross_fill" )
   305   else if ( cleaned ==  
"cross2" || cleaned == 
"x" )
   307   else if ( cleaned ==  
"line" )
   309   else if ( cleaned ==  
"arrowhead" )
   311   else if ( cleaned ==  
"filled_arrowhead" )
   313   else if ( cleaned ==  
"semi_circle" )
   315   else if ( cleaned ==  
"third_circle" )
   317   else if ( cleaned ==  
"quarter_circle" )
   319   else if ( cleaned ==  
"quarter_square" )
   321   else if ( cleaned ==  
"half_square" )
   323   else if ( cleaned ==  
"diagonal_half_square" )
   325   else if ( cleaned ==  
"right_half_triangle" )
   327   else if ( cleaned ==  
"left_half_triangle" )
   342       return "quarter_square";
   344       return "half_square";
   346       return "diagonal_half_square";
   356       return "equilateral_triangle";
   358       return "left_half_triangle";
   360       return "right_half_triangle";
   366       return "filled_arrowhead";
   380       return "semi_circle";
   382       return "third_circle";
   384       return "quarter_circle";
   417       polygon << QPointF( -1, 0 ) << QPointF( 0, 1 )
   418       << QPointF( 1, 0 ) << QPointF( 0, -1 ) << QPointF( -1, 0 );
   428       polygon << QPointF( -0.9511, -0.3090 )
   429       << QPointF( -0.5878, 0.8090 )
   430       << QPointF( 0.5878, 0.8090 )
   431       << QPointF( 0.9511, -0.3090 )
   433       << QPointF( -0.9511, -0.3090 );
   444       polygon << QPointF( -0.8660, -0.5 )
   445       << QPointF( -0.8660, 0.5 )
   447       << QPointF( 0.8660, 0.5 )
   448       << QPointF( 0.8660, -0.5 )
   450       << QPointF( -0.8660, -0.5 );
   454       polygon << QPointF( -1, 1 ) << QPointF( 1, 1 ) << QPointF( 0, -1 ) << QPointF( -1, 1 );
   462       polygon << QPointF( -0.8660, 0.5 )
   463       << QPointF( 0.8660, 0.5 )
   465       << QPointF( -0.8660, 0.5 );
   469       polygon << QPointF( 0, 1 ) << QPointF( 1, 1 ) << QPointF( 0, -1 ) << QPointF( 0, 1 );
   473       polygon << QPointF( -1, 1 ) << QPointF( 0, 1 ) << QPointF( 0, -1 ) << QPointF( -1, 1 );
   480       polygon << QPointF( inner_r * sin( 
DEG2RAD( 324.0 ) ), - inner_r * cos( 
DEG2RAD( 324.0 ) ) )  
   482       << QPointF( inner_r * sin( 
DEG2RAD( 252.0 ) ), - inner_r * cos( 
DEG2RAD( 252.0 ) ) )   
   484       << QPointF( 0, inner_r )         
   486       << QPointF( inner_r * sin( 
DEG2RAD( 108.0 ) ), - inner_r * cos( 
DEG2RAD( 108.0 ) ) )   
   488       << QPointF( inner_r * sin( 
DEG2RAD( 36.0 ) ), - inner_r * cos( 
DEG2RAD( 36.0 ) ) )   
   490       << QPointF( inner_r * sin( 
DEG2RAD( 324.0 ) ), - inner_r * cos( 
DEG2RAD( 324.0 ) ) );  
   495       polygon << QPointF( 0, -1 )
   496       << QPointF( 0.5,  -0.5 )
   497       << QPointF( 0.25, -0.5 )
   498       << QPointF( 0.25,  1 )
   499       << QPointF( -0.25,  1 )
   500       << QPointF( -0.25, -0.5 )
   501       << QPointF( -0.5,  -0.5 )
   506       polygon << QPointF( 0, 0 ) << QPointF( -1, 1 ) << QPointF( -1, -1 ) << QPointF( 0, 0 );
   510       polygon << QPointF( -1, -0.2 )
   511       << QPointF( -1, -0.2 )
   512       << QPointF( -1, 0.2 )
   513       << QPointF( -0.2, 0.2 )
   514       << QPointF( -0.2, 1 )
   516       << QPointF( 0.2, 0.2 )
   518       << QPointF( 1, -0.2 )
   519       << QPointF( 0.2, -0.2 )
   520       << QPointF( 0.2, -1 )
   521       << QPointF( -0.2, -1 )
   522       << QPointF( -0.2, -0.2 )
   523       << QPointF( -1, -0.2 );
   613   double scaledSize = 
mSize;
   623   if ( hasDataDefinedSize && ok )
   628         scaledSize = sqrt( scaledSize );
   643   markerOffset( context, scaledSize, scaledSize, offsetX, offsetY );
   644   offset = 
QPointF( offsetX, offsetY );
   649   bool usingDataDefinedRotation = 
false;
   654     usingDataDefinedRotation = ok;
   658   if ( hasDataDefinedRotation )
   687     Qt::PenJoinStyle penJoinStyle )
   689     , mBorderColor( borderColor )
   690     , mOutlineStyle( 
Qt::SolidLine )
   693     , mPenJoinStyle( penJoinStyle )
   695     , mUsingCache( false )
   729   if ( props.
contains( 
"color_border" ) )
   734   else if ( props.
contains( 
"outline_color" ) )
   738   else if ( props.
contains( 
"line_color" ) )
   742   if ( props.
contains( 
"joinstyle" ) )
   747     size = props[
"size"].toDouble();
   749     angle = props[
"angle"].toDouble();
   750   if ( props.
contains( 
"scale_method" ) )
   756   if ( props.
contains( 
"offset_unit" ) )
   758   if ( props.
contains( 
"offset_map_unit_scale" ) )
   760   if ( props.
contains( 
"size_unit" ) )
   762   if ( props.
contains( 
"size_map_unit_scale" ) )
   765   if ( props.
contains( 
"outline_style" ) )
   769   else if ( props.
contains( 
"line_style" ) )
   773   if ( props.
contains( 
"outline_width" ) )
   777   else if ( props.
contains( 
"line_width" ) )
   781   if ( props.
contains( 
"outline_width_unit" ) )
   785   if ( props.
contains( 
"line_width_unit" ) )
   789   if ( props.
contains( 
"outline_width_map_unit_scale" ) )
   794   if ( props.
contains( 
"horizontal_anchor_point" ) )
   798   if ( props.
contains( 
"vertical_anchor_point" ) )
   811   return "SimpleMarker";
   832   if ( context.
alpha() < 1 )
   892   int imageSize = ( 
static_cast< int >( scaledSize ) + pw ) / 2 * 2 + 1; 
   893   double center = imageSize / 2.0;
   900   mCache = 
QImage( 
QSize( imageSize, imageSize ), QImage::Format_ARGB32_Premultiplied );
   937     p.
fillRect( 0, 0, imageSize, imageSize, selColor );
  1055     bool hasDataDefinedSize = 
false;
  1056     double scaledSize = 
calculateSize( context, hasDataDefinedSize );
  1058     bool hasDataDefinedRotation = 
false;
  1064                           point.
y() - s / 2.0 + offset.
y(),
  1133   double angle = props.
value( 
"angle", 
"0" ).toDouble( &ok );
  1151   Q_UNUSED( mmScaleFactor );
  1152   Q_UNUSED( mapUnitScaleFactor );
  1155   if ( 
mName == 
"square" )
  1159   else if ( 
mName == 
"triangle" )
  1163   else if ( 
mName == 
"star" )
  1167   else if ( 
mName == 
"circle" )
  1171   else if ( 
mName == 
"cross" )
  1175   else if ( 
mName == 
"x" || 
mName == 
"cross2" )
  1179   else if ( 
mName == 
"line" )
  1185   ogrString.
append( 
"SYMBOL(" );
  1186   ogrString.
append( 
"id:" );
  1187   ogrString.
append( 
'\"' );
  1188   ogrString.
append( 
"ogr-sym-" );
  1189   ogrString.
append( ogrType );
  1190   ogrString.
append( 
'\"' );
  1191   ogrString.
append( 
",c:" );
  1193   ogrString.
append( 
",o:" );
  1201   ogrString.
append( 
"PEN(" );
  1202   ogrString.
append( 
"c:" );
  1204   ogrString.
append( 
",w:" );
  1206   ogrString.
append( 
"mm" );
  1216   if ( graphicElem.
isNull() )
  1221   double borderWidth, 
size;
  1222   Qt::PenStyle borderStyle;
  1232     double d = angleFunc.
toDouble( &ok );
  1259   Q_UNUSED( context );
  1273   Q_UNUSED( mmMapUnitScaleFactor );
  1282   if ( hasDataDefinedSize )
  1295           size = sqrt( size );
  1308   double halfSize = size / 2.0;
  1349   QPointF off( offsetX, offsetY );
  1386     t.
scale( halfSize, -halfSize );
  1388     polygon = t.
map( polygon );
  1391     for ( 
int i = 0; i < polygon.
size(); i++ )
  1399       e.
writePolyline( p, layerName, 
"CONTINUOUS", pc, outlineWidth );
  1401   else if ( shape == 
Circle )
  1409   else if ( shape == 
Line )
  1417   else if ( shape == 
Cross )
  1430   else if ( shape == 
Cross2 )
  1501   double penWidth = 0.0;
  1516     if ( ok && outlineStyle == 
"no" )
  1522   penWidth += pixelSize;
  1525   symbolBounds.
adjust( -penWidth / 2.0, -penWidth / 2.0,
  1526                        penWidth / 2.0, penWidth / 2.0 );
  1528   return symbolBounds;
  1576     name = props[
"name"];
  1578     size = props[
"size"].toDouble();
  1580     angle = props[
"angle"].toDouble();
  1581   if ( props.
contains( 
"scale_method" ) )
  1587   if ( props.
contains( 
"offset_unit" ) )
  1589   if ( props.
contains( 
"offset_map_unit_scale" ) )
  1591   if ( props.
contains( 
"size_unit" ) )
  1593   if ( props.
contains( 
"size_map_unit_scale" ) )
  1595   if ( props.
contains( 
"horizontal_anchor_point" ) )
  1599   if ( props.
contains( 
"vertical_anchor_point" ) )
  1613   return "FilledMarker";
  1669   return mFill.
data();
  1676     mFill.
reset( static_cast<QgsFillSymbolV2*>( symbol ) );
  1699     attr.
unite( mFill->usedAttributes() );
  1707     mFill->setColor( c );
  1712   return mFill.
data() ?  mFill->color() : 
mColor;
  1760   mOutlineWidth = 0.2;
  1763   mOutlineColor = 
QColor( Qt::black );
  1775     name = props[
"name"];
  1777     size = props[
"size"].toDouble();
  1779     angle = props[
"angle"].toDouble();
  1780   if ( props.
contains( 
"scale_method" ) )
  1790     double fillOpacity = 1.0;
  1791     double outlineOpacity = 1.0;
  1792     double outlineWidth;
  1793     bool hasFillParam = 
false, hasFillOpacityParam = 
false, hasOutlineParam = 
false, hasOutlineWidthParam = 
false, hasOutlineOpacityParam = 
false;
  1794     bool hasDefaultFillColor = 
false, hasDefaultFillOpacity = 
false, hasDefaultOutlineColor = 
false, hasDefaultOutlineWidth = 
false, hasDefaultOutlineOpacity = 
false;
  1796         hasFillOpacityParam, hasDefaultFillOpacity, fillOpacity,
  1797         hasOutlineParam, hasDefaultOutlineColor, outlineColor,
  1798         hasOutlineWidthParam, hasDefaultOutlineWidth, outlineWidth,
  1799         hasOutlineOpacityParam, hasDefaultOutlineOpacity, outlineOpacity );
  1800     if ( hasDefaultFillColor )
  1804     if ( hasDefaultFillOpacity )
  1810     if ( hasDefaultOutlineColor )
  1814     if ( hasDefaultOutlineWidth )
  1818     if ( hasDefaultOutlineOpacity )
  1826   if ( props.
contains( 
"size_unit" ) )
  1828   if ( props.
contains( 
"size_map_unit_scale" ) )
  1832   if ( props.
contains( 
"offset_unit" ) )
  1834   if ( props.
contains( 
"offset_map_unit_scale" ) )
  1841   else if ( props.
contains( 
"color" ) )
  1850   else if ( props.
contains( 
"outline_color" ) )
  1854   else if ( props.
contains( 
"line_color" ) )
  1859   if ( props.
contains( 
"outline-width" ) )
  1864   else if ( props.
contains( 
"outline_width" ) )
  1868   else if ( props.
contains( 
"line_width" ) )
  1873   if ( props.
contains( 
"outline_width_unit" ) )
  1877   else if ( props.
contains( 
"line_width_unit" ) )
  1881   if ( props.
contains( 
"outline_width_map_unit_scale" ) )
  1884   if ( props.
contains( 
"horizontal_anchor_point" ) )
  1888   if ( props.
contains( 
"vertical_anchor_point" ) )
  1901   QColor defaultFillColor, defaultOutlineColor;
  1902   double outlineWidth, fillOpacity, outlineOpacity;
  1903   bool hasFillParam = 
false, hasFillOpacityParam = 
false, hasOutlineParam = 
false, hasOutlineWidthParam = 
false, hasOutlineOpacityParam = 
false;
  1904   bool hasDefaultFillColor = 
false, hasDefaultFillOpacity = 
false, hasDefaultOutlineColor = 
false, hasDefaultOutlineWidth = 
false, hasDefaultOutlineOpacity = 
false;
  1906       hasFillOpacityParam, hasDefaultFillOpacity, fillOpacity,
  1907       hasOutlineParam, hasDefaultOutlineColor, defaultOutlineColor,
  1908       hasOutlineWidthParam, hasDefaultOutlineWidth, outlineWidth,
  1909       hasOutlineOpacityParam, hasDefaultOutlineOpacity, outlineOpacity );
  1911   double newFillOpacity = hasFillOpacityParam ? 
fillColor().
alphaF() : 1.0;
  1914   if ( hasDefaultFillColor )
  1916     defaultFillColor.
setAlphaF( newFillOpacity );
  1919   if ( hasDefaultFillOpacity )
  1925   if ( hasDefaultOutlineColor )
  1927     defaultOutlineColor.
setAlphaF( newOutlineOpacity );
  1930   if ( hasDefaultOutlineWidth )
  1932     setOutlineWidth( outlineWidth );
  1934   if ( hasDefaultOutlineOpacity )
  1951   Q_UNUSED( context );
  1957   Q_UNUSED( context );
  1966   bool hasDataDefinedSize = 
false;
  1967   double scaledSize = 
calculateSize( context, hasDataDefinedSize );
  1971   if ( static_cast< int >( size ) < 1 || 10000.0 < 
size )
  1995   double outlineWidth = mOutlineWidth;
  2022   bool fitsInCache = 
true;
  2023   bool usePict = 
true;
  2024   double hwRatio = 1.0;
  2030     if ( fitsInCache && img.
width() > 1 )
  2037         p->
drawImage( -transparentImage.
width() / 2.0, -transparentImage.
height() / 2.0, transparentImage );
  2038         hwRatio = 
static_cast< double >( transparentImage.
height() ) / static_cast< double >( transparentImage.
width() );
  2043         hwRatio = 
static_cast< double >( img.
height() ) / static_cast< double >( img.
width() );
  2048   if ( usePict || !fitsInCache )
  2054     if ( pct.
width() > 1 )
  2060       hwRatio = 
static_cast< double >( pct.
height() ) / static_cast< double >( pct.
width() );
  2068     if ( penWidth > size / 20 )
  2071       penWidth = size / 20;
  2073     double penOffset = penWidth / 2;
  2074     pen.setWidth( penWidth );
  2077     double wSize = size + penOffset;
  2078     double hSize = size * hwRatio + penOffset;
  2079     p->
drawRect( 
QRectF( -wSize / 2.0, -hSize / 2.0, wSize, hSize ) );
  2092 double QgsSvgMarkerSymbolLayerV2::calculateSize( 
QgsSymbolV2RenderContext& context, 
bool& hasDataDefinedSize )
 const  2094   double scaledSize = 
mSize;
  2104   if ( hasDataDefinedSize && ok )
  2109         scaledSize = sqrt( scaledSize );
  2124   markerOffset( context, scaledSize, scaledSize, offsetX, offsetY );
  2125   offset = 
QPointF( offsetX, offsetY );
  2135   if ( hasDataDefinedRotation )
  2206   mOutlineWidthUnit = unit;
  2212   if ( unit != mOutlineWidthUnit )
  2222   mOutlineWidthMapUnitScale = scale;
  2229     return mOutlineWidthMapUnitScale;
  2246   double angle = props.
value( 
"angle", 
"0" ).toDouble( &ok );
  2268   if ( graphicElem.
isNull() )
  2281   if ( mimeType != 
"image/svg+xml" )
  2289     double d = angleFunc.
toDouble( &ok );
  2309   Q_UNUSED( layerName );
  2324   if ( hasDataDefinedSize && ok )
  2329         size = sqrt( size );
  2338     size *= mmMapUnitScaleFactor;
  2341   double halfSize = size / 2.0;
  2353   double offsetX = offset.
x();
  2354   double offsetY = offset.
y();
  2356   QPointF outputOffset( offsetX, offsetY );
  2377   double outlineWidth = mOutlineWidth;
  2437   bool hasDataDefinedSize = 
false;
  2438   double scaledSize = 
calculateSize( context, hasDataDefinedSize );
  2442   if ( static_cast< int >( scaledSize ) < 1 || 10000.0 < scaledSize )
  2458   double outlineWidth = mOutlineWidth;
  2490   double scaledHeight = svgViewbox.
isValid() ? scaledSize * svgViewbox.
height() / svgViewbox.
width() : scaledSize;
  2496   transform.
translate( point.
x() + outputOffset.
x(), point.
y() + outputOffset.
y() );
  2499     transform.
rotate( angle );
  2502   outlineWidth += pixelSize / 2.0;
  2505                         -scaledHeight / 2.0,
  2510   symbolBounds.
adjust( -outlineWidth / 2.0, -outlineWidth / 2.0,
  2511                        outlineWidth / 2.0, outlineWidth / 2.0 );
  2513   return symbolBounds;
  2520     : mFontMetrics( nullptr )
  2533   mOutlineWidth = 0.0;
  2552     fontFamily = props[
"font"];
  2553   if ( props.
contains( 
"chr" ) && props[
"chr"].length() > 0 )
  2554     chr = props[
"chr"].at( 0 );
  2556     pointSize = props[
"size"].toDouble();
  2560     angle = props[
"angle"].toDouble();
  2564   if ( props.
contains( 
"outline_color" ) )
  2566   if ( props.
contains( 
"outline_width" ) )
  2570   if ( props.
contains( 
"offset_unit" ) )
  2572   if ( props.
contains( 
"offset_map_unit_scale" ) )
  2574   if ( props.
contains( 
"size_unit" ) )
  2576   if ( props.
contains( 
"size_map_unit_scale" ) )
  2578   if ( props.
contains( 
"outline_width_unit" ) )
  2580   if ( props.
contains( 
"outline_width_map_unit_scale" ) )
  2582   if ( props.
contains( 
"joinstyle" ) )
  2584   if ( props.
contains( 
"horizontal_anchor_point" ) )
  2586   if ( props.
contains( 
"vertical_anchor_point" ) )
  2596   return "FontMarker";
  2602   QColor penColor = mOutlineColor;
  2607   mBrush = 
QBrush( brushColor );
  2608   mPen = 
QPen( penColor );
  2624   Q_UNUSED( context );
  2635     if ( charToRender != 
mChr )
  2641   return charToRender;
  2646     bool& hasDataDefinedRotation,
  2648     double& 
angle )
 const  2653   markerOffset( context, scaledSize, scaledSize, offsetX, offsetY );
  2654   offset = 
QPointF( offsetX, offsetY );
  2659   bool usingDataDefinedRotation = 
false;
  2664     usingDataDefinedRotation = ok;
  2668   if ( hasDataDefinedRotation )
  2693   double scaledSize = 
mSize;
  2703   if ( hasDataDefinedSize && ok )
  2708         scaledSize = sqrt( scaledSize );
  2738   QColor penColor = mOutlineColor;
  2784   QString charToRender = characterToRender( context, chrOffset, chrWidth );
  2786   double sizeToRender = calculateSize( context );
  2788   bool hasDataDefinedRotation = 
false;
  2791   calculateOffsetAndRotation( context, sizeToRender, hasDataDefinedRotation, offset, angle );
  2793   transform.
translate( point.
x() + offset.
x(), point.
y() + offset.
y() );
  2796     transform.
rotate( angle );
  2801     transform.
scale( s, s );
  2805   path.
addText( -chrOffset.
x(), -chrOffset.
y(), 
mFont, charToRender );
  2814   props[
"chr"] = 
mChr;
  2871   double angle = props.
value( 
"angle", 
"0" ).toDouble( &ok );
  2892   ( void )characterToRender( context, chrOffset, chrWidth );
  2897   double scaledSize = calculateSize( context );
  2903   bool hasDataDefinedRotation = 
false;
  2906   calculateOffsetAndRotation( context, scaledSize, hasDataDefinedRotation, offset, angle );
  2912   transform.
translate( point.
x() + offset.
x(), point.
y() + offset.
y() );
  2915     transform.
rotate( angle );
  2917   QRectF symbolBounds = transform.mapRect( 
QRectF( -chrWidth / 2.0,
  2921   return symbolBounds;
  2929   if ( graphicElem.
isNull() )
  2940   if ( !name.
startsWith( 
"ttf://" ) || format != 
"ttf" )
  2950     double d = angleFunc.
toDouble( &ok );
 void addEllipse(const QRectF &boundingRectangle)
QgsSymbolV2::OutputUnit outputUnit() const override
static QString encodeOutputUnit(QgsSymbolV2::OutputUnit unit)
static double mapUnitScaleFactor(double scaleDenominator, QgsSymbolV2::OutputUnit symbolUnits, QGis::UnitType mapUnits, double mapUnitsPerPixel=1.0)
Returns scale factor for conversion to map units. 
Q_GUI_EXPORT int qt_defaultDpiX()
QRectF bounds(QPointF point, QgsSymbolV2RenderContext &context) override
Returns the approximate bounding box of the marker symbol layer, taking into account any data defined...
static const QString EXPR_CHAR
void setOutlineStyle(Qt::PenStyle outlineStyle)
Sets the marker's outline style (eg solid, dashed, etc) 
static void createRotationElement(QDomDocument &doc, QDomElement &element, const QString &rotationFunc)
void setOutlineColor(const QColor &color) override
Set outline color. 
void markerOffset(QgsSymbolV2RenderContext &context, double &offsetX, double &offsetY) const
Calculates the required marker offset, including both the symbol offset and any displacement required...
void setOpacity(qreal opacity)
Qt::PenStyle style() const
void setPenJoinStyle(Qt::PenJoinStyle style)
Set outline join style. 
static void externalMarkerToSld(QDomDocument &doc, QDomElement &element, const QString &path, const QString &format, int *markIndex=nullptr, const QColor &color=QColor(), double size=-1)
QgsSymbolV2::OutputUnit outputUnit() const override
const QgsFields * fields() const
Fields of the layer. 
void setStyle(Qt::PenStyle style)
QString & append(QChar ch)
static QPointF _rotatedOffset(QPointF offset, double angle)
Adjusts a marker offset to account for rotation. 
QPointF offset() const
Returns the marker's offset, which is the horizontal and vertical displacement which the rendered mar...
static void multiplyImageOpacity(QImage *image, qreal alpha)
Multiplies opacity of image pixel values with a (global) transparency value. 
OutputUnit
The unit of the output. 
Q_DECL_DEPRECATED 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) 
void clipValueToMapUnitScale(double &value, const QgsMapUnitScale &scale, double pixelToMMFactor) const
Clips value to scale minimum/maximum. 
QgsMapUnitScale mSizeMapUnitScale
Marker size map unit scale. 
QgsMapUnitScale mOutlineWidthMapUnitScale
Outline width map unit scale. 
Q_GUI_EXPORT int qt_defaultDpiY()
void startRender(QgsSymbolV2RenderContext &context) override
void setColor(const QColor &c) override
The fill color. 
Qt::PenStyle outlineStyle() const
Returns the marker's outline style (eg solid, dashed, etc) 
QString layerType() const override
Returns a string that represents this layer type. 
bool contains(const Key &key) const
QgsStringMap properties() const override
Should be reimplemented by subclasses to return a string map that contains the configuration informat...
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)
QRectF bounds(QPointF point, QgsSymbolV2RenderContext &context) override
Returns the approximate bounding box of the marker symbol layer, taking into account any data defined...
A paint device for drawing into dxf files. 
void setRenderHint(RenderHint hint, bool on)
QString layerType() const override
Returns a string that represents this layer type. 
virtual void setOutlineColor(const QColor &color)
Set outline color. 
QDomNode appendChild(const QDomNode &newChild)
#define DEFAULT_FONTMARKER_COLOR
void render(QPainter *painter)
static double rescaleUom(double size, QgsSymbolV2::OutputUnit unit, const QgsStringMap &props)
Rescales the given size based on the uomScale found in the props, if any is found, otherwise returns the value un-modified. 
Use antialiasing while drawing. 
void renderPoint(QPointF point, QgsSymbolV2RenderContext &context) override
Renders a marker at the specified point. 
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&. 
QSizeF svgViewboxSize(const QString &file, double size, const QColor &fill, const QColor &outline, double outlineWidth, double widthScaleFactor, double rasterScaleFactor)
Calculates the viewbox size of a (possibly cached) SVG file. 
Qt::BrushStyle style() const
QString attribute(const QString &name, const QString &defValue) const
Abstract base class for simple marker symbol layers. 
virtual QSet< QString > usedAttributes() const
Returns the set of attributes referenced by the layer. 
void setOutlineColor(const QColor &c) override
Set outline color. 
QString layerType() const override
Returns a string that represents this layer type. 
double size() const
Returns the symbol size. 
static double sizeInPixelsFromSldUom(const QString &uom, double size)
Returns the size scaled in pixels according to the uom attribute. 
void setOutlineWidthMapUnitScale(const QgsMapUnitScale &scale)
Set outline width map unit scale. 
static QString encodeColor(const QColor &color)
#define DEFAULT_SIMPLEMARKER_ANGLE
virtual QColor outlineColor() const
Get outline color. 
void renderPoint(QPointF point, QgsSymbolV2RenderContext &context) override
Renders a marker at the specified point. 
void calculateOffsetAndRotation(QgsSymbolV2RenderContext &context, double scaledSize, bool &hasDataDefinedRotation, QPointF &offset, double &angle) const
Calculates the marker offset and rotation. 
static void externalGraphicToSld(QDomDocument &doc, QDomElement &element, const QString &path, const QString &mime, const QColor &color, double size=-1)
QString fontFamily() const
void scale(qreal sx, qreal sy)
void setDrawingSize(QSizeF size)
#define DEFAULT_FONTMARKER_CHR
static QgsFillSymbolV2 * createSimple(const QgsStringMap &properties)
Create a fill symbol with one symbol layer: SimpleFill with specified properties. ...
static QgsSymbolV2::ScaleMethod decodeScaleMethod(const QString &str)
The output shall be in pixels. 
Calculate scale by the diameter. 
void setOffset(QPointF offset)
Sets the marker's offset, which is the horizontal and vertical displacement which the rendered marker...
QString ogrFeatureStyle(double mmScaleFactor, double mapUnitScaleFactor) const override
void setHorizontalAnchorPoint(HorizontalAnchorPoint h)
Sets the horizontal anchor point for positioning the symbol. 
void setOutlineWidth(double w)
Sets the width of the marker's outline. 
#define DEFAULT_SIMPLEMARKER_COLOR
QImage mCache
Cached image of marker, if using cached version. 
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
Writes the symbol layer definition as a SLD XML element. 
void drawPolygon(const QPointF *points, int pointCount, Qt::FillRule fillRule)
void setVerticalAnchorPoint(VerticalAnchorPoint v)
Sets the vertical anchor point for positioning the symbol. 
void setFillColor(const QColor &color) override
Set fill color. 
bool mUsingCache
True if using cached images of markers for drawing. 
static bool externalGraphicFromSld(QDomElement &element, QString &path, QString &mime, QColor &color, double &size)
A geometry is the spatial representation of a feature. 
static Shape decodeShape(const QString &name, bool *ok=nullptr)
Attempts to decode a string representation of a shape name to the corresponding shape. 
void setJoinStyle(Qt::PenJoinStyle style)
void moveTo(const QPointF &point)
void renderPoint(QPointF point, QgsSymbolV2RenderContext &context) override
Renders a marker at the specified point. 
bool writeDxf(QgsDxfExport &e, double mmMapUnitScaleFactor, const QString &layerName, QgsSymbolV2RenderContext &context, QPointF shift=QPointF(0.0, 0.0)) const override
write as DXF 
static QPointF decodePoint(const QString &str)
static Qt::PenJoinStyle decodePenJoinStyle(const QString &str)
Flags flags() const
Return combination of flags used for rendering. 
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. 
const QgsGeometry * constGeometry() const
Gets a const pointer to the geometry object associated with this feature. 
void stopRender(QgsSymbolV2RenderContext &context) override
void stopRender(QgsSymbolV2RenderContext &context) override
const QgsFeature * feature() const
Current feature being rendered - may be null. 
static QString encodeMapUnitScale(const QgsMapUnitScale &mapUnitScale)
void writeSldMarker(QDomDocument &doc, QDomElement &element, const QgsStringMap &props) const override
Writes the symbol layer definition as a SLD XML element. 
QGis::UnitType mapUnits() const
Retrieve map units. 
void setOutlineWidth(double w)
QPolygonF toFillPolygon(const QMatrix &matrix) const
bool writeDxf(QgsDxfExport &e, double mmMapUnitScaleFactor, const QString &layerName, QgsSymbolV2RenderContext &context, QPointF shift=QPointF(0.0, 0.0)) const override
write as DXF 
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 addText(const QPointF &point, const QFont &font, const QString &text)
void setOffsetMapUnitScale(const QgsMapUnitScale &scale)
Sets the map unit scale for the symbol's offset. 
double mOutlineWidth
Outline width. 
QImage copy(const QRect &rectangle) const
static void createDisplacementElement(QDomDocument &doc, QDomElement &element, QPointF offset)
QgsFilledMarkerSymbolLayer(Shape shape=Circle, double size=DEFAULT_SIMPLEMARKER_SIZE, double angle=DEFAULT_SIMPLEMARKER_ANGLE, QgsSymbolV2::ScaleMethod scaleMethod=DEFAULT_SCALE_METHOD)
Constructor for QgsFilledMarkerSymbolLayer. 
double toDouble(bool *ok) const
static QgsSymbolLayerV2 * create(const QgsStringMap &properties=QgsStringMap())
Creates a new QgsSimpleMarkerSymbolLayerV2. 
QMap< QString, QString > QgsStringMap
void adjust(qreal dx1, qreal dy1, qreal dx2, qreal dy2)
bool qgsDoubleNear(double a, double b, double epsilon=4 *DBL_EPSILON)
Compare two doubles (but allow some difference) 
static const QString EXPR_OFFSET
void setMapUnitScale(const QgsMapUnitScale &scale) override
static QgsSymbolLayerV2 * createFromSld(QDomElement &element)
Creates a new QgsSimpleMarkerSymbolLayerV2 from an SLD XML element. 
#define DEFAULT_FONTMARKER_JOINSTYLE
QSize defaultSize() const
virtual Q_DECL_DEPRECATED QVariant evaluateDataDefinedProperty(const QString &property, const QgsFeature *feature, const QVariant &defaultVal=QVariant(), bool *ok=nullptr) const
Evaluates the matching data defined property and returns the calculated value. 
#define DEFAULT_SVGMARKER_ANGLE
static QList< Shape > availableShapes()
Returns a list of all available shape types. 
static const QString EXPR_SIZE
double mapRotation() const
Return current map rotation in degrees. 
void setOffsetUnit(QgsSymbolV2::OutputUnit unit)
Sets the units for the symbol's offset. 
double symbologyScaleDenominator() const
Retrieve reference scale for output. 
QPainterPath mPath
Painter path representing shape. If mPolygon is empty then the shape is stored in mPath...
virtual QgsSymbolV2 * subSymbol() override
#define DEFAULT_SIMPLEMARKER_NAME
static const QString EXPR_JOIN_STYLE
static QgsSymbolV2::OutputUnit decodeOutputUnit(const QString &str)
static bool displacementFromSldElement(QDomElement &element, QPointF &offset)
void drawMarker(QPainter *p, QgsSymbolV2RenderContext &context)
Draws the marker shape in the specified painter. 
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. 
The output shall be in millimeters. 
void setMapUnitScale(const QgsMapUnitScale &scale) override
QString number(int n, int base)
void setOutlineWidthUnit(QgsSymbolV2::OutputUnit u)
Sets the unit for the width of the marker's outline. 
Q_DECL_DEPRECATED QString name() const
void setColor(const QColor &color) override
The fill color. 
bool shapeToPolygon(Shape shape, QPolygonF &polygon) const
Creates a polygon representing the specified shape. 
virtual QColor fillColor() const
Get fill color. 
QRectF bounds(QPointF point, QgsSymbolV2RenderContext &context) override
Returns the approximate bounding box of the marker symbol layer, taking into account any data defined...
QColor mBorderColor
Outline color. 
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
Should be reimplemented by subclasses to return a string map that contains the configuration informat...
void setPath(const QString &path)
void setPen(const QColor &color)
void lineTo(const QPointF &endPoint)
qreal alpha() const
Get alpha transparency 1 for opaque, 0 for invisible. 
#define DEFAULT_SCALE_METHOD
void setOutputUnit(QgsSymbolV2::OutputUnit unit) override
Qt::PenStyle mOutlineStyle
Outline style. 
QMatrix & translate(qreal dx, qreal dy)
void startRender(QgsSymbolV2RenderContext &context) override
Point geometry type, with support for z-dimension and m-values. 
void setMapUnitScale(const QgsMapUnitScale &scale) override
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)
static QString encodePenJoinStyle(Qt::PenJoinStyle style)
Q_DECL_DEPRECATED bool prepareShape(const QString &name=QString())
QgsSymbolV2::ScaleMethod mScaleMethod
Marker size scaling method. 
static QString symbolNameToPath(QString name)
Get symbol's path from its name. 
bool startsWith(const QString &s, Qt::CaseSensitivity cs) const
The output shall be in map unitx. 
void setLayer(const QString &layer)
void setSizeUnit(QgsSymbolV2::OutputUnit unit)
Sets the units for the symbol's size. 
virtual QColor color() const override
The fill color. 
static bool externalMarkerFromSld(QDomElement &element, QString &path, QString &format, int &markIndex, QColor &color, double &size)
QPaintDevice * device() const
QColor selectionColor() const
QgsMapUnitScale mapUnitScale() const override
void setWidthF(qreal width)
QgsStringMap properties() const override
Should be reimplemented by subclasses to return a string map that contains the configuration informat...
void stopRender(QgsSymbolV2RenderContext &context) override
void setBrush(const QBrush &brush)
QColor borderColor() const
Returns the marker's border color. 
QgsStringMap properties() const override
Should be reimplemented by subclasses to return a string map that contains the configuration informat...
Q_DECL_DEPRECATED void writeFilledCircle(const QString &layer, const QColor &color, const QgsPoint &pt, double radius)
Write filled circle (as hatch) 
static QString encodeShape(Shape shape)
Encodes a shape to its string representation. 
#define DEFAULT_FONTMARKER_ANGLE
QgsSymbolV2::OutputUnit outputUnit() const override
static const QString EXPR_FILL
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
Horizontal anchor point. 
QgsSvgMarkerSymbolLayerV2 * clone() const override
Shall be reimplemented by subclasses to create a deep copy of the instance. 
static double estimateMaxSymbolBleed(QgsSymbolV2 *symbol)
Returns the maximum estimated bleed for the symbol. 
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. 
QGis::GeometryType type() const
Returns type of the geometry as a QGis::GeometryType. 
virtual double estimateMaxBleed() const override
Returns the estimated maximum distance which the layer style will bleed outside the drawn shape...
void renderPoint(QPointF point, QgsSymbolV2RenderContext &context) override
Renders a marker at the specified point. 
double mapUnitsPerPixel() const
Return current map units per pixel. 
virtual QColor color() const
The fill color. 
void setOutlineWidthMapUnitScale(const QgsMapUnitScale &scale)
double mAngle
Marker rotation angle, in degrees clockwise from north. 
static Qt::PenStyle decodePenStyle(const QString &str)
double mLineAngle
Line rotation angle (see setLineAngle() for details) 
static const QString EXPR_OUTLINE_STYLE
Q_DECL_DEPRECATED void writePolyline(const QgsPolyline &line, const QString &layer, const QString &lineStyleName, const QColor &color, double width=-1)
Draw dxf primitives (LWPOLYLINE) 
virtual void setFillColor(const QColor &color)
Set fill color. 
QgsSymbolV2::OutputUnit mOutlineWidthUnit
Outline width units. 
#define DEFAULT_SVGMARKER_SIZE
~QgsFontMarkerSymbolLayerV2()
void copyDataDefinedProperties(QgsSymbolLayerV2 *destLayer) const
Copies all data defined properties of this layer to another symbol layer. 
void saveDataDefinedProperties(QgsStringMap &stringMap) const
Saves all data defined properties to a string map. 
void setOutlineWidth(double width)
Set outline width. 
QFontMetrics * mFontMetrics
static const QString EXPR_COLOR
QBrush mBrush
QBrush corresponding to marker's fill style. 
static const QString EXPR_ANGLE
static QgsSymbolLayerV2 * create(const QgsStringMap &properties=QgsStringMap())
Creates a new QgsFilledMarkerSymbolLayer. 
QgsSimpleMarkerSymbolLayerBase(Shape shape=Circle, double size=DEFAULT_SIMPLEMARKER_SIZE, double angle=DEFAULT_SIMPLEMARKER_ANGLE, QgsSymbolV2::ScaleMethod scaleMethod=DEFAULT_SCALE_METHOD)
Constructor for QgsSimpleMarkerSymbolLayerBase. 
QRect mapRect(const QRect &rectangle) const
double outlineWidth() const
Get outline width. 
int width(const QString &text, int len) const
void setOutlineWidthMapUnitScale(const QgsMapUnitScale &scale)
Sets the map scale for the width of the marker's outline. 
QgsMapUnitScale mapUnitScale() const override
void startRender(QgsSymbolV2RenderContext &context) override
#define DEFAULT_FONTMARKER_SIZE
bool forceVectorOutput() const
virtual QColor color() const override
The fill color. 
void startRender(QgsSymbolV2RenderContext &context) override
static const QString EXPR_OUTLINE_WIDTH
#define DEFAULT_FONTMARKER_FONT
void copyPaintEffect(QgsSymbolLayerV2 *destLayer) const
Copies paint effect of this layer to another symbol layer. 
#define DEFAULT_SVGMARKER_NAME
QMatrix & rotate(qreal degrees)
void setBorderColor(const QColor &color)
Sets the marker's border color. 
#define DEFAULT_SIMPLEMARKER_SIZE
Q_DECL_DEPRECATED void writeCircle(const QString &layer, const QColor &color, const QgsPoint &pt, double radius, const QString &lineStyleName, double width)
Write circle (as polyline) 
void setShift(QPointF shift)
VerticalAnchorPoint
Symbol vertical anchor points. 
QgsSymbolV2::ScaleMethod scaleMethod() const
Returns the method to use for scaling the marker's size. 
Shape shape() const
Returns the shape for the rendered marker symbol. 
void drawImage(const QRectF &target, const QImage &image, const QRectF &source, QFlags< Qt::ImageConversionFlag > flags)
const QgsMapToPixel & mapToPixel() const
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. 
QSet< T > & unite(const QSet< T > &other)
static QgsSymbolLayerV2 * create(const QgsStringMap &properties=QgsStringMap())
void setOutputUnit(QgsSymbolV2::OutputUnit unit) override
Struct for storing maximum and minimum scales for measurements in map units. 
QgsMapUnitScale mapUnitScale() const override
#define DEFAULT_FONTMARKER_BORDERCOLOR
virtual bool hasDataDefinedProperty(const QString &property) const
Checks whether the layer has a matching data defined property and if that property is currently activ...
QImage mSelCache
Cached image of selected marker, if using cached version. 
static const QString EXPR_NAME
Shape
Marker symbol shapes. 
QgsSvgMarkerSymbolLayerV2(const QString &name=DEFAULT_SVGMARKER_NAME, double size=DEFAULT_SVGMARKER_SIZE, double angle=DEFAULT_SVGMARKER_ANGLE, QgsSymbolV2::ScaleMethod scaleMethod=DEFAULT_SCALE_METHOD)
void writeSldMarker(QDomDocument &doc, QDomElement &element, const QgsStringMap &props) const override
Writes the symbol layer definition as a SLD XML element. 
static QString encodeScaleMethod(QgsSymbolV2::ScaleMethod scaleMethod)
QgsRenderContext & renderContext()
QDomElement firstChildElement(const QString &tagName) const
Q_DECL_DEPRECATED bool preparePath(QString name=QString())
QPen mSelPen
QPen to use as outline of selected symbols. 
QPen mPen
QPen corresponding to marker's outline style. 
QSet< QString > usedAttributes() const override
Returns the set of attributes referenced by the layer. 
int count(const T &value) const
static const QString EXPR_COLOR_BORDER
double outlineWidth() const
Returns the width of the marker's outline. 
Q_DECL_DEPRECATED void writePolygon(const QgsPolygon &polygon, const QString &layer, const QString &hatchPattern, const QColor &color)
Draw dxf filled polygon (HATCH) 
void translate(const QPointF &offset)
double angle() const
Returns the rotation angle for the marker, in degrees clockwise from north. 
QColor fillColor() const override
Get fill color. 
QgsSymbolV2::OutputUnit mOffsetUnit
Offset units. 
void setAlphaF(qreal alpha)
virtual void setColor(const QColor &color)
The fill color. 
void startRender(QgsSymbolV2RenderContext &context) override
static bool rotationFromSldElement(QDomElement &element, QString &rotationFunc)
QString layerType() const override
Returns a string that represents this layer type. 
double toDouble(bool *ok) const
static QColor decodeColor(const QString &str)
Qt::PenJoinStyle penJoinStyle() const
Returns the marker's outline join style (eg miter, bevel, etc). 
void startRender(QgsSymbolV2RenderContext &context) override
Abstract base class for marker symbol layers. 
VerticalAnchorPoint mVerticalAnchorPoint
Vertical anchor point. 
QgsSymbolV2::OutputUnit mSizeUnit
Marker size unit. 
void setOutlineWidthUnit(QgsSymbolV2::OutputUnit unit)
Set outline width unit. 
Calculate scale by the area. 
QgsMapUnitScale mOffsetMapUnitScale
Offset map unit scale. 
void drawPicture(const QPointF &point, const QPicture &picture)
static const QString EXPR_OUTLINE
QRectF bounds(QPointF point, QgsSymbolV2RenderContext &context) override
Returns the approximate bounding box of the marker symbol layer, taking into account any data defined...
HorizontalAnchorPoint
Symbol horizontal anchor points. 
void restoreDataDefinedProperties(const QgsStringMap &stringMap)
Restores all data defined properties from string map. 
static QgsMapUnitScale decodeMapUnitScale(const QString &str)
Qt::PenJoinStyle mPenJoinStyle
Outline pen join style. 
double rasterScaleFactor() const
QDomElement createElement(const QString &tagName)
Shape mShape
Symbol shape. 
bool prepareMarkerShape(Shape shape)
Prepares the layer for drawing the specified shape (QPolygonF version) 
#define DEFAULT_SIMPLEMARKER_JOINSTYLE
Q_DECL_DEPRECATED QgsSimpleMarkerSymbolLayerV2(const QString &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, Qt::PenJoinStyle penJoinStyle=DEFAULT_SIMPLEMARKER_JOINSTYLE)
Constructor for QgsSimpleMarkerSymbolLayerV2. 
Filled marker symbol layer, consisting of a shape which is rendered using a QgsFillSymbolV2. 
void setAngle(double angle)
Sets the rotation angle for the marker. 
double scaleFactor() const
bool begin(QPaintDevice *device)
static QgsSymbolLayerV2 * createFromSld(QDomElement &element)
void arcTo(const QRectF &rectangle, qreal startAngle, qreal sweepLength)
void setColor(const QColor &color)
void stopRender(QgsSymbolV2RenderContext &context) override
QgsFontMarkerSymbolLayerV2 * clone() const override
Shall be reimplemented by subclasses to create a deep copy of the instance. 
QString arg(qlonglong a, int fieldWidth, int base, const QChar &fillChar) const
QPointF mOffset
Marker offset. 
void setSizeMapUnitScale(const QgsMapUnitScale &scale)
Sets the map unit scale for the symbol's size. 
QColor outlineColor() const override
Get outline color. 
QPolygonF mPolygon
Polygon of points in shape. If polygon is empty then shape is using mPath. 
QgsFilledMarkerSymbolLayer * clone() const override
Shall be reimplemented by subclasses to create a deep copy of the instance. 
QgsSimpleMarkerSymbolLayerV2 * clone() const override
Shall be reimplemented by subclasses to create a deep copy of the instance. 
void setOutputUnit(QgsSymbolV2::OutputUnit unit) override
QColor outlineColor() const override
Get outline color. 
static bool shapeIsFilled(Shape shape)
Returns true if a symbol shape has a fill. 
bool prepareCache(QgsSymbolV2RenderContext &context)
Prepares cache image. 
Simple marker symbol layer, consisting of a rendered shape with solid fill color and an outline...
double calculateSize(QgsSymbolV2RenderContext &context, bool &hasDataDefinedSize) const
Calculates the desired size of the marker, considering data defined size overrides. 
bool prepareMarkerPath(Shape symbol)
Prepares the layer for drawing the specified shape (QPainterPath version) 
static const int mMaximumCacheWidth
Maximum width/height of cache image. 
void setOutputSize(const QRectF &r)
const T value(const Key &key) const
virtual bool setSubSymbol(QgsSymbolV2 *symbol) override
set layer's subsymbol. takes ownership of the passed symbol 
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)
#define DEFAULT_SIMPLEMARKER_BORDERCOLOR
QBrush mSelBrush
QBrush to use as fill of selected symbols. 
void setOutlineColor(const QColor &color) override
Set outline color.