QGIS API Documentation  2.8.2-Wien
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
QgsRasterFillSymbolLayer Class Reference

A class for filling symbols with a repeated raster image. More...

#include <qgsfillsymbollayerv2.h>

Inheritance diagram for QgsRasterFillSymbolLayer:
Inheritance graph
[legend]

Public Types

enum  FillCoordinateMode { Feature, Viewport }

Public Member Functions

 QgsRasterFillSymbolLayer (const QString &imageFilePath=QString())
 ~QgsRasterFillSymbolLayer ()
double alpha () const
 The opacity for the raster image used in the fill.
QgsSymbolLayerV2clone () const override
FillCoordinateMode coordinateMode () const
 Coordinate mode for fill.
virtual double estimateMaxBleed () const override
 Returns the estimated maximum distance which the layer style will bleed outside the drawn shape.
QString imageFilePath () const
 The path to the raster image used for the fill.
QString layerType () const override
QPointF offset () const
 Returns the offset for the fill.
const QgsMapUnitScaleoffsetMapUnitScale () const
 Returns the map unit scale for the fill's offset.
QgsSymbolV2::OutputUnit offsetUnit () const
 Returns the units for the fill's offset.
QgsStringMap properties () const override
void renderPolygon (const QPolygonF &points, QList< QPolygonF > *rings, QgsSymbolV2RenderContext &context) override
void setAlpha (const double alpha)
 Sets the opacity for the raster image used in the fill.
void setCoordinateMode (const FillCoordinateMode mode)
 Set the coordinate mode for fill.
void setImageFilePath (const QString &imagePath)
 Sets the path to the raster image used for the fill.
void setOffset (const QPointF &offset)
 Sets the offset for the fill.
void setOffsetMapUnitScale (const QgsMapUnitScale &scale)
 Sets the map unit scale for the fill's offset.
void setOffsetUnit (const QgsSymbolV2::OutputUnit unit)
 Sets the units for the fill's offset.
virtual bool setSubSymbol (QgsSymbolV2 *symbol) override
void setWidth (const double width)
 Sets the width for scaling the image used in the fill.
void setWidthMapUnitScale (const QgsMapUnitScale &scale)
 Sets the map unit scale for the image's width.
void setWidthUnit (const QgsSymbolV2::OutputUnit unit)
 Sets the units for the image's width.
void startRender (QgsSymbolV2RenderContext &context) override
void stopRender (QgsSymbolV2RenderContext &context) override
virtual QgsSymbolV2subSymbol () override
double width () const
 Returns the width used for scaling the image used in the fill.
const QgsMapUnitScalewidthMapUnitScale () const
 Returns the map unit scale for the image's width.
QgsSymbolV2::OutputUnit widthUnit () const
 Returns the units for the image's width.
- Public Member Functions inherited from QgsImageFillSymbolLayer
 QgsImageFillSymbolLayer ()
virtual ~QgsImageFillSymbolLayer ()
virtual QColor dxfColor (const QgsSymbolV2RenderContext &context) const override
virtual Qt::PenStyle dxfPenStyle () const override
virtual double dxfWidth (const QgsDxfExport &e, const QgsSymbolV2RenderContext &context) const override
QgsMapUnitScale mapUnitScale () const override
const QgsMapUnitScaleoutlineWidthMapUnitScale () const
QgsSymbolV2::OutputUnit outlineWidthUnit () const
QgsSymbolV2::OutputUnit outputUnit () const override
void setMapUnitScale (const QgsMapUnitScale &scale) override
void setOutlineWidthMapUnitScale (const QgsMapUnitScale &scale)
void setOutlineWidthUnit (QgsSymbolV2::OutputUnit unit)
void setOutputUnit (QgsSymbolV2::OutputUnit unit) override
- Public Member Functions inherited from QgsFillSymbolLayerV2
double angle () const
void drawPreviewIcon (QgsSymbolV2RenderContext &context, QSize size) override
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 double dxfOffset (const QgsDxfExport &e, const QgsSymbolV2RenderContext &context) const
virtual QColor fillColor () const
 Get fill color.
bool hasDataDefinedProperties () const
bool isLocked () const
virtual QString ogrFeatureStyle (double mmScaleFactor, double mapUnitScaleFactor) const
virtual QColor outlineColor () const
 Get outline color.
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.
void setLocked (bool locked)
virtual void setOutlineColor (const QColor &color)
 Set outline color.
void setRenderingPass (int renderingPass)
virtual void toSld (QDomDocument &doc, QDomElement &element, QgsStringMap props) const
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())

Protected Member Functions

void applyDataDefinedSettings (const QgsSymbolV2RenderContext &context) override

Protected Attributes

double mAlpha
FillCoordinateMode mCoordinateMode
QString mImageFilePath
 Path to the image file.
QPointF mOffset
QgsMapUnitScale mOffsetMapUnitScale
QgsSymbolV2::OutputUnit mOffsetUnit
double mWidth
QgsMapUnitScale mWidthMapUnitScale
QgsSymbolV2::OutputUnit mWidthUnit
- Protected Attributes inherited from QgsImageFillSymbolLayer
QBrush mBrush
double mNextAngle
QgsLineSymbolV2mOutline
 Custom outline.
double mOutlineWidth
 Outline width.
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 filling symbols with a repeated raster image.

Note
Added in version 2.7

Definition at line 594 of file qgsfillsymbollayerv2.h.

Member Enumeration Documentation

Enumerator:
Feature 
Viewport 

Definition at line 598 of file qgsfillsymbollayerv2.h.

Constructor & Destructor Documentation

QgsRasterFillSymbolLayer::QgsRasterFillSymbolLayer ( const QString &  imageFilePath = QString())

Definition at line 3518 of file qgsfillsymbollayerv2.cpp.

QgsRasterFillSymbolLayer::~QgsRasterFillSymbolLayer ( )

Definition at line 3530 of file qgsfillsymbollayerv2.cpp.

Member Function Documentation

double QgsRasterFillSymbolLayer::alpha ( ) const
inline

The opacity for the raster image used in the fill.

Returns
opacity value between 0 (fully transparent) and 1 (fully opaque)
See Also
setAlpha

Definition at line 655 of file qgsfillsymbollayerv2.h.

void QgsRasterFillSymbolLayer::applyDataDefinedSettings ( const QgsSymbolV2RenderContext context)
overrideprotectedvirtual

Reimplemented from QgsImageFillSymbolLayer.

Definition at line 3716 of file qgsfillsymbollayerv2.cpp.

QgsSymbolLayerV2 * QgsRasterFillSymbolLayer::clone ( ) const
overridevirtual

Implements QgsSymbolLayerV2.

Definition at line 3680 of file qgsfillsymbollayerv2.cpp.

FillCoordinateMode QgsRasterFillSymbolLayer::coordinateMode ( ) const
inline

Coordinate mode for fill.

Controls how the top left corner of the image fill is positioned relative to the feature.

Returns
coordinate mode
See Also
setCoordinateMode

Definition at line 644 of file qgsfillsymbollayerv2.h.

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

Definition at line 3535 of file qgsfillsymbollayerv2.cpp.

double QgsRasterFillSymbolLayer::estimateMaxBleed ( ) const
overridevirtual

Returns the estimated maximum distance which the layer style will bleed outside the drawn shape.

Eg, polygons drawn with an outline will draw half the width of the outline outside of the polygon. This amount is estimated, since it may be affected by data defined symbology rules.

Reimplemented from QgsImageFillSymbolLayer.

Definition at line 3696 of file qgsfillsymbollayerv2.cpp.

QString QgsRasterFillSymbolLayer::imageFilePath ( ) const
inline

The path to the raster image used for the fill.

Returns
path to image file
See Also
setImageFilePath

Definition at line 631 of file qgsfillsymbollayerv2.h.

QString QgsRasterFillSymbolLayer::layerType ( ) const
overridevirtual

Implements QgsSymbolLayerV2.

Definition at line 3617 of file qgsfillsymbollayerv2.cpp.

QPointF QgsRasterFillSymbolLayer::offset ( ) const
inline

Returns the offset for the fill.

Returns
offset for fill
See Also
setOffset
offsetUnit
offsetMapUnitScale

Definition at line 670 of file qgsfillsymbollayerv2.h.

const QgsMapUnitScale& QgsRasterFillSymbolLayer::offsetMapUnitScale ( ) const
inline

Returns the map unit scale for the fill's offset.

Returns
map unit scale for offset
See Also
setOffsetMapUnitScale
offset
offsetUnit

Definition at line 700 of file qgsfillsymbollayerv2.h.

QgsSymbolV2::OutputUnit QgsRasterFillSymbolLayer::offsetUnit ( ) const
inline

Returns the units for the fill's offset.

Returns
units for offset
See Also
setOffsetUnit
offset
offsetMapUnitScale

Definition at line 685 of file qgsfillsymbollayerv2.h.

QgsStringMap QgsRasterFillSymbolLayer::properties ( ) const
overridevirtual

Implements QgsSymbolLayerV2.

Definition at line 3662 of file qgsfillsymbollayerv2.cpp.

void QgsRasterFillSymbolLayer::renderPolygon ( const QPolygonF &  points,
QList< QPolygonF > *  rings,
QgsSymbolV2RenderContext context 
)
overridevirtual

Reimplemented from QgsImageFillSymbolLayer.

Definition at line 3622 of file qgsfillsymbollayerv2.cpp.

void QgsRasterFillSymbolLayer::setAlpha ( const double  alpha)

Sets the opacity for the raster image used in the fill.

Parameters
alphaopacity value between 0 (fully transparent) and 1 (fully opaque)
See Also
alpha

Definition at line 3711 of file qgsfillsymbollayerv2.cpp.

void QgsRasterFillSymbolLayer::setCoordinateMode ( const FillCoordinateMode  mode)

Set the coordinate mode for fill.

Controls how the top left corner of the image fill is positioned relative to the feature.

Parameters
modecoordinate mode
See Also
coordinateMode

Definition at line 3706 of file qgsfillsymbollayerv2.cpp.

void QgsRasterFillSymbolLayer::setImageFilePath ( const QString &  imagePath)

Sets the path to the raster image used for the fill.

Parameters
imagePathpath to image file
See Also
imageFilePath

Definition at line 3701 of file qgsfillsymbollayerv2.cpp.

void QgsRasterFillSymbolLayer::setOffset ( const QPointF &  offset)
inline

Sets the offset for the fill.

Parameters
offsetoffset for fill
See Also
offset
setOffsetUnit
setOffsetMapUnitScale

Definition at line 663 of file qgsfillsymbollayerv2.h.

void QgsRasterFillSymbolLayer::setOffsetMapUnitScale ( const QgsMapUnitScale scale)
inline

Sets the map unit scale for the fill's offset.

Parameters
scalemap unit scale for offset
See Also
offsetMapUnitScale
setOffset
setOffsetUnit

Definition at line 693 of file qgsfillsymbollayerv2.h.

void QgsRasterFillSymbolLayer::setOffsetUnit ( const QgsSymbolV2::OutputUnit  unit)
inline

Sets the units for the fill's offset.

Parameters
unitunits for offset
See Also
offsetUnit
setOffset
setOffsetMapUnitScale

Definition at line 678 of file qgsfillsymbollayerv2.h.

bool QgsRasterFillSymbolLayer::setSubSymbol ( QgsSymbolV2 symbol)
overridevirtual

Reimplemented from QgsImageFillSymbolLayer.

Definition at line 3611 of file qgsfillsymbollayerv2.cpp.

void QgsRasterFillSymbolLayer::setWidth ( const double  width)
inline

Sets the width for scaling the image used in the fill.

The image's height will also be scaled to maintain the image's aspect ratio.

Parameters
widthwidth for scaling the image
See Also
width
setWidthUnit
setWidthMapUnitScale

Definition at line 709 of file qgsfillsymbollayerv2.h.

void QgsRasterFillSymbolLayer::setWidthMapUnitScale ( const QgsMapUnitScale scale)
inline

Sets the map unit scale for the image's width.

Parameters
scalemap unit scale for width
See Also
widthMapUnitScale
setWidth
setWidthUnit

Definition at line 740 of file qgsfillsymbollayerv2.h.

void QgsRasterFillSymbolLayer::setWidthUnit ( const QgsSymbolV2::OutputUnit  unit)
inline

Sets the units for the image's width.

Parameters
unitunits for width
See Also
widthUnit
setWidth
setWidthMapUnitScale

Definition at line 725 of file qgsfillsymbollayerv2.h.

void QgsRasterFillSymbolLayer::startRender ( QgsSymbolV2RenderContext context)
overridevirtual

Implements QgsSymbolLayerV2.

Definition at line 3651 of file qgsfillsymbollayerv2.cpp.

void QgsRasterFillSymbolLayer::stopRender ( QgsSymbolV2RenderContext context)
overridevirtual

Implements QgsSymbolLayerV2.

Definition at line 3657 of file qgsfillsymbollayerv2.cpp.

virtual QgsSymbolV2* QgsRasterFillSymbolLayer::subSymbol ( )
inlineoverridevirtual

Reimplemented from QgsImageFillSymbolLayer.

Definition at line 619 of file qgsfillsymbollayerv2.h.

double QgsRasterFillSymbolLayer::width ( ) const
inline

Returns the width used for scaling the image used in the fill.

The image's height is scaled to maintain the image's aspect ratio.

Returns
width used for scaling the image
See Also
setWidth
widthUnit
widthMapUnitScale

Definition at line 717 of file qgsfillsymbollayerv2.h.

const QgsMapUnitScale& QgsRasterFillSymbolLayer::widthMapUnitScale ( ) const
inline

Returns the map unit scale for the image's width.

Returns
map unit scale for width
See Also
setWidthMapUnitScale
width
widthUnit

Definition at line 747 of file qgsfillsymbollayerv2.h.

QgsSymbolV2::OutputUnit QgsRasterFillSymbolLayer::widthUnit ( ) const
inline

Returns the units for the image's width.

Returns
units for width
See Also
setWidthUnit
width
widthMapUnitScale

Definition at line 732 of file qgsfillsymbollayerv2.h.

Member Data Documentation

double QgsRasterFillSymbolLayer::mAlpha
protected

Definition at line 754 of file qgsfillsymbollayerv2.h.

FillCoordinateMode QgsRasterFillSymbolLayer::mCoordinateMode
protected

Definition at line 753 of file qgsfillsymbollayerv2.h.

QString QgsRasterFillSymbolLayer::mImageFilePath
protected

Path to the image file.

Definition at line 752 of file qgsfillsymbollayerv2.h.

QPointF QgsRasterFillSymbolLayer::mOffset
protected

Definition at line 756 of file qgsfillsymbollayerv2.h.

QgsMapUnitScale QgsRasterFillSymbolLayer::mOffsetMapUnitScale
protected

Definition at line 758 of file qgsfillsymbollayerv2.h.

QgsSymbolV2::OutputUnit QgsRasterFillSymbolLayer::mOffsetUnit
protected

Definition at line 757 of file qgsfillsymbollayerv2.h.

double QgsRasterFillSymbolLayer::mWidth
protected

Definition at line 760 of file qgsfillsymbollayerv2.h.

QgsMapUnitScale QgsRasterFillSymbolLayer::mWidthMapUnitScale
protected

Definition at line 762 of file qgsfillsymbollayerv2.h.

QgsSymbolV2::OutputUnit QgsRasterFillSymbolLayer::mWidthUnit
protected

Definition at line 761 of file qgsfillsymbollayerv2.h.


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