QGIS API Documentation  2.7.0-Master
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules 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
 
QString layerType () const
 
QgsMapUnitScale mapUnitScale () const
 
QgsSymbolV2::OutputUnit outputUnit () const
 
double patternWidth () const
 
const QgsMapUnitScalepatternWidthMapUnitScale () const
 
QgsSymbolV2::OutputUnit patternWidthUnit () const
 
QgsStringMap properties () const
 
void setMapUnitScale (const QgsMapUnitScale &scale)
 
void setOutputUnit (QgsSymbolV2::OutputUnit unit)
 
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)
 
void stopRender (QgsSymbolV2RenderContext &context)
 
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
 
- Public Member Functions inherited from QgsImageFillSymbolLayer
 QgsImageFillSymbolLayer ()
 
virtual ~QgsImageFillSymbolLayer ()
 
virtual QColor dxfColor (const QgsSymbolV2RenderContext &context) const
 
virtual Qt::PenStyle dxfPenStyle () const
 
virtual double dxfWidth (const QgsDxfExport &e, const QgsSymbolV2RenderContext &context) const
 
virtual double estimateMaxBleed () const
 Returns the estimated maximum distance which the layer style will bleed outside the drawn shape. More...
 
const QgsMapUnitScaleoutlineWidthMapUnitScale () const
 
QgsSymbolV2::OutputUnit outlineWidthUnit () const
 
void renderPolygon (const QPolygonF &points, QList< QPolygonF > *rings, QgsSymbolV2RenderContext &context)
 
void setOutlineWidthMapUnitScale (const QgsMapUnitScale &scale)
 
void setOutlineWidthUnit (QgsSymbolV2::OutputUnit unit)
 
virtual bool setSubSymbol (QgsSymbolV2 *symbol)
 
virtual QgsSymbolV2subSymbol ()
 
- Public Member Functions inherited from QgsFillSymbolLayerV2
double angle () const
 
void drawPreviewIcon (QgsSymbolV2RenderContext &context, QSize size)
 
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 QColor fillColor () const
 Get fill color. More...
 
bool hasDataDefinedProperties () const
 
bool isLocked () const
 
virtual QString ogrFeatureStyle (double mmScaleFactor, double mapUnitScaleFactor) const
 
virtual QColor outlineColor () const
 Get outline color. More...
 
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. More...
 
void setLocked (bool locked)
 
virtual void setOutlineColor (const QColor &color)
 Set outline color. More...
 
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)
 
- Protected Member Functions inherited from QgsFillSymbolLayerV2
 QgsFillSymbolLayerV2 (bool locked=false)
 
void _renderPolygon (QPainter *p, const QPolygonF &points, const QList< QPolygonF > *rings, QgsSymbolV2RenderContext &context)
 Default method to render polygon. More...
 
- Protected Member Functions inherited from QgsSymbolLayerV2
 QgsSymbolLayerV2 (QgsSymbolV2::SymbolType type, bool locked=false)
 
void copyDataDefinedProperties (QgsSymbolLayerV2 *destLayer) const
 Copies data defined properties of this layer to another symbol layer. More...
 
virtual QgsExpressionexpression (const QString &property) const
 
virtual void prepareExpressions (const QgsFields *fields, double scale=-1.0)
 
void saveDataDefinedProperties (QgsStringMap &stringMap) const
 Saves data defined properties to string map. More...
 

Protected Attributes

double mPatternWidth
 Width of the pattern (in output units) More...
 
QgsMapUnitScale mPatternWidthMapUnitScale
 
QgsSymbolV2::OutputUnit mPatternWidthUnit
 
QByteArray mSvgData
 SVG data. More...
 
QString mSvgFilePath
 Path to the svg file (or empty if constructed directly from data) More...
 
QColor mSvgFillColor
 
QColor mSvgOutlineColor
 
double mSvgOutlineWidth
 
QgsMapUnitScale mSvgOutlineWidthMapUnitScale
 
QgsSymbolV2::OutputUnit mSvgOutlineWidthUnit
 
QImage * mSvgPattern
 SVG pattern image. More...
 
QRectF mSvgViewBox
 SVG view box (to keep the aspect ratio. More...
 
- Protected Attributes inherited from QgsImageFillSymbolLayer
QBrush mBrush
 
double mNextAngle
 
QgsLineSymbolV2mOutline
 Custom outline. More...
 
double mOutlineWidth
 Outline width. More...
 
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 780 of file qgsfillsymbollayerv2.h.

Constructor & Destructor Documentation

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

Definition at line 1648 of file qgsfillsymbollayerv2.cpp.

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

Definition at line 1660 of file qgsfillsymbollayerv2.cpp.

QgsSVGFillSymbolLayer::~QgsSVGFillSymbolLayer ( )

Definition at line 1674 of file qgsfillsymbollayerv2.cpp.

Member Function Documentation

void QgsSVGFillSymbolLayer::applyDataDefinedSettings ( const QgsSymbolV2RenderContext context)
protectedvirtual

Reimplemented from QgsImageFillSymbolLayer.

Definition at line 2102 of file qgsfillsymbollayerv2.cpp.

QgsSymbolLayerV2 * QgsSVGFillSymbolLayer::clone ( ) const
virtual

Implements QgsSymbolLayerV2.

Definition at line 1955 of file qgsfillsymbollayerv2.cpp.

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

Definition at line 1725 of file qgsfillsymbollayerv2.cpp.

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

Definition at line 2042 of file qgsfillsymbollayerv2.cpp.

QString QgsSVGFillSymbolLayer::layerType ( ) const
virtual

Implements QgsSymbolLayerV2.

Definition at line 1840 of file qgsfillsymbollayerv2.cpp.

QgsMapUnitScale QgsSVGFillSymbolLayer::mapUnitScale ( ) const
virtual

Reimplemented from QgsImageFillSymbolLayer.

Definition at line 1705 of file qgsfillsymbollayerv2.cpp.

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

Reimplemented from QgsImageFillSymbolLayer.

Definition at line 1687 of file qgsfillsymbollayerv2.cpp.

double QgsSVGFillSymbolLayer::patternWidth ( ) const
inline

Definition at line 807 of file qgsfillsymbollayerv2.h.

const QgsMapUnitScale& QgsSVGFillSymbolLayer::patternWidthMapUnitScale ( ) const
inline

Definition at line 820 of file qgsfillsymbollayerv2.h.

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

Definition at line 817 of file qgsfillsymbollayerv2.h.

QgsStringMap QgsSVGFillSymbolLayer::properties ( ) const
virtual

Implements QgsSymbolLayerV2.

Definition at line 1923 of file qgsfillsymbollayerv2.cpp.

void QgsSVGFillSymbolLayer::setMapUnitScale ( const QgsMapUnitScale scale)
virtual

Reimplemented from QgsImageFillSymbolLayer.

Definition at line 1697 of file qgsfillsymbollayerv2.cpp.

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

Reimplemented from QgsImageFillSymbolLayer.

Definition at line 1679 of file qgsfillsymbollayerv2.cpp.

void QgsSVGFillSymbolLayer::setPatternWidth ( double  width)
inline

Definition at line 806 of file qgsfillsymbollayerv2.h.

void QgsSVGFillSymbolLayer::setPatternWidthMapUnitScale ( const QgsMapUnitScale scale)
inline

Definition at line 819 of file qgsfillsymbollayerv2.h.

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

Definition at line 816 of file qgsfillsymbollayerv2.h.

void QgsSVGFillSymbolLayer::setSvgFilePath ( const QString &  svgPath)

Definition at line 1716 of file qgsfillsymbollayerv2.cpp.

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

Definition at line 809 of file qgsfillsymbollayerv2.h.

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

Definition at line 811 of file qgsfillsymbollayerv2.h.

void QgsSVGFillSymbolLayer::setSvgOutlineWidth ( double  w)
inline

Definition at line 813 of file qgsfillsymbollayerv2.h.

void QgsSVGFillSymbolLayer::setSvgOutlineWidthMapUnitScale ( const QgsMapUnitScale scale)
inline

Definition at line 825 of file qgsfillsymbollayerv2.h.

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

Definition at line 822 of file qgsfillsymbollayerv2.h.

void QgsSVGFillSymbolLayer::startRender ( QgsSymbolV2RenderContext context)
virtual

Implements QgsSymbolLayerV2.

Definition at line 1902 of file qgsfillsymbollayerv2.cpp.

void QgsSVGFillSymbolLayer::stopRender ( QgsSymbolV2RenderContext context)
virtual

Implements QgsSymbolLayerV2.

Definition at line 1915 of file qgsfillsymbollayerv2.cpp.

QString QgsSVGFillSymbolLayer::svgFilePath ( ) const
inline

Definition at line 805 of file qgsfillsymbollayerv2.h.

QColor QgsSVGFillSymbolLayer::svgFillColor ( ) const
inline

Definition at line 810 of file qgsfillsymbollayerv2.h.

QColor QgsSVGFillSymbolLayer::svgOutlineColor ( ) const
inline

Definition at line 812 of file qgsfillsymbollayerv2.h.

double QgsSVGFillSymbolLayer::svgOutlineWidth ( ) const
inline

Definition at line 814 of file qgsfillsymbollayerv2.h.

const QgsMapUnitScale& QgsSVGFillSymbolLayer::svgOutlineWidthMapUnitScale ( ) const
inline

Definition at line 826 of file qgsfillsymbollayerv2.h.

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

Definition at line 823 of file qgsfillsymbollayerv2.h.

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

Reimplemented from QgsSymbolLayerV2.

Definition at line 1985 of file qgsfillsymbollayerv2.cpp.

Member Data Documentation

double QgsSVGFillSymbolLayer::mPatternWidth
protected

Width of the pattern (in output units)

Definition at line 836 of file qgsfillsymbollayerv2.h.

QgsMapUnitScale QgsSVGFillSymbolLayer::mPatternWidthMapUnitScale
protected

Definition at line 838 of file qgsfillsymbollayerv2.h.

QgsSymbolV2::OutputUnit QgsSVGFillSymbolLayer::mPatternWidthUnit
protected

Definition at line 837 of file qgsfillsymbollayerv2.h.

QByteArray QgsSVGFillSymbolLayer::mSvgData
protected

SVG data.

Definition at line 841 of file qgsfillsymbollayerv2.h.

QString QgsSVGFillSymbolLayer::mSvgFilePath
protected

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

Definition at line 843 of file qgsfillsymbollayerv2.h.

QColor QgsSVGFillSymbolLayer::mSvgFillColor
protected

Definition at line 851 of file qgsfillsymbollayerv2.h.

QColor QgsSVGFillSymbolLayer::mSvgOutlineColor
protected

Definition at line 852 of file qgsfillsymbollayerv2.h.

double QgsSVGFillSymbolLayer::mSvgOutlineWidth
protected

Definition at line 853 of file qgsfillsymbollayerv2.h.

QgsMapUnitScale QgsSVGFillSymbolLayer::mSvgOutlineWidthMapUnitScale
protected

Definition at line 855 of file qgsfillsymbollayerv2.h.

QgsSymbolV2::OutputUnit QgsSVGFillSymbolLayer::mSvgOutlineWidthUnit
protected

Definition at line 854 of file qgsfillsymbollayerv2.h.

QImage* QgsSVGFillSymbolLayer::mSvgPattern
protected

SVG pattern image.

Definition at line 847 of file qgsfillsymbollayerv2.h.

QRectF QgsSVGFillSymbolLayer::mSvgViewBox
protected

SVG view box (to keep the aspect ratio.

Definition at line 845 of file qgsfillsymbollayerv2.h.


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