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)
 QgsSVGFillSymbolLayer (const QByteArray &svgData, double width=20)
 ~QgsSVGFillSymbolLayer ()
QString layerType () const
void startRender (QgsSymbolV2RenderContext &context)
void stopRender (QgsSymbolV2RenderContext &context)
void renderPolygon (const QPolygonF &points, QList< QPolygonF > *rings, QgsSymbolV2RenderContext &context)
QgsStringMap properties () const
QgsSymbolLayerV2clone () const
void setSvgFilePath (const QString &svgPath)
QString svgFilePath () const
void setPatternWidth (double width)
double patternWidth () const
QgsSymbolV2subSymbol ()
bool setSubSymbol (QgsSymbolV2 *symbol)

Static Public Member Functions

static QgsSymbolLayerV2create (const QgsStringMap &properties=QgsStringMap())

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.
QBrush mBrush
 Brush that receives rendered pixel image in startRender() method.
double mOutlineWidth
 Outline width.
QgsLineSymbolV2mOutline
 Custom outline.

Private Member Functions

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


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


Constructor & Destructor Documentation

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

Definition at line 119 of file qgsfillsymbollayerv2.cpp.

References mOutlineWidth, setSubSymbol(), and setSvgFilePath().

Referenced by clone(), and create().

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

Definition at line 126 of file qgsfillsymbollayerv2.cpp.

References mOutlineWidth, setSubSymbol(), and storeViewBox().

QgsSVGFillSymbolLayer::~QgsSVGFillSymbolLayer (  ) 

Definition at line 133 of file qgsfillsymbollayerv2.cpp.

References mOutline.


Member Function Documentation

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

QString QgsSVGFillSymbolLayer::layerType (  )  const [virtual]

Implements QgsSymbolLayerV2.

Definition at line 182 of file qgsfillsymbollayerv2.cpp.

void QgsSVGFillSymbolLayer::startRender ( QgsSymbolV2RenderContext context  )  [virtual]

void QgsSVGFillSymbolLayer::stopRender ( QgsSymbolV2RenderContext context  )  [virtual]

void QgsSVGFillSymbolLayer::renderPolygon ( const QPolygonF &  points,
QList< QPolygonF > *  rings,
QgsSymbolV2RenderContext context 
) [virtual]

QgsStringMap QgsSVGFillSymbolLayer::properties (  )  const [virtual]

QgsSymbolLayerV2 * QgsSVGFillSymbolLayer::clone (  )  const [virtual]

void QgsSVGFillSymbolLayer::setSvgFilePath ( const QString &  svgPath  ) 

Definition at line 138 of file qgsfillsymbollayerv2.cpp.

References mSvgData, mSvgFilePath, and storeViewBox().

Referenced by QgsSVGFillSymbolLayer().

QString QgsSVGFillSymbolLayer::svgFilePath (  )  const [inline]

Definition at line 96 of file qgsfillsymbollayerv2.h.

Referenced by create().

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

Definition at line 97 of file qgsfillsymbollayerv2.h.

double QgsSVGFillSymbolLayer::patternWidth (  )  const [inline]

Definition at line 98 of file qgsfillsymbollayerv2.h.

QgsSymbolV2* QgsSVGFillSymbolLayer::subSymbol (  )  [inline, virtual]

Reimplemented from QgsSymbolLayerV2.

Definition at line 100 of file qgsfillsymbollayerv2.h.

bool QgsSVGFillSymbolLayer::setSubSymbol ( QgsSymbolV2 symbol  )  [virtual]

Reimplemented from QgsSymbolLayerV2.

Definition at line 316 of file qgsfillsymbollayerv2.cpp.

References QgsSymbolV2::Line, mOutline, and QgsSymbolV2::type().

Referenced by QgsSVGFillSymbolLayer().

void QgsSVGFillSymbolLayer::storeViewBox (  )  [private]

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

Definition at line 300 of file qgsfillsymbollayerv2.cpp.

References mSvgData, and mSvgViewBox.

Referenced by QgsSVGFillSymbolLayer(), and setSvgFilePath().


Member Data Documentation

Width of the pattern (in QgsSymbolV2 output units).

Definition at line 105 of file qgsfillsymbollayerv2.h.

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

QByteArray QgsSVGFillSymbolLayer::mSvgData [protected]

SVG data.

Definition at line 107 of file qgsfillsymbollayerv2.h.

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

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

Definition at line 109 of file qgsfillsymbollayerv2.h.

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

SVG view box (to keep the aspect ratio.

Definition at line 111 of file qgsfillsymbollayerv2.h.

Referenced by startRender(), and storeViewBox().

QBrush QgsSVGFillSymbolLayer::mBrush [protected]

Brush that receives rendered pixel image in startRender() method.

Definition at line 113 of file qgsfillsymbollayerv2.h.

Referenced by renderPolygon(), and startRender().

Outline width.

Definition at line 115 of file qgsfillsymbollayerv2.h.

Referenced by QgsSVGFillSymbolLayer().

Custom outline.

Definition at line 117 of file qgsfillsymbollayerv2.h.

Referenced by clone(), renderPolygon(), setSubSymbol(), startRender(), stopRender(), and ~QgsSVGFillSymbolLayer().


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

Generated on Sat Feb 4 19:17:54 2012 for Quantum GIS API Documentation by  doxygen 1.5.6