QGIS API Documentation  2.8.2-Wien
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
QgsSVGFillSymbolLayer Class Reference

A class for svg fill patterns. More...

#include <qgsfillsymbollayerv2.h>

Inheritance diagram for QgsSVGFillSymbolLayer:
Inheritance graph
[legend]

Public Member Functions

 QgsSVGFillSymbolLayer (const QString &svgFilePath="", double width=20, double rotation=0.0)
 QgsSVGFillSymbolLayer (const QByteArray &svgData, double width=20, double rotation=0.0)
 ~QgsSVGFillSymbolLayer ()
QgsSymbolLayerV2clone () const override
QString layerType () const override
QgsMapUnitScale mapUnitScale () const override
QgsSymbolV2::OutputUnit outputUnit () const override
double patternWidth () const
const QgsMapUnitScalepatternWidthMapUnitScale () const
QgsSymbolV2::OutputUnit patternWidthUnit () const
QgsStringMap properties () const override
void setMapUnitScale (const QgsMapUnitScale &scale) override
void setOutputUnit (QgsSymbolV2::OutputUnit unit) override
void setPatternWidth (double width)
void setPatternWidthMapUnitScale (const QgsMapUnitScale &scale)
void setPatternWidthUnit (QgsSymbolV2::OutputUnit unit)
void setSvgFilePath (const QString &svgPath)
void setSvgFillColor (const QColor &c)
void setSvgOutlineColor (const QColor &c)
void setSvgOutlineWidth (double w)
void setSvgOutlineWidthMapUnitScale (const QgsMapUnitScale &scale)
void setSvgOutlineWidthUnit (QgsSymbolV2::OutputUnit unit)
void startRender (QgsSymbolV2RenderContext &context) override
void stopRender (QgsSymbolV2RenderContext &context) override
QString svgFilePath () const
QColor svgFillColor () const
QColor svgOutlineColor () const
double svgOutlineWidth () const
const QgsMapUnitScalesvgOutlineWidthMapUnitScale () const
QgsSymbolV2::OutputUnit svgOutlineWidthUnit () const
void toSld (QDomDocument &doc, QDomElement &element, QgsStringMap props) const override
- Public Member Functions inherited from QgsImageFillSymbolLayer
 QgsImageFillSymbolLayer ()
virtual ~QgsImageFillSymbolLayer ()
virtual QColor dxfColor (const QgsSymbolV2RenderContext &context) const override
virtual Qt::PenStyle dxfPenStyle () const override
virtual double dxfWidth (const QgsDxfExport &e, const QgsSymbolV2RenderContext &context) const override
virtual double estimateMaxBleed () const override
 Returns the estimated maximum distance which the layer style will bleed outside the drawn shape.
const QgsMapUnitScaleoutlineWidthMapUnitScale () const
QgsSymbolV2::OutputUnit outlineWidthUnit () const
void renderPolygon (const QPolygonF &points, QList< QPolygonF > *rings, QgsSymbolV2RenderContext &context) override
void setOutlineWidthMapUnitScale (const QgsMapUnitScale &scale)
void setOutlineWidthUnit (QgsSymbolV2::OutputUnit unit)
virtual bool setSubSymbol (QgsSymbolV2 *symbol) override
virtual QgsSymbolV2subSymbol () override
- Public Member Functions inherited from QgsFillSymbolLayerV2
double angle () const
void drawPreviewIcon (QgsSymbolV2RenderContext &context, QSize size) override
void setAngle (double angle)
- Public Member Functions inherited from QgsSymbolLayerV2
virtual ~QgsSymbolLayerV2 ()
virtual QColor color () const
virtual const QgsExpressiondataDefinedProperty (const QString &property) const
virtual QString dataDefinedPropertyString (const QString &property) const
virtual QColor dxfBrushColor (const QgsSymbolV2RenderContext &context) const
virtual Qt::BrushStyle dxfBrushStyle () const
virtual QVector< qreal > dxfCustomDashPattern (QgsSymbolV2::OutputUnit &unit) const
virtual double dxfOffset (const QgsDxfExport &e, const QgsSymbolV2RenderContext &context) const
virtual QColor fillColor () const
 Get fill color.
bool hasDataDefinedProperties () const
bool isLocked () const
virtual QString ogrFeatureStyle (double mmScaleFactor, double mapUnitScaleFactor) const
virtual QColor outlineColor () const
 Get outline color.
virtual void removeDataDefinedProperties ()
virtual void removeDataDefinedProperty (const QString &property)
int renderingPass () const
virtual void setColor (const QColor &color)
virtual void setDataDefinedProperty (const QString &property, const QString &expressionString)
virtual void setFillColor (const QColor &color)
 Set fill color.
void setLocked (bool locked)
virtual void setOutlineColor (const QColor &color)
 Set outline color.
void setRenderingPass (int renderingPass)
QgsSymbolV2::SymbolType type () const
virtual QSet< QString > usedAttributes () const
virtual bool writeDxf (QgsDxfExport &e, double mmMapUnitScaleFactor, const QString &layerName, const QgsSymbolV2RenderContext *context, const QgsFeature *f, const QPointF &shift=QPointF(0.0, 0.0)) const

Static Public Member Functions

static QgsSymbolLayerV2create (const QgsStringMap &properties=QgsStringMap())
static QgsSymbolLayerV2createFromSld (QDomElement &element)

Protected Member Functions

void applyDataDefinedSettings (const QgsSymbolV2RenderContext &context) override

Protected Attributes

double mPatternWidth
 Width of the pattern (in output units)
QgsMapUnitScale mPatternWidthMapUnitScale
QgsSymbolV2::OutputUnit mPatternWidthUnit
QByteArray mSvgData
 SVG data.
QString mSvgFilePath
 Path to the svg file (or empty if constructed directly from data)
QColor mSvgFillColor
QColor mSvgOutlineColor
double mSvgOutlineWidth
QgsMapUnitScale mSvgOutlineWidthMapUnitScale
QgsSymbolV2::OutputUnit mSvgOutlineWidthUnit
QImage * mSvgPattern
 SVG pattern image.
QRectF mSvgViewBox
 SVG view box (to keep the aspect ratio.
- Protected Attributes inherited from QgsImageFillSymbolLayer
QBrush mBrush
double mNextAngle
QgsLineSymbolV2mOutline
 Custom outline.
double mOutlineWidth
 Outline width.
QgsMapUnitScale mOutlineWidthMapUnitScale
QgsSymbolV2::OutputUnit mOutlineWidthUnit
- Protected Attributes inherited from QgsFillSymbolLayerV2
double mAngle
- Protected Attributes inherited from QgsSymbolLayerV2
QColor mColor
QMap< QString, QgsExpression * > mDataDefinedProperties
bool mLocked
int mRenderingPass
QgsSymbolV2::SymbolType mType

Additional Inherited Members

- Static Protected Attributes inherited from QgsSymbolLayerV2
static const bool selectFillBorder = false
static const bool selectFillStyle = false
static const bool selectionIsOpaque = true

Detailed Description

A class for svg fill patterns.

The class automatically scales the pattern to the appropriate pixel dimensions of the output device

Definition at line 775 of file qgsfillsymbollayerv2.h.

Constructor & Destructor Documentation

QgsSVGFillSymbolLayer::QgsSVGFillSymbolLayer ( const QString &  svgFilePath = "",
double  width = 20,
double  rotation = 0.0 
)

Definition at line 1707 of file qgsfillsymbollayerv2.cpp.

QgsSVGFillSymbolLayer::QgsSVGFillSymbolLayer ( const QByteArray &  svgData,
double  width = 20,
double  rotation = 0.0 
)

Definition at line 1719 of file qgsfillsymbollayerv2.cpp.

QgsSVGFillSymbolLayer::~QgsSVGFillSymbolLayer ( )

Definition at line 1733 of file qgsfillsymbollayerv2.cpp.

Member Function Documentation

void QgsSVGFillSymbolLayer::applyDataDefinedSettings ( const QgsSymbolV2RenderContext context)
overrideprotectedvirtual

Reimplemented from QgsImageFillSymbolLayer.

Definition at line 2161 of file qgsfillsymbollayerv2.cpp.

QgsSymbolLayerV2 * QgsSVGFillSymbolLayer::clone ( ) const
overridevirtual

Implements QgsSymbolLayerV2.

Definition at line 2014 of file qgsfillsymbollayerv2.cpp.

QgsSymbolLayerV2 * QgsSVGFillSymbolLayer::create ( const QgsStringMap properties = QgsStringMap())
static

Definition at line 1784 of file qgsfillsymbollayerv2.cpp.

QgsSymbolLayerV2 * QgsSVGFillSymbolLayer::createFromSld ( QDomElement &  element)
static

Definition at line 2101 of file qgsfillsymbollayerv2.cpp.

QString QgsSVGFillSymbolLayer::layerType ( ) const
overridevirtual

Implements QgsSymbolLayerV2.

Definition at line 1899 of file qgsfillsymbollayerv2.cpp.

QgsMapUnitScale QgsSVGFillSymbolLayer::mapUnitScale ( ) const
overridevirtual

Reimplemented from QgsImageFillSymbolLayer.

Definition at line 1764 of file qgsfillsymbollayerv2.cpp.

QgsSymbolV2::OutputUnit QgsSVGFillSymbolLayer::outputUnit ( ) const
overridevirtual

Reimplemented from QgsImageFillSymbolLayer.

Definition at line 1746 of file qgsfillsymbollayerv2.cpp.

double QgsSVGFillSymbolLayer::patternWidth ( ) const
inline

Definition at line 802 of file qgsfillsymbollayerv2.h.

const QgsMapUnitScale& QgsSVGFillSymbolLayer::patternWidthMapUnitScale ( ) const
inline

Definition at line 815 of file qgsfillsymbollayerv2.h.

QgsSymbolV2::OutputUnit QgsSVGFillSymbolLayer::patternWidthUnit ( ) const
inline

Definition at line 812 of file qgsfillsymbollayerv2.h.

QgsStringMap QgsSVGFillSymbolLayer::properties ( ) const
overridevirtual

Implements QgsSymbolLayerV2.

Definition at line 1982 of file qgsfillsymbollayerv2.cpp.

void QgsSVGFillSymbolLayer::setMapUnitScale ( const QgsMapUnitScale scale)
overridevirtual

Reimplemented from QgsImageFillSymbolLayer.

Definition at line 1756 of file qgsfillsymbollayerv2.cpp.

void QgsSVGFillSymbolLayer::setOutputUnit ( QgsSymbolV2::OutputUnit  unit)
overridevirtual

Reimplemented from QgsImageFillSymbolLayer.

Definition at line 1738 of file qgsfillsymbollayerv2.cpp.

void QgsSVGFillSymbolLayer::setPatternWidth ( double  width)
inline

Definition at line 801 of file qgsfillsymbollayerv2.h.

void QgsSVGFillSymbolLayer::setPatternWidthMapUnitScale ( const QgsMapUnitScale scale)
inline

Definition at line 814 of file qgsfillsymbollayerv2.h.

void QgsSVGFillSymbolLayer::setPatternWidthUnit ( QgsSymbolV2::OutputUnit  unit)
inline

Definition at line 811 of file qgsfillsymbollayerv2.h.

void QgsSVGFillSymbolLayer::setSvgFilePath ( const QString &  svgPath)

Definition at line 1775 of file qgsfillsymbollayerv2.cpp.

void QgsSVGFillSymbolLayer::setSvgFillColor ( const QColor &  c)
inline

Definition at line 804 of file qgsfillsymbollayerv2.h.

void QgsSVGFillSymbolLayer::setSvgOutlineColor ( const QColor &  c)
inline

Definition at line 806 of file qgsfillsymbollayerv2.h.

void QgsSVGFillSymbolLayer::setSvgOutlineWidth ( double  w)
inline

Definition at line 808 of file qgsfillsymbollayerv2.h.

void QgsSVGFillSymbolLayer::setSvgOutlineWidthMapUnitScale ( const QgsMapUnitScale scale)
inline

Definition at line 820 of file qgsfillsymbollayerv2.h.

void QgsSVGFillSymbolLayer::setSvgOutlineWidthUnit ( QgsSymbolV2::OutputUnit  unit)
inline

Definition at line 817 of file qgsfillsymbollayerv2.h.

void QgsSVGFillSymbolLayer::startRender ( QgsSymbolV2RenderContext context)
overridevirtual

Implements QgsSymbolLayerV2.

Definition at line 1961 of file qgsfillsymbollayerv2.cpp.

void QgsSVGFillSymbolLayer::stopRender ( QgsSymbolV2RenderContext context)
overridevirtual

Implements QgsSymbolLayerV2.

Definition at line 1974 of file qgsfillsymbollayerv2.cpp.

QString QgsSVGFillSymbolLayer::svgFilePath ( ) const
inline

Definition at line 800 of file qgsfillsymbollayerv2.h.

QColor QgsSVGFillSymbolLayer::svgFillColor ( ) const
inline

Definition at line 805 of file qgsfillsymbollayerv2.h.

QColor QgsSVGFillSymbolLayer::svgOutlineColor ( ) const
inline

Definition at line 807 of file qgsfillsymbollayerv2.h.

double QgsSVGFillSymbolLayer::svgOutlineWidth ( ) const
inline

Definition at line 809 of file qgsfillsymbollayerv2.h.

const QgsMapUnitScale& QgsSVGFillSymbolLayer::svgOutlineWidthMapUnitScale ( ) const
inline

Definition at line 821 of file qgsfillsymbollayerv2.h.

QgsSymbolV2::OutputUnit QgsSVGFillSymbolLayer::svgOutlineWidthUnit ( ) const
inline

Definition at line 818 of file qgsfillsymbollayerv2.h.

void QgsSVGFillSymbolLayer::toSld ( QDomDocument &  doc,
QDomElement &  element,
QgsStringMap  props 
) const
overridevirtual

Reimplemented from QgsSymbolLayerV2.

Definition at line 2044 of file qgsfillsymbollayerv2.cpp.

Member Data Documentation

double QgsSVGFillSymbolLayer::mPatternWidth
protected

Width of the pattern (in output units)

Definition at line 831 of file qgsfillsymbollayerv2.h.

QgsMapUnitScale QgsSVGFillSymbolLayer::mPatternWidthMapUnitScale
protected

Definition at line 833 of file qgsfillsymbollayerv2.h.

QgsSymbolV2::OutputUnit QgsSVGFillSymbolLayer::mPatternWidthUnit
protected

Definition at line 832 of file qgsfillsymbollayerv2.h.

QByteArray QgsSVGFillSymbolLayer::mSvgData
protected

SVG data.

Definition at line 836 of file qgsfillsymbollayerv2.h.

QString QgsSVGFillSymbolLayer::mSvgFilePath
protected

Path to the svg file (or empty if constructed directly from data)

Definition at line 838 of file qgsfillsymbollayerv2.h.

QColor QgsSVGFillSymbolLayer::mSvgFillColor
protected

Definition at line 846 of file qgsfillsymbollayerv2.h.

QColor QgsSVGFillSymbolLayer::mSvgOutlineColor
protected

Definition at line 847 of file qgsfillsymbollayerv2.h.

double QgsSVGFillSymbolLayer::mSvgOutlineWidth
protected

Definition at line 848 of file qgsfillsymbollayerv2.h.

QgsMapUnitScale QgsSVGFillSymbolLayer::mSvgOutlineWidthMapUnitScale
protected

Definition at line 850 of file qgsfillsymbollayerv2.h.

QgsSymbolV2::OutputUnit QgsSVGFillSymbolLayer::mSvgOutlineWidthUnit
protected

Definition at line 849 of file qgsfillsymbollayerv2.h.

QImage* QgsSVGFillSymbolLayer::mSvgPattern
protected

SVG pattern image.

Definition at line 842 of file qgsfillsymbollayerv2.h.

QRectF QgsSVGFillSymbolLayer::mSvgViewBox
protected

SVG view box (to keep the aspect ratio.

Definition at line 840 of file qgsfillsymbollayerv2.h.


The documentation for this class was generated from the following files: