Quantum GIS API Documentation  1.7.5-Wroclaw
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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)
- Public Member Functions inherited from QgsFillSymbolLayerV2
void drawPreviewIcon (QgsSymbolV2RenderContext &context, QSize size)
void setAngle (double angle)
double angle () const
- Public Member Functions inherited from QgsSymbolLayerV2
virtual void setColor (const QColor &color)
virtual QColor color () const
virtual ~QgsSymbolLayerV2 ()
QgsSymbolV2::SymbolType type () const
void setLocked (bool locked)
bool isLocked () const
void setRenderingPass (int renderingPass)
int renderingPass () const

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.
- Protected Attributes inherited from QgsFillSymbolLayerV2
double mAngle
- Protected Attributes inherited from QgsSymbolLayerV2
QgsSymbolV2::SymbolType mType
bool mLocked
QColor mColor
int mRenderingPass

Private Member Functions

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

Additional Inherited Members

- Protected Member Functions inherited from QgsFillSymbolLayerV2
 QgsFillSymbolLayerV2 (bool locked=false)
void _renderPolygon (QPainter *p, const QPolygonF &points, const QList< QPolygonF > *rings)
 Default method to render polygon.
- Protected Member Functions inherited from QgsSymbolLayerV2
 QgsSymbolLayerV2 (QgsSymbolV2::SymbolType type, bool locked=false)

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 
)
QgsSVGFillSymbolLayer::~QgsSVGFillSymbolLayer ( )

Definition at line 136 of file qgsfillsymbollayerv2.cpp.

References mOutline.


Member Function Documentation

QgsSymbolLayerV2 * QgsSVGFillSymbolLayer::clone ( ) const
virtual
QgsSymbolLayerV2 * QgsSVGFillSymbolLayer::create ( const QgsStringMap properties = QgsStringMap())
static
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.

QgsStringMap QgsSVGFillSymbolLayer::properties ( ) const
virtual
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().

void QgsSVGFillSymbolLayer::startRender ( QgsSymbolV2RenderContext context)
virtual
void QgsSVGFillSymbolLayer::stopRender ( QgsSymbolV2RenderContext context)
virtual
void QgsSVGFillSymbolLayer::storeViewBox ( )
private

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

QgsSymbolV2* QgsSVGFillSymbolLayer::subSymbol ( )
inlinevirtual

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

QgsLineSymbolV2* QgsSVGFillSymbolLayer::mOutline
protected

Custom outline.

Definition at line 117 of file qgsfillsymbollayerv2.h.

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

double QgsSVGFillSymbolLayer::mOutlineWidth
protected

Outline width.

Definition at line 115 of file qgsfillsymbollayerv2.h.

Referenced by QgsSVGFillSymbolLayer().

double QgsSVGFillSymbolLayer::mPatternWidth
protected

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

QString QgsSVGFillSymbolLayer::mSvgFilePath
protected

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

QRectF QgsSVGFillSymbolLayer::mSvgViewBox
protected

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: