Quantum GIS API Documentation  1.8
Public Member Functions | Static Public Member Functions | Protected Attributes | Private Member Functions
QgsSVGFillSymbolLayer Class Reference

A class for svg fill patterns. More...

#include <qgsfillsymbollayerv2.h>

Inheritance diagram for QgsSVGFillSymbolLayer:
Inheritance graph
[legend]
Collaboration diagram for QgsSVGFillSymbolLayer:
Collaboration graph
[legend]

List of all members.

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 ()
QString layerType () const
void startRender (QgsSymbolV2RenderContext &context)
void stopRender (QgsSymbolV2RenderContext &context)
QgsStringMap properties () const
QgsSymbolLayerV2clone () const
void toSld (QDomDocument &doc, QDomElement &element, QgsStringMap props) const
void setSvgFilePath (const QString &svgPath)
QString svgFilePath () const
void setPatternWidth (double width)
double patternWidth () const
void setSvgFillColor (const QColor &c)
QColor svgFillColor () const
void setSvgOutlineColor (const QColor &c)
QColor svgOutlineColor () const
void setSvgOutlineWidth (double w)
double svgOutlineWidth () const

Static Public Member Functions

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

Protected Attributes

double mPatternWidth
 Width of the pattern (in QgsSymbolV2 output units)
QByteArray mSvgData
 SVG data.
QString mSvgFilePath
 Path to the svg file (or empty if constructed directly from data)
QRectF mSvgViewBox
 SVG view box (to keep the aspect ratio.
QColor mSvgFillColor
QColor mSvgOutlineColor
double mSvgOutlineWidth

Private Member Functions

void storeViewBox ()
 Helper function that gets the view box from the byte array.
void setDefaultSvgParams ()

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 109 of file qgsfillsymbollayerv2.h.


Constructor & Destructor Documentation

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

Definition at line 296 of file qgsfillsymbollayerv2.cpp.

References QgsImageFillSymbolLayer::mOutline.


Member Function Documentation

QgsSymbolLayerV2 * QgsSVGFillSymbolLayer::createFromSld ( QDomElement &  element) [static]
QString QgsSVGFillSymbolLayer::layerType ( ) const [virtual]

Implements QgsSymbolLayerV2.

Definition at line 368 of file qgsfillsymbollayerv2.cpp.

double QgsSVGFillSymbolLayer::patternWidth ( ) const [inline]

Definition at line 136 of file qgsfillsymbollayerv2.h.

void QgsSVGFillSymbolLayer::setPatternWidth ( double  width) [inline]

Definition at line 135 of file qgsfillsymbollayerv2.h.

void QgsSVGFillSymbolLayer::setSvgFilePath ( const QString &  svgPath)

Definition at line 301 of file qgsfillsymbollayerv2.cpp.

References mSvgData, mSvgFilePath, setDefaultSvgParams(), and storeViewBox().

Referenced by QgsSVGFillSymbolLayer().

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

Definition at line 138 of file qgsfillsymbollayerv2.h.

Referenced by clone(), create(), and createFromSld().

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

Definition at line 140 of file qgsfillsymbollayerv2.h.

Referenced by clone(), create(), and createFromSld().

void QgsSVGFillSymbolLayer::setSvgOutlineWidth ( double  w) [inline]

Definition at line 142 of file qgsfillsymbollayerv2.h.

Referenced by clone(), create(), and createFromSld().

Helper function that gets the view box from the byte array.

Definition at line 574 of file qgsfillsymbollayerv2.cpp.

References mSvgData, and mSvgViewBox.

Referenced by QgsSVGFillSymbolLayer(), and setSvgFilePath().

QString QgsSVGFillSymbolLayer::svgFilePath ( ) const [inline]

Definition at line 134 of file qgsfillsymbollayerv2.h.

Referenced by create().

QColor QgsSVGFillSymbolLayer::svgFillColor ( ) const [inline]

Definition at line 139 of file qgsfillsymbollayerv2.h.

QColor QgsSVGFillSymbolLayer::svgOutlineColor ( ) const [inline]

Definition at line 141 of file qgsfillsymbollayerv2.h.

double QgsSVGFillSymbolLayer::svgOutlineWidth ( ) const [inline]

Definition at line 143 of file qgsfillsymbollayerv2.h.

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

Member Data Documentation

Width of the pattern (in QgsSymbolV2 output units)

Definition at line 147 of file qgsfillsymbollayerv2.h.

Referenced by clone(), properties(), startRender(), and toSld().

QByteArray QgsSVGFillSymbolLayer::mSvgData [protected]

SVG data.

Definition at line 149 of file qgsfillsymbollayerv2.h.

Referenced by clone(), properties(), setSvgFilePath(), and storeViewBox().

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

Definition at line 151 of file qgsfillsymbollayerv2.h.

Referenced by clone(), properties(), setDefaultSvgParams(), setSvgFilePath(), startRender(), and toSld().

Definition at line 157 of file qgsfillsymbollayerv2.h.

Referenced by clone(), properties(), setDefaultSvgParams(), startRender(), and toSld().

Definition at line 158 of file qgsfillsymbollayerv2.h.

Referenced by clone(), properties(), setDefaultSvgParams(), startRender(), and toSld().

Definition at line 159 of file qgsfillsymbollayerv2.h.

Referenced by clone(), properties(), setDefaultSvgParams(), startRender(), and toSld().

SVG view box (to keep the aspect ratio.

Definition at line 153 of file qgsfillsymbollayerv2.h.

Referenced by startRender(), and storeViewBox().


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines