Quantum GIS API Documentation  1.7.4
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)
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,
double  rotation = 0.0 
)
QgsSVGFillSymbolLayer::QgsSVGFillSymbolLayer ( const QByteArray &  svgData,
double  width = 20,
double  rotation = 0.0 
)

Definition at line 136 of file qgsfillsymbollayerv2.cpp.

References mOutline.


Member Function Documentation

QString QgsSVGFillSymbolLayer::layerType ( ) const [virtual]

Implements QgsSymbolLayerV2.

Definition at line 190 of file qgsfillsymbollayerv2.cpp.

double QgsSVGFillSymbolLayer::patternWidth ( ) const [inline]

Definition at line 98 of file qgsfillsymbollayerv2.h.

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

Definition at line 97 of file qgsfillsymbollayerv2.h.

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

Reimplemented from QgsSymbolLayerV2.

Definition at line 338 of file qgsfillsymbollayerv2.cpp.

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

Referenced by QgsSVGFillSymbolLayer().

void QgsSVGFillSymbolLayer::setSvgFilePath ( const QString &  svgPath)

Definition at line 141 of file qgsfillsymbollayerv2.cpp.

References mSvgData, mSvgFilePath, and storeViewBox().

Referenced by QgsSVGFillSymbolLayer().

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

Definition at line 322 of file qgsfillsymbollayerv2.cpp.

References mSvgData, and mSvgViewBox.

Referenced by QgsSVGFillSymbolLayer(), and setSvgFilePath().

Reimplemented from QgsSymbolLayerV2.

Definition at line 100 of file qgsfillsymbollayerv2.h.

QString QgsSVGFillSymbolLayer::svgFilePath ( ) const [inline]

Definition at line 96 of file qgsfillsymbollayerv2.h.

Referenced by create().


Member Data Documentation

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().

Custom outline.

Definition at line 117 of file qgsfillsymbollayerv2.h.

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

Outline width.

Definition at line 115 of file qgsfillsymbollayerv2.h.

Referenced by QgsSVGFillSymbolLayer().

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().


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