QGIS API Documentation
2.4.0-Chugiak
|
#include <qgsfillsymbollayerv2.h>
Public Types | |
enum | ShapeburstColorType { SimpleTwoColor, ColorRamp } |
Public Member Functions | |
QgsShapeburstFillSymbolLayerV2 (QColor color=DEFAULT_SIMPLEFILL_COLOR, QColor color2=Qt::white, ShapeburstColorType colorType=SimpleTwoColor, int blurRadius=0, bool useWholeShape=true, double maxDistance=5) | |
virtual | ~QgsShapeburstFillSymbolLayerV2 () |
QString | layerType () const |
void | startRender (QgsSymbolV2RenderContext &context) |
void | stopRender (QgsSymbolV2RenderContext &context) |
void | renderPolygon (const QPolygonF &points, QList< QPolygonF > *rings, QgsSymbolV2RenderContext &context) |
QgsStringMap | properties () const |
QgsSymbolLayerV2 * | clone () const |
double | estimateMaxBleed () const |
Returns the estimated maximum distance which the layer style will bleed outside the drawn shape. More... | |
void | setBlurRadius (int blurRadius) |
Sets the blur radius, which controls the amount of blurring applied to the fill. More... | |
int | blurRadius () const |
Returns the blur radius, which controls the amount of blurring applied to the fill. More... | |
void | setUseWholeShape (double useWholeShape) |
Sets whether the shapeburst fill should be drawn using the entire shape. More... | |
double | useWholeShape () const |
Returns whether the shapeburst fill is set to cover the entire shape. More... | |
void | setMaxDistance (double maxDistance) |
Sets the maximum distance to shape inside of the shape from the polygon's boundary. More... | |
double | maxDistance () const |
Returns the maximum distance from the shape's boundary which is shaded. More... | |
void | setDistanceUnit (QgsSymbolV2::OutputUnit unit) |
Sets the unit for the maximum distance to shade inside of the shape from the polygon's boundary. More... | |
QgsSymbolV2::OutputUnit | distanceUnit () const |
Returns the unit for the maximum distance to shade inside of the shape from the polygon's boundary. More... | |
void | setDistanceMapUnitScale (const QgsMapUnitScale &scale) |
const QgsMapUnitScale & | distanceMapUnitScale () const |
void | setColorType (ShapeburstColorType colorType) |
Sets the color mode to use for the shapeburst fill. More... | |
ShapeburstColorType | colorType () const |
Returns the color mode used for the shapeburst fill. More... | |
void | setColorRamp (QgsVectorColorRampV2 *ramp) |
Sets the color ramp used to draw the shapeburst fill. More... | |
QgsVectorColorRampV2 * | colorRamp () |
Returns the color ramp used for the shapeburst fill. More... | |
void | setColor2 (QColor color2) |
Sets the color for the endpoint of the shapeburst fill. More... | |
QColor | color2 () const |
Returns the color used for the endpoint of the shapeburst fill. More... | |
void | setIgnoreRings (double ignoreRings) |
Sets whether the shapeburst fill should ignore polygon rings when calculating the buffered shading. More... | |
double | ignoreRings () const |
Returns whether the shapeburst fill is set to ignore polygon interior rings. More... | |
void | setOffset (QPointF offset) |
Sets the offset for the shapeburst fill. More... | |
QPointF | offset () const |
Returns the offset for the shapeburst fill. More... | |
void | setOffsetUnit (QgsSymbolV2::OutputUnit unit) |
Sets the units used for the offset for the shapeburst fill. More... | |
QgsSymbolV2::OutputUnit | offsetUnit () const |
Returns the units used for the offset of the shapeburst fill. More... | |
void | setOffsetMapUnitScale (const QgsMapUnitScale &scale) |
const QgsMapUnitScale & | offsetMapUnitScale () const |
void | setOutputUnit (QgsSymbolV2::OutputUnit unit) |
QgsSymbolV2::OutputUnit | outputUnit () const |
void | setMapUnitScale (const QgsMapUnitScale &scale) |
QgsMapUnitScale | mapUnitScale () const |
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 QColor | color () const |
virtual void | setColor (const QColor &color) |
virtual void | setOutlineColor (const QColor &color) |
Set outline color. More... | |
virtual QColor | outlineColor () const |
Get outline color. More... | |
virtual void | setFillColor (const QColor &color) |
Set fill color. More... | |
virtual QColor | fillColor () const |
Get fill color. More... | |
virtual | ~QgsSymbolLayerV2 () |
virtual void | toSld (QDomDocument &doc, QDomElement &element, QgsStringMap props) const |
virtual QString | ogrFeatureStyle (double mmScaleFactor, double mapUnitScaleFactor) const |
virtual QgsSymbolV2 * | subSymbol () |
virtual bool | setSubSymbol (QgsSymbolV2 *symbol) |
QgsSymbolV2::SymbolType | type () const |
void | setLocked (bool locked) |
bool | isLocked () const |
void | setRenderingPass (int renderingPass) |
int | renderingPass () const |
virtual QSet< QString > | usedAttributes () const |
virtual const QgsExpression * | dataDefinedProperty (const QString &property) const |
virtual QString | dataDefinedPropertyString (const QString &property) const |
virtual void | setDataDefinedProperty (const QString &property, const QString &expressionString) |
virtual void | removeDataDefinedProperty (const QString &property) |
virtual void | removeDataDefinedProperties () |
bool | hasDataDefinedProperties () 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 |
virtual double | dxfWidth (const QgsDxfExport &e, const QgsSymbolV2RenderContext &context) const |
virtual QColor | dxfColor (const QgsSymbolV2RenderContext &context) const |
virtual QVector< qreal > | dxfCustomDashPattern (QgsSymbolV2::OutputUnit &unit) const |
virtual Qt::PenStyle | dxfPenStyle () const |
Static Public Member Functions | |
static QgsSymbolLayerV2 * | create (const QgsStringMap &properties=QgsStringMap()) |
Protected Attributes | |
QBrush | mBrush |
QBrush | mSelBrush |
int | mBlurRadius |
bool | mUseWholeShape |
double | mMaxDistance |
QgsSymbolV2::OutputUnit | mDistanceUnit |
QgsMapUnitScale | mDistanceMapUnitScale |
ShapeburstColorType | mColorType |
QColor | mColor2 |
QgsVectorColorRampV2 * | mGradientRamp |
QgsVectorColorRampV2 * | mTwoColorGradientRamp |
bool | mIgnoreRings |
QPointF | mOffset |
QgsSymbolV2::OutputUnit | mOffsetUnit |
QgsMapUnitScale | mOffsetMapUnitScale |
Protected Attributes inherited from QgsFillSymbolLayerV2 | |
double | mAngle |
Protected Attributes inherited from QgsSymbolLayerV2 | |
QgsSymbolV2::SymbolType | mType |
bool | mLocked |
QColor | mColor |
int | mRenderingPass |
QMap< QString, QgsExpression * > | mDataDefinedProperties |
Private Member Functions | |
void | applyDataDefinedSymbology (QgsSymbolV2RenderContext &context, QColor &color, QColor &color2, int &blurRadius, bool &useWholeShape, double &maxDistance, bool &ignoreRings) |
void | distanceTransform1d (double *f, int n, int *v, double *z, double *d) |
void | distanceTransform2d (double *im, int width, int height) |
double * | distanceTransform (QImage *im) |
void | dtArrayToQImage (double *array, QImage *im, QgsVectorColorRampV2 *ramp, double layerAlpha=1, bool useWholeShape=true, int maxPixelDistance=0) |
Additional Inherited Members | |
Protected Member Functions inherited from QgsFillSymbolLayerV2 | |
QgsFillSymbolLayerV2 (bool locked=false) | |
void | _renderPolygon (QPainter *p, const QPolygonF &points, const QList< QPolygonF > *rings, QgsSymbolV2RenderContext &context) |
Default method to render polygon. More... | |
Protected Member Functions inherited from QgsSymbolLayerV2 | |
QgsSymbolLayerV2 (QgsSymbolV2::SymbolType type, bool locked=false) | |
virtual void | prepareExpressions (const QgsFields *fields, double scale=-1.0) |
virtual QgsExpression * | expression (const QString &property) const |
void | saveDataDefinedProperties (QgsStringMap &stringMap) const |
Saves data defined properties to string map. More... | |
void | copyDataDefinedProperties (QgsSymbolLayerV2 *destLayer) const |
Copies data defined properties of this layer to another symbol layer. More... | |
Static Protected Attributes inherited from QgsSymbolLayerV2 | |
static const bool | selectionIsOpaque = true |
static const bool | selectFillBorder = false |
static const bool | selectFillStyle = false |
Definition at line 304 of file qgsfillsymbollayerv2.h.
Enumerator | |
---|---|
SimpleTwoColor | |
ColorRamp |
Definition at line 308 of file qgsfillsymbollayerv2.h.
QgsShapeburstFillSymbolLayerV2::QgsShapeburstFillSymbolLayerV2 | ( | QColor | color = DEFAULT_SIMPLEFILL_COLOR , |
QColor | color2 = Qt::white , |
||
ShapeburstColorType | colorType = SimpleTwoColor , |
||
int | blurRadius = 0 , |
||
bool | useWholeShape = true , |
||
double | maxDistance = 5 |
||
) |
Definition at line 834 of file qgsfillsymbollayerv2.cpp.
References QgsSymbolLayerV2::color(), and QgsSymbolLayerV2::mColor.
|
virtual |
Definition at line 851 of file qgsfillsymbollayerv2.cpp.
References mGradientRamp.
|
private |
Definition at line 954 of file qgsfillsymbollayerv2.cpp.
References QgsSymbolLayerV2Utils::decodeColor(), QgsExpression::evaluate(), QgsSymbolLayerV2::expression(), QgsSymbolV2RenderContext::feature(), mBlurRadius, QgsSymbolLayerV2::mColor, mColor2, mIgnoreRings, mMaxDistance, and mUseWholeShape.
Referenced by renderPolygon().
|
inline |
Returns the blur radius, which controls the amount of blurring applied to the fill.
Definition at line 351 of file qgsfillsymbollayerv2.h.
Referenced by create(), and renderPolygon().
|
virtual |
Implements QgsSymbolLayerV2.
Definition at line 1354 of file qgsfillsymbollayerv2.cpp.
References QgsVectorColorRampV2::clone(), QgsSymbolLayerV2::copyDataDefinedProperties(), mBlurRadius, QgsSymbolLayerV2::mColor, mColor2, mColorType, mDistanceMapUnitScale, mDistanceUnit, mGradientRamp, mIgnoreRings, mMaxDistance, mOffset, mOffsetMapUnitScale, mOffsetUnit, mUseWholeShape, QgsShapeburstFillSymbolLayerV2(), setColorRamp(), setDistanceMapUnitScale(), setDistanceUnit(), setIgnoreRings(), setOffset(), setOffsetMapUnitScale(), and setOffsetUnit().
|
inline |
Returns the color used for the endpoint of the shapeburst fill.
This color is only used if the colorType is set to ShapeburstColorType::SimpleTwoColor
Definition at line 453 of file qgsfillsymbollayerv2.h.
Referenced by create(), and renderPolygon().
|
inline |
Returns the color ramp used for the shapeburst fill.
The color ramp is only used if the colorType is set to ShapeburstColorType::ColorRamp
Definition at line 438 of file qgsfillsymbollayerv2.h.
|
inline |
Returns the color mode used for the shapeburst fill.
Shapeburst can either be drawn using a QgsVectorColorRampV2 color ramp or by simply specificing a start and end color.
Definition at line 423 of file qgsfillsymbollayerv2.h.
Referenced by create().
|
static |
Definition at line 856 of file qgsfillsymbollayerv2.cpp.
References blurRadius(), QgsSymbolLayerV2::color(), color2(), colorType(), QgsVectorGradientColorRampV2::create(), QgsSymbolLayerV2Utils::decodeColor(), QgsSymbolLayerV2Utils::decodeMapUnitScale(), QgsSymbolLayerV2Utils::decodeOutputUnit(), QgsSymbolLayerV2Utils::decodePoint(), DEFAULT_SIMPLEFILL_COLOR, maxDistance(), offset(), QgsShapeburstFillSymbolLayerV2(), setColorRamp(), QgsSymbolLayerV2::setDataDefinedProperty(), setDistanceMapUnitScale(), setDistanceUnit(), setIgnoreRings(), setOffset(), setOffsetMapUnitScale(), setOffsetUnit(), SimpleTwoColor, and useWholeShape().
Referenced by QgsSymbolLayerV2Registry::QgsSymbolLayerV2Registry().
|
inline |
Definition at line 402 of file qgsfillsymbollayerv2.h.
|
private |
Definition at line 1238 of file qgsfillsymbollayerv2.cpp.
References distanceTransform2d(), and INF.
Referenced by renderPolygon().
|
private |
Definition at line 1166 of file qgsfillsymbollayerv2.cpp.
References INF.
Referenced by distanceTransform2d().
|
private |
Definition at line 1196 of file qgsfillsymbollayerv2.cpp.
References distanceTransform1d().
Referenced by distanceTransform().
|
inline |
Returns the unit for the maximum distance to shade inside of the shape from the polygon's boundary.
Definition at line 399 of file qgsfillsymbollayerv2.h.
|
private |
Definition at line 1274 of file qgsfillsymbollayerv2.cpp.
References QgsVectorColorRampV2::color(), and QgsSymbolLayerV2Utils::premultiplyColor().
Referenced by renderPolygon().
|
virtual |
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 QgsSymbolLayerV2.
Definition at line 1371 of file qgsfillsymbollayerv2.cpp.
References mOffset.
|
inline |
Returns whether the shapeburst fill is set to ignore polygon interior rings.
Definition at line 467 of file qgsfillsymbollayerv2.h.
Referenced by renderPolygon().
|
virtual |
Implements QgsSymbolLayerV2.
Definition at line 943 of file qgsfillsymbollayerv2.cpp.
|
virtual |
Reimplemented from QgsSymbolLayerV2.
Definition at line 1398 of file qgsfillsymbollayerv2.cpp.
References mDistanceMapUnitScale, and mOffsetMapUnitScale.
|
inline |
Returns the maximum distance from the shape's boundary which is shaded.
This parameter is only effective if useWholeShape is false.
Definition at line 384 of file qgsfillsymbollayerv2.h.
Referenced by create(), and renderPolygon().
|
inline |
Returns the offset for the shapeburst fill.
Definition at line 482 of file qgsfillsymbollayerv2.h.
Referenced by create(), and renderPolygon().
|
inline |
Definition at line 500 of file qgsfillsymbollayerv2.h.
|
inline |
Returns the units used for the offset of the shapeburst fill.
Definition at line 497 of file qgsfillsymbollayerv2.h.
|
virtual |
Reimplemented from QgsSymbolLayerV2.
Definition at line 1383 of file qgsfillsymbollayerv2.cpp.
References mDistanceUnit, QgsSymbolV2::Mixed, and mOffsetUnit.
|
virtual |
Implements QgsSymbolLayerV2.
Definition at line 1328 of file qgsfillsymbollayerv2.cpp.
References QgsSymbolLayerV2Utils::encodeColor(), QgsSymbolLayerV2Utils::encodeMapUnitScale(), QgsSymbolLayerV2Utils::encodeOutputUnit(), QgsSymbolLayerV2Utils::encodePoint(), mBlurRadius, QgsSymbolLayerV2::mColor, mColor2, mColorType, mDistanceMapUnitScale, mDistanceUnit, mGradientRamp, mIgnoreRings, mMaxDistance, mOffset, mOffsetMapUnitScale, mOffsetUnit, mUseWholeShape, QgsVectorColorRampV2::properties(), and QgsSymbolLayerV2::saveDataDefinedProperties().
|
virtual |
Implements QgsFillSymbolLayerV2.
Definition at line 1010 of file qgsfillsymbollayerv2.cpp.
References QgsFillSymbolLayerV2::_renderPolygon(), QgsSymbolV2RenderContext::alpha(), applyDataDefinedSymbology(), QgsSymbolLayerV2Utils::blurImageInPlace(), blurRadius(), color2(), distanceTransform(), dtArrayToQImage(), ignoreRings(), QgsSymbolLayerV2Utils::lineWidthScaleFactor(), maxDistance(), mColorType, mDistanceMapUnitScale, mDistanceUnit, mGradientRamp, mOffset, mOffsetMapUnitScale, mOffsetUnit, mSelBrush, mTwoColorGradientRamp, offset(), QgsRenderContext::painter(), QgsSymbolLayerV2Utils::pixelSizeScaleFactor(), QgsRenderContext::rasterScaleFactor(), QgsSymbolV2RenderContext::renderContext(), QgsSymbolV2RenderContext::selected(), SimpleTwoColor, and useWholeShape().
|
inline |
Sets the blur radius, which controls the amount of blurring applied to the fill.
blurRadius | Radius for fill blur. Values between 0 - 17 are valid, where higher values results in a stronger blur. Set to 0 to disable blur. |
Definition at line 345 of file qgsfillsymbollayerv2.h.
|
inline |
Sets the color for the endpoint of the shapeburst fill.
This color is only used if setColorType is set ShapeburstColorType::SimpleTwoColor.
color2 | QColor to use for endpoint of gradient |
Definition at line 446 of file qgsfillsymbollayerv2.h.
void QgsShapeburstFillSymbolLayerV2::setColorRamp | ( | QgsVectorColorRampV2 * | ramp | ) |
Sets the color ramp used to draw the shapeburst fill.
Color ramps are only used if setColorType is set ShapeburstColorType::ColorRamp.
ramp | color ramp to use for shapeburst fill |
Definition at line 948 of file qgsfillsymbollayerv2.cpp.
References mGradientRamp.
|
inline |
Sets the color mode to use for the shapeburst fill.
Shapeburst can either be drawn using a QgsVectorColorRampV2 color ramp or by simply specificing a start and end color. setColorType is used to specify which mode to use for the fill.
colorType | color type to use for shapeburst fill |
Definition at line 413 of file qgsfillsymbollayerv2.h.
|
inline |
Definition at line 401 of file qgsfillsymbollayerv2.h.
|
inline |
Sets the unit for the maximum distance to shade inside of the shape from the polygon's boundary.
unit | distance unit for the maximum distance |
Definition at line 392 of file qgsfillsymbollayerv2.h.
|
inline |
Sets whether the shapeburst fill should ignore polygon rings when calculating the buffered shading.
ignoreRings | Set to true if buffers should ignore interior rings for polygons. |
Definition at line 461 of file qgsfillsymbollayerv2.h.
|
virtual |
Reimplemented from QgsSymbolLayerV2.
Definition at line 1392 of file qgsfillsymbollayerv2.cpp.
References mDistanceMapUnitScale, and mOffsetMapUnitScale.
|
inline |
Sets the maximum distance to shape inside of the shape from the polygon's boundary.
maxDistance | distance from boundary to shade. setUseWholeShape must be set to false for this parameter to take effect. Distance unit is controlled by setDistanceUnit. |
Definition at line 376 of file qgsfillsymbollayerv2.h.
|
inline |
Sets the offset for the shapeburst fill.
offset | QPointF indicating the horizontal/vertical offset amount |
Definition at line 475 of file qgsfillsymbollayerv2.h.
|
inline |
Definition at line 499 of file qgsfillsymbollayerv2.h.
|
inline |
Sets the units used for the offset for the shapeburst fill.
unit | units for fill offset |
Definition at line 490 of file qgsfillsymbollayerv2.h.
|
virtual |
Reimplemented from QgsSymbolLayerV2.
Definition at line 1377 of file qgsfillsymbollayerv2.cpp.
References mDistanceUnit, and mOffsetUnit.
|
inline |
Sets whether the shapeburst fill should be drawn using the entire shape.
useWholeShape | Set to true if shapeburst should cover entire shape. If false, setMaxDistance is used to calculate how far from the boundary of the shape should be shaded |
Definition at line 360 of file qgsfillsymbollayerv2.h.
|
virtual |
Implements QgsSymbolLayerV2.
Definition at line 995 of file qgsfillsymbollayerv2.cpp.
References QgsSymbolV2RenderContext::alpha(), QgsSymbolV2RenderContext::fields(), mSelBrush, QgsSymbolLayerV2::prepareExpressions(), QgsSymbolV2RenderContext::renderContext(), QgsRenderContext::rendererScale(), QgsRenderContext::selectionColor(), and QgsSymbolLayerV2::selectionIsOpaque.
|
virtual |
Implements QgsSymbolLayerV2.
Definition at line 1005 of file qgsfillsymbollayerv2.cpp.
|
inline |
Returns whether the shapeburst fill is set to cover the entire shape.
Definition at line 367 of file qgsfillsymbollayerv2.h.
Referenced by create(), and renderPolygon().
|
protected |
Definition at line 512 of file qgsfillsymbollayerv2.h.
Referenced by applyDataDefinedSymbology(), clone(), and properties().
|
protected |
Definition at line 509 of file qgsfillsymbollayerv2.h.
|
protected |
Definition at line 520 of file qgsfillsymbollayerv2.h.
Referenced by applyDataDefinedSymbology(), clone(), and properties().
|
protected |
Definition at line 519 of file qgsfillsymbollayerv2.h.
Referenced by clone(), properties(), and renderPolygon().
|
protected |
Definition at line 517 of file qgsfillsymbollayerv2.h.
Referenced by clone(), mapUnitScale(), properties(), renderPolygon(), and setMapUnitScale().
|
protected |
Definition at line 516 of file qgsfillsymbollayerv2.h.
Referenced by clone(), outputUnit(), properties(), renderPolygon(), and setOutputUnit().
|
protected |
Definition at line 521 of file qgsfillsymbollayerv2.h.
Referenced by clone(), properties(), renderPolygon(), setColorRamp(), and ~QgsShapeburstFillSymbolLayerV2().
|
protected |
Definition at line 524 of file qgsfillsymbollayerv2.h.
Referenced by applyDataDefinedSymbology(), clone(), and properties().
|
protected |
Definition at line 515 of file qgsfillsymbollayerv2.h.
Referenced by applyDataDefinedSymbology(), clone(), and properties().
|
protected |
Definition at line 526 of file qgsfillsymbollayerv2.h.
Referenced by clone(), estimateMaxBleed(), properties(), and renderPolygon().
|
protected |
Definition at line 528 of file qgsfillsymbollayerv2.h.
Referenced by clone(), mapUnitScale(), properties(), renderPolygon(), and setMapUnitScale().
|
protected |
Definition at line 527 of file qgsfillsymbollayerv2.h.
Referenced by clone(), outputUnit(), properties(), renderPolygon(), and setOutputUnit().
|
protected |
Definition at line 510 of file qgsfillsymbollayerv2.h.
Referenced by renderPolygon(), and startRender().
|
protected |
Definition at line 522 of file qgsfillsymbollayerv2.h.
Referenced by renderPolygon().
|
protected |
Definition at line 514 of file qgsfillsymbollayerv2.h.
Referenced by applyDataDefinedSymbology(), clone(), and properties().