QGIS API Documentation
2.8.2-Wien
|
#include <qgsgraduatedsymbolrendererv2.h>
Public Types | |
enum | Mode { EqualInterval, Quantile, Jenks, StdDev, Pretty, Custom } |
Public Types inherited from QgsFeatureRendererV2 | |
enum | Capabilities { SymbolLevels = 1, RotationField = 1 << 1, MoreSymbolsPerFeature = 1 << 2, Filter = 1 << 3, ScaleDependent = 1 << 4 } |
Public Member Functions | |
QgsGraduatedSymbolRendererV2 (QString attrName=QString(), QgsRangeList ranges=QgsRangeList()) | |
QgsGraduatedSymbolRendererV2 (const QgsGraduatedSymbolRendererV2 &other) | |
virtual | ~QgsGraduatedSymbolRendererV2 () |
void | addClass (QgsSymbolV2 *symbol) |
void | addClass (QgsRendererRangeV2 range) |
void | addClass (double lower, double upper) |
void | calculateLabelPrecision (bool updateRanges=true) |
Reset the label decimal places to a numberbased on the minimum class interval. | |
virtual int | capabilities () override |
returns bitwise OR-ed capabilities of the renderer | |
virtual void | checkLegendSymbolItem (QString key, bool state=true) override |
item in symbology was checked | |
QString | classAttribute () const |
virtual QgsFeatureRendererV2 * | clone () const override |
void | deleteAllClasses () |
void | deleteClass (int idx) |
virtual QString | dump () const override |
for debugging | |
QList< double > | getDataValues (QgsVectorLayer *vlayer) |
Evaluates the data expression and returns the list of values from the layer. | |
bool | invertedColorRamp () |
const QgsRendererRangeV2LabelFormat & | labelFormat () const |
Return the label format used to generate default classification labels. | |
virtual QString | legendClassificationAttribute () const override |
If supported by the renderer, return classification attribute for the use in legend. | |
virtual bool | legendSymbolItemChecked (QString key) override |
item in symbology was checked | |
virtual QgsLegendSymbolList | legendSymbolItems (double scaleDenominator=-1, QString rule=QString()) override |
return a list of item text / symbol | |
virtual bool | legendSymbolItemsCheckable () const override |
items of symbology items in legend should be checkable | |
virtual QgsLegendSymbologyList | legendSymbologyItems (QSize iconSize) override |
return a list of symbology items for the legend | |
Mode | mode () const |
void | moveClass (int from, int to) |
Moves the category at index position from to index position to. | |
virtual QgsSymbolV2 * | originalSymbolForFeature (QgsFeature &feature) override |
Return symbol for feature. | |
const QgsRangeList & | ranges () const |
QString | rotationField () const override |
return rotation field name (or empty string if not set or not supported by renderer) | |
virtual QDomElement | save (QDomDocument &doc) override |
store renderer info to XML element | |
QgsSymbolV2::ScaleMethod | scaleMethod () const |
void | setClassAttribute (QString attr) |
void | setInvertedColorRamp (bool inverted) |
void | setLabelFormat (const QgsRendererRangeV2LabelFormat &labelFormat, bool updateRanges=false) |
Set the label format used to generate default classification labels. | |
void | setMode (Mode mode) |
void | setRotationField (QString fieldOrExpression) override |
sets rotation field of renderer (if supported by the renderer) | |
void | setScaleMethod (QgsSymbolV2::ScaleMethod scaleMethod) |
void | setSizeScaleField (QString fieldOrExpression) |
void | setSourceColorRamp (QgsVectorColorRampV2 *ramp) |
void | setSourceSymbol (QgsSymbolV2 *sym) |
QString | sizeScaleField () const |
void | sortByLabel (Qt::SortOrder order=Qt::AscendingOrder) |
void | sortByValue (Qt::SortOrder order=Qt::AscendingOrder) |
QgsVectorColorRampV2 * | sourceColorRamp () |
QgsSymbolV2 * | sourceSymbol () |
virtual void | startRender (QgsRenderContext &context, const QgsFields &fields) override |
virtual void | stopRender (QgsRenderContext &context) override |
virtual QgsSymbolV2 * | symbolForFeature (QgsFeature &feature) override |
to be overridden | |
virtual QgsSymbolV2List | symbols () override |
for symbol levels | |
virtual void | toSld (QDomDocument &doc, QDomElement &element) const override |
used from subclasses to create SLD Rule elements following SLD v1.1 specs | |
void | updateClasses (QgsVectorLayer *vlayer, Mode mode, int nclasses) |
Recalculate classes for a layer. | |
void | updateColorRamp (QgsVectorColorRampV2 *ramp=0, bool inverted=false) |
Update the color ramp used. | |
bool | updateRangeLabel (int rangeIndex, QString label) |
bool | updateRangeLowerValue (int rangeIndex, double value) |
bool | updateRangeRenderState (int rangeIndex, bool render) |
bool | updateRangeSymbol (int rangeIndex, QgsSymbolV2 *symbol) |
bool | updateRangeUpperValue (int rangeIndex, double value) |
void | updateSymbols (QgsSymbolV2 *sym) |
Update all the symbols but leave breaks and colors. | |
virtual QList< QString > | usedAttributes () override |
Public Member Functions inherited from QgsFeatureRendererV2 | |
virtual | ~QgsFeatureRendererV2 () |
virtual QgsLegendSymbolListV2 | legendSymbolItemsV2 () const |
Return a list of symbology items for the legend. | |
virtual void | modifyRequestExtent (QgsRectangle &extent, QgsRenderContext &context) |
Allows for a renderer to modify the extent of a feature request prior to rendering. | |
virtual QgsSymbolV2List | originalSymbolsForFeature (QgsFeature &feat) |
Equivalent of originalSymbolsForFeature() call extended to support renderers that may use more symbols per feature - similar to symbolsForFeature() | |
virtual bool | renderFeature (QgsFeature &feature, QgsRenderContext &context, int layer=-1, bool selected=false, bool drawVertexMarker=false) |
void | setUsingSymbolLevels (bool usingSymbolLevels) |
void | setVertexMarkerAppearance (int type, int size) |
set type and size of editing vertex markers for subsequent rendering | |
virtual Q_DECL_DEPRECATED void | startRender (QgsRenderContext &context, const QgsVectorLayer *vlayer) |
virtual QgsSymbolV2List | symbolsForFeature (QgsFeature &feat) |
return list of symbols used for rendering the feature. | |
QString | type () const |
bool | usingSymbolLevels () const |
virtual bool | willRenderFeature (QgsFeature &feat) |
return whether the renderer will render a feature or not. | |
virtual Q_DECL_DEPRECATED QDomElement | writeSld (QDomDocument &doc, const QgsVectorLayer &layer) const |
create the SLD UserStyle element following the SLD v1.1 specs | |
virtual QDomElement | writeSld (QDomDocument &doc, const QString &styleName) const |
create the SLD UserStyle element following the SLD v1.1 specs with the given name |
Static Public Member Functions | |
static QgsGraduatedSymbolRendererV2 * | convertFromRenderer (const QgsFeatureRendererV2 *renderer) |
creates a QgsGraduatedSymbolRendererV2 from an existing renderer. | |
static QgsFeatureRendererV2 * | create (QDomElement &element) |
create renderer from XML element | |
static QgsGraduatedSymbolRendererV2 * | createRenderer (QgsVectorLayer *vlayer, QString attrName, int classes, Mode mode, QgsSymbolV2 *symbol, QgsVectorColorRampV2 *ramp, bool inverted=false, QgsRendererRangeV2LabelFormat legendFormat=QgsRendererRangeV2LabelFormat()) |
Static Public Member Functions inherited from QgsFeatureRendererV2 | |
static QgsFeatureRendererV2 * | defaultRenderer (QGis::GeometryType geomType) |
return a new renderer - used by default in vector layers | |
static QgsFeatureRendererV2 * | load (QDomElement &symbologyElem) |
create a renderer from XML element | |
static QgsFeatureRendererV2 * | loadSld (const QDomNode &node, QGis::GeometryType geomType, QString &errorMessage) |
create a new renderer according to the information contained in the UserStyle element of a SLD style document |
Protected Member Functions | |
QgsSymbolV2 * | symbolForValue (double value) |
Protected Member Functions inherited from QgsFeatureRendererV2 | |
QgsFeatureRendererV2 (QString type) | |
void | renderFeatureWithSymbol (QgsFeature &feature, QgsSymbolV2 *symbol, QgsRenderContext &context, int layer, bool selected, bool drawVertexMarker) |
void | renderVertexMarker (QPointF &pt, QgsRenderContext &context) |
render editing vertex marker at specified point | |
void | renderVertexMarkerPolygon (QPolygonF &pts, QList< QPolygonF > *rings, QgsRenderContext &context) |
render editing vertex marker for a polygon | |
void | renderVertexMarkerPolyline (QPolygonF &pts, QgsRenderContext &context) |
render editing vertex marker for a polyline | |
void | setScaleMethodToSymbol (QgsSymbolV2 *symbol, int scaleMethod) |
Protected Attributes | |
QString | mAttrName |
int | mAttrNum |
attribute index (derived from attribute name in startRender) | |
bool | mCounting |
QScopedPointer< QgsExpression > | mExpression |
bool | mInvertedColorRamp |
QgsRendererRangeV2LabelFormat | mLabelFormat |
Mode | mMode |
QgsRangeList | mRanges |
QScopedPointer< QgsExpression > | mRotation |
QgsSymbolV2::ScaleMethod | mScaleMethod |
QScopedPointer< QgsExpression > | mSizeScale |
QScopedPointer < QgsVectorColorRampV2 > | mSourceColorRamp |
QScopedPointer< QgsSymbolV2 > | mSourceSymbol |
QHash< QgsSymbolV2 *, QgsSymbolV2 * > | mTempSymbols |
temporary symbols, used for data-defined rotation and scaling | |
Protected Attributes inherited from QgsFeatureRendererV2 | |
int | mCurrentVertexMarkerSize |
The current size of editing marker. | |
int | mCurrentVertexMarkerType |
The current type of editing marker. | |
QString | mType |
bool | mUsingSymbolLevels |
Additional Inherited Members | |
Static Protected Member Functions inherited from QgsFeatureRendererV2 | |
static const unsigned char * | _getLineString (QPolygonF &pts, QgsRenderContext &context, const unsigned char *wkb) |
static const unsigned char * | _getPoint (QPointF &pt, QgsRenderContext &context, const unsigned char *wkb) |
static const unsigned char * | _getPolygon (QPolygonF &pts, QList< QPolygonF > &holes, QgsRenderContext &context, const unsigned char *wkb) |
Definition at line 113 of file qgsgraduatedsymbolrendererv2.h.
Definition at line 168 of file qgsgraduatedsymbolrendererv2.h.
QgsGraduatedSymbolRendererV2::QgsGraduatedSymbolRendererV2 | ( | QString | attrName = QString() , |
QgsRangeList | ranges = QgsRangeList() |
||
) |
Definition at line 281 of file qgsgraduatedsymbolrendererv2.cpp.
QgsGraduatedSymbolRendererV2::QgsGraduatedSymbolRendererV2 | ( | const QgsGraduatedSymbolRendererV2 & | other | ) |
|
virtual |
Definition at line 295 of file qgsgraduatedsymbolrendererv2.cpp.
void QgsGraduatedSymbolRendererV2::addClass | ( | QgsSymbolV2 * | symbol | ) |
Definition at line 1446 of file qgsgraduatedsymbolrendererv2.cpp.
void QgsGraduatedSymbolRendererV2::addClass | ( | QgsRendererRangeV2 | range | ) |
Definition at line 1460 of file qgsgraduatedsymbolrendererv2.cpp.
void QgsGraduatedSymbolRendererV2::addClass | ( | double | lower, |
double | upper | ||
) |
Definition at line 1453 of file qgsgraduatedsymbolrendererv2.cpp.
void QgsGraduatedSymbolRendererV2::calculateLabelPrecision | ( | bool | updateRanges = true | ) |
Reset the label decimal places to a numberbased on the minimum class interval.
updateRanges | if true then ranges currently using the default label will be updated |
Definition at line 1488 of file qgsgraduatedsymbolrendererv2.cpp.
|
inlineoverridevirtual |
returns bitwise OR-ed capabilities of the renderer
Reimplemented from QgsFeatureRendererV2.
Definition at line 138 of file qgsgraduatedsymbolrendererv2.h.
|
overridevirtual |
item in symbology was checked
Reimplemented from QgsFeatureRendererV2.
Definition at line 1437 of file qgsgraduatedsymbolrendererv2.cpp.
|
inline |
Definition at line 142 of file qgsgraduatedsymbolrendererv2.h.
|
overridevirtual |
Implements QgsFeatureRendererV2.
Definition at line 505 of file qgsgraduatedsymbolrendererv2.cpp.
|
static |
creates a QgsGraduatedSymbolRendererV2 from an existing renderer.
Definition at line 1569 of file qgsgraduatedsymbolrendererv2.cpp.
|
static |
create renderer from XML element
Definition at line 1111 of file qgsgraduatedsymbolrendererv2.cpp.
|
static |
Definition at line 938 of file qgsgraduatedsymbolrendererv2.cpp.
void QgsGraduatedSymbolRendererV2::deleteAllClasses | ( | ) |
Definition at line 1470 of file qgsgraduatedsymbolrendererv2.cpp.
void QgsGraduatedSymbolRendererV2::deleteClass | ( | int | idx | ) |
Definition at line 1465 of file qgsgraduatedsymbolrendererv2.cpp.
|
overridevirtual |
for debugging
Reimplemented from QgsFeatureRendererV2.
Definition at line 497 of file qgsgraduatedsymbolrendererv2.cpp.
QList< double > QgsGraduatedSymbolRendererV2::getDataValues | ( | QgsVectorLayer * | vlayer | ) |
Evaluates the data expression and returns the list of values from the layer.
vlayer | The layer for which to evaluate the expression |
Definition at line 960 of file qgsgraduatedsymbolrendererv2.cpp.
|
inline |
Definition at line 235 of file qgsgraduatedsymbolrendererv2.h.
|
inline |
Return the label format used to generate default classification labels.
Definition at line 193 of file qgsgraduatedsymbolrendererv2.h.
|
inlineoverridevirtual |
If supported by the renderer, return classification attribute for the use in legend.
Reimplemented from QgsFeatureRendererV2.
Definition at line 269 of file qgsgraduatedsymbolrendererv2.h.
|
overridevirtual |
item in symbology was checked
Reimplemented from QgsFeatureRendererV2.
Definition at line 1427 of file qgsgraduatedsymbolrendererv2.cpp.
|
overridevirtual |
return a list of item text / symbol
Reimplemented from QgsFeatureRendererV2.
Definition at line 1312 of file qgsgraduatedsymbolrendererv2.cpp.
|
overridevirtual |
items of symbology items in legend should be checkable
Reimplemented from QgsFeatureRendererV2.
Definition at line 1422 of file qgsgraduatedsymbolrendererv2.cpp.
|
overridevirtual |
return a list of symbology items for the legend
Reimplemented from QgsFeatureRendererV2.
Definition at line 1299 of file qgsgraduatedsymbolrendererv2.cpp.
|
inline |
Definition at line 178 of file qgsgraduatedsymbolrendererv2.h.
void QgsGraduatedSymbolRendererV2::moveClass | ( | int | from, |
int | to | ||
) |
Moves the category at index position from to index position to.
Definition at line 1517 of file qgsgraduatedsymbolrendererv2.cpp.
|
overridevirtual |
Return symbol for feature.
The difference compared to symbolForFeature() is that it returns original symbol which can be used as an identifier for renderer's rule - the former may return a temporary replacement of a symbol for use in rendering.
Reimplemented from QgsFeatureRendererV2.
Definition at line 348 of file qgsgraduatedsymbolrendererv2.cpp.
|
inline |
Definition at line 145 of file qgsgraduatedsymbolrendererv2.h.
|
overridevirtual |
return rotation field name (or empty string if not set or not supported by renderer)
Reimplemented from QgsFeatureRendererV2.
Definition at line 1397 of file qgsgraduatedsymbolrendererv2.cpp.
|
overridevirtual |
store renderer info to XML element
Reimplemented from QgsFeatureRendererV2.
Definition at line 1209 of file qgsgraduatedsymbolrendererv2.cpp.
|
inline |
Definition at line 253 of file qgsgraduatedsymbolrendererv2.h.
|
inline |
Definition at line 143 of file qgsgraduatedsymbolrendererv2.h.
|
inline |
Definition at line 236 of file qgsgraduatedsymbolrendererv2.h.
void QgsGraduatedSymbolRendererV2::setLabelFormat | ( | const QgsRendererRangeV2LabelFormat & | labelFormat, |
bool | updateRanges = false |
||
) |
Set the label format used to generate default classification labels.
labelFormat | The string appended to classification labels |
updateRanges | If true then ranges ending with the old unit string are updated to the new. |
Definition at line 1475 of file qgsgraduatedsymbolrendererv2.cpp.
|
inline |
Definition at line 179 of file qgsgraduatedsymbolrendererv2.h.
|
overridevirtual |
sets rotation field of renderer (if supported by the renderer)
Reimplemented from QgsFeatureRendererV2.
Definition at line 1392 of file qgsgraduatedsymbolrendererv2.cpp.
void QgsGraduatedSymbolRendererV2::setScaleMethod | ( | QgsSymbolV2::ScaleMethod | scaleMethod | ) |
Definition at line 1412 of file qgsgraduatedsymbolrendererv2.cpp.
void QgsGraduatedSymbolRendererV2::setSizeScaleField | ( | QString | fieldOrExpression | ) |
Definition at line 1402 of file qgsgraduatedsymbolrendererv2.cpp.
void QgsGraduatedSymbolRendererV2::setSourceColorRamp | ( | QgsVectorColorRampV2 * | ramp | ) |
Definition at line 1341 of file qgsgraduatedsymbolrendererv2.cpp.
void QgsGraduatedSymbolRendererV2::setSourceSymbol | ( | QgsSymbolV2 * | sym | ) |
Definition at line 1331 of file qgsgraduatedsymbolrendererv2.cpp.
QString QgsGraduatedSymbolRendererV2::sizeScaleField | ( | ) | const |
Definition at line 1407 of file qgsgraduatedsymbolrendererv2.cpp.
void QgsGraduatedSymbolRendererV2::sortByLabel | ( | Qt::SortOrder | order = Qt::AscendingOrder | ) |
Definition at line 1557 of file qgsgraduatedsymbolrendererv2.cpp.
void QgsGraduatedSymbolRendererV2::sortByValue | ( | Qt::SortOrder | order = Qt::AscendingOrder | ) |
Definition at line 1534 of file qgsgraduatedsymbolrendererv2.cpp.
QgsVectorColorRampV2 * QgsGraduatedSymbolRendererV2::sourceColorRamp | ( | ) |
Definition at line 1336 of file qgsgraduatedsymbolrendererv2.cpp.
QgsSymbolV2 * QgsGraduatedSymbolRendererV2::sourceSymbol | ( | ) |
Definition at line 1327 of file qgsgraduatedsymbolrendererv2.cpp.
|
overridevirtual |
Implements QgsFeatureRendererV2.
Definition at line 369 of file qgsgraduatedsymbolrendererv2.cpp.
|
overridevirtual |
Implements QgsFeatureRendererV2.
Definition at line 401 of file qgsgraduatedsymbolrendererv2.cpp.
|
overridevirtual |
to be overridden
feature | feature |
Implements QgsFeatureRendererV2.
Definition at line 316 of file qgsgraduatedsymbolrendererv2.cpp.
|
protected |
Definition at line 300 of file qgsgraduatedsymbolrendererv2.cpp.
|
overridevirtual |
for symbol levels
Implements QgsFeatureRendererV2.
Definition at line 541 of file qgsgraduatedsymbolrendererv2.cpp.
|
overridevirtual |
used from subclasses to create SLD Rule elements following SLD v1.1 specs
Reimplemented from QgsFeatureRendererV2.
Definition at line 524 of file qgsgraduatedsymbolrendererv2.cpp.
void QgsGraduatedSymbolRendererV2::updateClasses | ( | QgsVectorLayer * | vlayer, |
Mode | mode, | ||
int | nclasses | ||
) |
Recalculate classes for a layer.
vlayer | The layer being rendered (from which data values are calculated) |
mode | The calculation mode |
nclasses | The number of classes to calculate (approximate for some modes) |
Definition at line 997 of file qgsgraduatedsymbolrendererv2.cpp.
void QgsGraduatedSymbolRendererV2::updateColorRamp | ( | QgsVectorColorRampV2 * | ramp = 0 , |
bool | inverted = false |
||
) |
Update the color ramp used.
Also updates all symbols colors. Doesn't alter current breaks.
Definition at line 1346 of file qgsgraduatedsymbolrendererv2.cpp.
bool QgsGraduatedSymbolRendererV2::updateRangeLabel | ( | int | rangeIndex, |
QString | label | ||
) |
Definition at line 459 of file qgsgraduatedsymbolrendererv2.cpp.
bool QgsGraduatedSymbolRendererV2::updateRangeLowerValue | ( | int | rangeIndex, |
double | value | ||
) |
Definition at line 478 of file qgsgraduatedsymbolrendererv2.cpp.
bool QgsGraduatedSymbolRendererV2::updateRangeRenderState | ( | int | rangeIndex, |
bool | render | ||
) |
Definition at line 489 of file qgsgraduatedsymbolrendererv2.cpp.
bool QgsGraduatedSymbolRendererV2::updateRangeSymbol | ( | int | rangeIndex, |
QgsSymbolV2 * | symbol | ||
) |
Definition at line 451 of file qgsgraduatedsymbolrendererv2.cpp.
bool QgsGraduatedSymbolRendererV2::updateRangeUpperValue | ( | int | rangeIndex, |
double | value | ||
) |
Definition at line 467 of file qgsgraduatedsymbolrendererv2.cpp.
void QgsGraduatedSymbolRendererV2::updateSymbols | ( | QgsSymbolV2 * | sym | ) |
Update all the symbols but leave breaks and colors.
Definition at line 1376 of file qgsgraduatedsymbolrendererv2.cpp.
|
overridevirtual |
Implements QgsFeatureRendererV2.
Definition at line 422 of file qgsgraduatedsymbolrendererv2.cpp.
|
protected |
Definition at line 277 of file qgsgraduatedsymbolrendererv2.h.
|
protected |
attribute index (derived from attribute name in startRender)
Definition at line 289 of file qgsgraduatedsymbolrendererv2.h.
|
protected |
Definition at line 290 of file qgsgraduatedsymbolrendererv2.h.
|
protected |
Definition at line 287 of file qgsgraduatedsymbolrendererv2.h.
|
protected |
Definition at line 282 of file qgsgraduatedsymbolrendererv2.h.
|
protected |
Definition at line 283 of file qgsgraduatedsymbolrendererv2.h.
|
protected |
Definition at line 279 of file qgsgraduatedsymbolrendererv2.h.
|
protected |
Definition at line 278 of file qgsgraduatedsymbolrendererv2.h.
|
protected |
Definition at line 284 of file qgsgraduatedsymbolrendererv2.h.
|
protected |
Definition at line 286 of file qgsgraduatedsymbolrendererv2.h.
|
protected |
Definition at line 285 of file qgsgraduatedsymbolrendererv2.h.
|
protected |
Definition at line 281 of file qgsgraduatedsymbolrendererv2.h.
|
protected |
Definition at line 280 of file qgsgraduatedsymbolrendererv2.h.
|
protected |
temporary symbols, used for data-defined rotation and scaling
Definition at line 293 of file qgsgraduatedsymbolrendererv2.h.