QGIS API Documentation
3.2.0-Bonn (bc43194)
|
#include <qgsgraduatedsymbolrenderer.h>
Public Types | |
enum | GraduatedMethod { GraduatedColor = 0, GraduatedSize = 1 } |
enum | Mode { EqualInterval, Quantile, Jenks, StdDev, Pretty, Custom } |
Public Types inherited from QgsFeatureRenderer | |
enum | Capability { SymbolLevels = 1, MoreSymbolsPerFeature = 1 << 2, Filter = 1 << 3, ScaleDependent = 1 << 4 } |
Used to specify details about a renderer. More... | |
Public Member Functions | |
QgsGraduatedSymbolRenderer (const QString &attrName=QString(), const QgsRangeList &ranges=QgsRangeList()) | |
~QgsGraduatedSymbolRenderer () override | |
void | addBreak (double breakValue, bool updateSymbols=true) |
Add a breakpoint by splitting existing classes so that the specified value becomes a break between two classes. More... | |
void | addClass (QgsSymbol *symbol) |
void | addClass (const QgsRendererRange &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. More... | |
QgsFeatureRenderer::Capabilities | capabilities () override |
Returns details about internals of this renderer. More... | |
void | checkLegendSymbolItem (const QString &key, bool state=true) override |
item in symbology was checked More... | |
QString | classAttribute () const |
QgsGraduatedSymbolRenderer * | clone () const override |
Create a deep copy of this renderer. More... | |
QgsDataDefinedSizeLegend * | dataDefinedSizeLegend () const |
Returns configuration of appearance of legend when using data-defined size for marker symbols. More... | |
void | deleteAllClasses () |
void | deleteClass (int idx) |
QString | dump () const override |
Returns debug information about this renderer. More... | |
GraduatedMethod | graduatedMethod () const |
Returns the method used for graduation (either size or color) More... | |
const QgsRendererRangeLabelFormat & | labelFormat () const |
Returns the label format used to generate default classification labels. More... | |
QString | legendClassificationAttribute () const override |
If supported by the renderer, return classification attribute for the use in legend. More... | |
QSet< QString > | legendKeysForFeature (const QgsFeature &feature, QgsRenderContext &context) const override |
Returns legend keys matching a specified feature. More... | |
bool | legendSymbolItemChecked (const QString &key) override |
items of symbology items in legend is checked More... | |
QgsLegendSymbolList | legendSymbolItems () const override |
Returns a list of symbology items for the legend. More... | |
bool | legendSymbolItemsCheckable () const override |
items of symbology items in legend should be checkable More... | |
double | maxSymbolSize () const |
Returns the max symbol size when graduated by size. More... | |
double | minSymbolSize () const |
Returns the min symbol size when graduated by size. More... | |
Mode | mode () const |
void | moveClass (int from, int to) |
Moves the category at index position from to index position to. More... | |
QgsSymbol * | originalSymbolForFeature (const QgsFeature &feature, QgsRenderContext &context) const override |
Returns symbol for feature. More... | |
const QgsRangeList & | ranges () const |
bool | rangesHaveGaps () const |
Tests whether classes assigned to the renderer have gaps between the ranges. More... | |
bool | rangesOverlap () const |
Tests whether classes assigned to the renderer have ranges which overlap. More... | |
QDomElement | save (QDomDocument &doc, const QgsReadWriteContext &context) override |
store renderer info to XML element More... | |
void | setClassAttribute (const QString &attr) |
void | setDataDefinedSizeLegend (QgsDataDefinedSizeLegend *settings) |
Configures appearance of legend when renderer is configured to use data-defined size for marker symbols. More... | |
void | setGraduatedMethod (GraduatedMethod method) |
set the method used for graduation (either size or color) More... | |
void | setLabelFormat (const QgsRendererRangeLabelFormat &labelFormat, bool updateRanges=false) |
Set the label format used to generate default classification labels. More... | |
void | setLegendSymbolItem (const QString &key, QgsSymbol *symbol) override |
Sets the symbol to be used for a legend symbol item. More... | |
void | setMode (Mode mode) |
void | setSourceColorRamp (QgsColorRamp *ramp) |
Sets the source color ramp. More... | |
void | setSourceSymbol (QgsSymbol *sym) |
Sets the source symbol for the renderer, which is the base symbol used for the each classes' symbol before applying the classes' color. More... | |
void | setSymbolSizes (double minSize, double maxSize) |
set varying symbol size for classes More... | |
void | sortByLabel (Qt::SortOrder order=Qt::AscendingOrder) |
void | sortByValue (Qt::SortOrder order=Qt::AscendingOrder) |
QgsColorRamp * | sourceColorRamp () |
Returns the source color ramp, from which each classes' color is derived. More... | |
QgsSymbol * | sourceSymbol () |
Returns the renderer's source symbol, which is the base symbol used for the each classes' symbol before applying the classes' color. More... | |
void | startRender (QgsRenderContext &context, const QgsFields &fields) override |
Must be called when a new render cycle is started. More... | |
void | stopRender (QgsRenderContext &context) override |
Must be called when a render cycle has finished, to allow the renderer to clean up. More... | |
QgsSymbol * | symbolForFeature (const QgsFeature &feature, QgsRenderContext &context) const override |
To be overridden. More... | |
QgsSymbolList | symbols (QgsRenderContext &context) const override |
Returns list of symbols used by the renderer. More... | |
void | toSld (QDomDocument &doc, QDomElement &element, const QgsStringMap &props=QgsStringMap()) const override |
used from subclasses to create SLD Rule elements following SLD v1.1 specs More... | |
void | updateClasses (QgsVectorLayer *vlayer, Mode mode, int nclasses) |
Recalculate classes for a layer. More... | |
void | updateColorRamp (QgsColorRamp *ramp=nullptr) |
Update the color ramp used. More... | |
bool | updateRangeLabel (int rangeIndex, const QString &label) |
bool | updateRangeLowerValue (int rangeIndex, double value) |
bool | updateRangeRenderState (int rangeIndex, bool render) |
bool | updateRangeSymbol (int rangeIndex, QgsSymbol *symbol) |
bool | updateRangeUpperValue (int rangeIndex, double value) |
void | updateSymbols (QgsSymbol *sym) |
Update all the symbols but leave breaks and colors. More... | |
QSet< QString > | usedAttributes (const QgsRenderContext &context) const override |
Returns a list of attributes required by this renderer. More... | |
Public Member Functions inherited from QgsFeatureRenderer | |
virtual | ~QgsFeatureRenderer () |
virtual const QgsFeatureRenderer * | embeddedRenderer () const |
Returns the current embedded renderer (subrenderer) for this feature renderer. More... | |
virtual QString | filter (const QgsFields &fields=QgsFields()) |
If a renderer does not require all the features this method may be overridden and return an expression used as where clause. More... | |
virtual bool | filterNeedsGeometry () const |
Returns true if this renderer requires the geometry to apply the filter. More... | |
bool | forceRasterRender () const |
Returns whether the renderer must render as a raster. More... | |
virtual void | modifyRequestExtent (QgsRectangle &extent, QgsRenderContext &context) |
Allows for a renderer to modify the extent of a feature request prior to rendering. More... | |
QgsFeatureRequest::OrderBy | orderBy () const |
Gets the order in which features shall be processed by this renderer. More... | |
bool | orderByEnabled () const |
Returns whether custom ordering will be applied before features are processed by this renderer. More... | |
virtual QgsSymbolList | originalSymbolsForFeature (const QgsFeature &feature, QgsRenderContext &context) const |
Equivalent of originalSymbolsForFeature() call extended to support renderers that may use more symbols per feature - similar to symbolsForFeature() More... | |
QgsPaintEffect * | paintEffect () const |
Returns the current paint effect for the renderer. More... | |
virtual bool | renderFeature (const QgsFeature &feature, QgsRenderContext &context, int layer=-1, bool selected=false, bool drawVertexMarker=false) |
Render a feature using this renderer in the given context. More... | |
virtual void | setEmbeddedRenderer (QgsFeatureRenderer *subRenderer) |
Sets an embedded renderer (subrenderer) for this feature renderer. More... | |
void | setForceRasterRender (bool forceRaster) |
Sets whether the renderer should be rendered to a raster destination. More... | |
void | setOrderBy (const QgsFeatureRequest::OrderBy &orderBy) |
Define the order in which features shall be processed by this renderer. More... | |
void | setOrderByEnabled (bool enabled) |
Sets whether custom ordering should be applied before features are processed by this renderer. More... | |
void | setPaintEffect (QgsPaintEffect *effect) |
Sets the current paint effect for the renderer. More... | |
void | setUsingSymbolLevels (bool usingSymbolLevels) |
void | setVertexMarkerAppearance (int type, int size) |
Sets type and size of editing vertex markers for subsequent rendering. More... | |
virtual QgsSymbolList | symbolsForFeature (const QgsFeature &feature, QgsRenderContext &context) const |
Returns list of symbols used for rendering the feature. More... | |
QString | type () const |
bool | usingSymbolLevels () const |
virtual bool | willRenderFeature (const QgsFeature &feature, QgsRenderContext &context) const |
Returns whether the renderer will render a feature or not. More... | |
virtual QDomElement | writeSld (QDomDocument &doc, const QString &styleName, const QgsStringMap &props=QgsStringMap()) const |
create the SLD UserStyle element following the SLD v1.1 specs with the given name More... | |
Static Public Member Functions | |
static QgsGraduatedSymbolRenderer * | convertFromRenderer (const QgsFeatureRenderer *renderer) |
creates a QgsGraduatedSymbolRenderer from an existing renderer. More... | |
static QgsFeatureRenderer * | create (QDomElement &element, const QgsReadWriteContext &context) |
create renderer from XML element More... | |
static QgsGraduatedSymbolRenderer * | createRenderer (QgsVectorLayer *vlayer, const QString &attrName, int classes, Mode mode, QgsSymbol *symbol, QgsColorRamp *ramp, const QgsRendererRangeLabelFormat &legendFormat=QgsRendererRangeLabelFormat()) |
Creates a new graduated renderer. More... | |
Static Public Member Functions inherited from QgsFeatureRenderer | |
static QgsFeatureRenderer * | defaultRenderer (QgsWkbTypes::GeometryType geomType) |
Returns a new renderer - used by default in vector layers. More... | |
static QgsFeatureRenderer * | load (QDomElement &symbologyElem, const QgsReadWriteContext &context) |
create a renderer from XML element More... | |
static QgsFeatureRenderer * | loadSld (const QDomNode &node, QgsWkbTypes::GeometryType geomType, QString &errorMessage) |
Create a new renderer according to the information contained in the UserStyle element of a SLD style document. More... | |
Protected Member Functions | |
QString | legendKeyForValue (double value) const |
Returns the matching legend key for a value. More... | |
QgsSymbol * | symbolForValue (double value) const |
Gets the symbol which is used to represent value. More... | |
Protected Member Functions inherited from QgsFeatureRenderer | |
QgsFeatureRenderer (const QString &type) | |
void | copyRendererData (QgsFeatureRenderer *destRenderer) const |
Clones generic renderer data to another renderer. More... | |
void | renderFeatureWithSymbol (const QgsFeature &feature, QgsSymbol *symbol, QgsRenderContext &context, int layer, bool selected, bool drawVertexMarker) |
Render the feature with the symbol using context. More... | |
void | renderVertexMarker (QPointF pt, QgsRenderContext &context) |
render editing vertex marker at specified point More... | |
void | renderVertexMarkerPolygon (QPolygonF &pts, QList< QPolygonF > *rings, QgsRenderContext &context) |
render editing vertex marker for a polygon More... | |
void | renderVertexMarkerPolyline (QPolygonF &pts, QgsRenderContext &context) |
render editing vertex marker for a polyline More... | |
Static Protected Member Functions | |
static const char * | graduatedMethodStr (GraduatedMethod method) |
Static Protected Member Functions inherited from QgsFeatureRenderer | |
static QPointF | _getPoint (QgsRenderContext &context, const QgsPoint &point) |
Creates a point in screen coordinates from a wkb string in map coordinates. More... | |
static void | convertSymbolRotation (QgsSymbol *symbol, const QString &field) |
static void | convertSymbolSizeScale (QgsSymbol *symbol, QgsSymbol::ScaleMethod method, const QString &field) |
Protected Attributes | |
QString | mAttrName |
int | mAttrNum = -1 |
attribute index (derived from attribute name in startRender) More... | |
bool | mCounting = false |
std::unique_ptr< QgsDataDefinedSizeLegend > | mDataDefinedSizeLegend |
std::unique_ptr< QgsExpression > | mExpression |
GraduatedMethod | mGraduatedMethod = GraduatedColor |
QgsRendererRangeLabelFormat | mLabelFormat |
Mode | mMode = Custom |
QgsRangeList | mRanges |
std::unique_ptr< QgsColorRamp > | mSourceColorRamp |
std::unique_ptr< QgsSymbol > | mSourceSymbol |
Protected Attributes inherited from QgsFeatureRenderer | |
int | mCurrentVertexMarkerSize |
The current size of editing marker. More... | |
int | mCurrentVertexMarkerType |
The current type of editing marker. More... | |
bool | mForceRaster |
QgsFeatureRequest::OrderBy | mOrderBy |
bool | mOrderByEnabled |
QgsPaintEffect * | mPaintEffect = nullptr |
QString | mType |
bool | mUsingSymbolLevels |
Definition at line 142 of file qgsgraduatedsymbolrenderer.h.
Enumerator | |
---|---|
GraduatedColor | |
GraduatedSize |
Definition at line 345 of file qgsgraduatedsymbolrenderer.h.
Enumerator | |
---|---|
EqualInterval | |
Quantile | |
Jenks | |
StdDev | |
Pretty | |
Custom |
Definition at line 212 of file qgsgraduatedsymbolrenderer.h.
QgsGraduatedSymbolRenderer::QgsGraduatedSymbolRenderer | ( | const QString & | attrName = QString() , |
const QgsRangeList & | ranges = QgsRangeList() |
||
) |
Definition at line 278 of file qgsgraduatedsymbolrenderer.cpp.
|
override |
Definition at line 294 of file qgsgraduatedsymbolrenderer.cpp.
void QgsGraduatedSymbolRenderer::addBreak | ( | double | breakValue, |
bool | updateSymbols = true |
||
) |
Add a breakpoint by splitting existing classes so that the specified value becomes a break between two classes.
breakValue | position to insert break |
updateSymbols | set to true to reapply ramp colors to the new symbol ranges |
Definition at line 1378 of file qgsgraduatedsymbolrenderer.cpp.
void QgsGraduatedSymbolRenderer::addClass | ( | QgsSymbol * | symbol | ) |
Definition at line 1364 of file qgsgraduatedsymbolrenderer.cpp.
void QgsGraduatedSymbolRenderer::addClass | ( | const QgsRendererRange & | range | ) |
Definition at line 1417 of file qgsgraduatedsymbolrenderer.cpp.
void QgsGraduatedSymbolRenderer::addClass | ( | double | lower, |
double | upper | ||
) |
Definition at line 1371 of file qgsgraduatedsymbolrenderer.cpp.
void QgsGraduatedSymbolRenderer::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 1445 of file qgsgraduatedsymbolrenderer.cpp.
|
inlineoverridevirtual |
Returns details about internals of this renderer.
E.g. if you only want to deal with visible features:
Reimplemented from QgsFeatureRenderer.
Definition at line 158 of file qgsgraduatedsymbolrenderer.h.
|
overridevirtual |
item in symbology was checked
Reimplemented from QgsFeatureRenderer.
Definition at line 1346 of file qgsgraduatedsymbolrenderer.cpp.
|
inline |
Definition at line 161 of file qgsgraduatedsymbolrenderer.h.
|
overridevirtual |
Create a deep copy of this renderer.
Should be implemented by all subclasses and generate a proper subclass.
Implements QgsFeatureRenderer.
Definition at line 483 of file qgsgraduatedsymbolrenderer.cpp.
|
static |
creates a QgsGraduatedSymbolRenderer from an existing renderer.
Definition at line 1575 of file qgsgraduatedsymbolrenderer.cpp.
|
static |
create renderer from XML element
Definition at line 907 of file qgsgraduatedsymbolrenderer.cpp.
|
static |
Creates a new graduated renderer.
vlayer | vector layer |
attrName | attribute to classify |
classes | number of classes |
mode | classification mode |
symbol | base symbol |
ramp | color ramp for classes |
legendFormat |
Definition at line 773 of file qgsgraduatedsymbolrenderer.cpp.
QgsDataDefinedSizeLegend * QgsGraduatedSymbolRenderer::dataDefinedSizeLegend | ( | ) | const |
Returns configuration of appearance of legend when using data-defined size for marker symbols.
Will return null if the functionality is disabled.
Definition at line 1620 of file qgsgraduatedsymbolrenderer.cpp.
void QgsGraduatedSymbolRenderer::deleteAllClasses | ( | ) |
Definition at line 1427 of file qgsgraduatedsymbolrenderer.cpp.
void QgsGraduatedSymbolRenderer::deleteClass | ( | int | idx | ) |
Definition at line 1422 of file qgsgraduatedsymbolrenderer.cpp.
|
overridevirtual |
Returns debug information about this renderer.
Reimplemented from QgsFeatureRenderer.
Definition at line 475 of file qgsgraduatedsymbolrenderer.cpp.
|
inline |
Returns the method used for graduation (either size or color)
Definition at line 355 of file qgsgraduatedsymbolrenderer.h.
|
staticprotected |
Definition at line 1625 of file qgsgraduatedsymbolrenderer.cpp.
|
inline |
Returns the label format used to generate default classification labels.
Definition at line 238 of file qgsgraduatedsymbolrenderer.h.
|
inlineoverridevirtual |
If supported by the renderer, return classification attribute for the use in legend.
Reimplemented from QgsFeatureRenderer.
Definition at line 367 of file qgsgraduatedsymbolrenderer.h.
|
protected |
Returns the matching legend key for a value.
Definition at line 315 of file qgsgraduatedsymbolrenderer.cpp.
|
overridevirtual |
Returns legend keys matching a specified feature.
Reimplemented from QgsFeatureRenderer.
Definition at line 1193 of file qgsgraduatedsymbolrenderer.cpp.
|
overridevirtual |
items of symbology items in legend is checked
Reimplemented from QgsFeatureRenderer.
Definition at line 1336 of file qgsgraduatedsymbolrenderer.cpp.
|
overridevirtual |
Returns a list of symbology items for the legend.
Reimplemented from QgsFeatureRenderer.
Definition at line 1153 of file qgsgraduatedsymbolrenderer.cpp.
|
overridevirtual |
items of symbology items in legend should be checkable
Reimplemented from QgsFeatureRenderer.
Definition at line 1331 of file qgsgraduatedsymbolrenderer.cpp.
double QgsGraduatedSymbolRenderer::maxSymbolSize | ( | ) | const |
Returns the max symbol size when graduated by size.
Definition at line 1246 of file qgsgraduatedsymbolrenderer.cpp.
double QgsGraduatedSymbolRenderer::minSymbolSize | ( | ) | const |
Returns the min symbol size when graduated by size.
Definition at line 1231 of file qgsgraduatedsymbolrenderer.cpp.
|
inline |
Definition at line 222 of file qgsgraduatedsymbolrenderer.h.
void QgsGraduatedSymbolRenderer::moveClass | ( | int | from, |
int | to | ||
) |
Moves the category at index position from to index position to.
Definition at line 1474 of file qgsgraduatedsymbolrenderer.cpp.
|
overridevirtual |
Returns 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 QgsFeatureRenderer.
Definition at line 354 of file qgsgraduatedsymbolrenderer.cpp.
|
inline |
Definition at line 164 of file qgsgraduatedsymbolrenderer.h.
bool QgsGraduatedSymbolRenderer::rangesHaveGaps | ( | ) | const |
Tests whether classes assigned to the renderer have gaps between the ranges.
Definition at line 1531 of file qgsgraduatedsymbolrenderer.cpp.
bool QgsGraduatedSymbolRenderer::rangesOverlap | ( | ) | const |
Tests whether classes assigned to the renderer have ranges which overlap.
Definition at line 1503 of file qgsgraduatedsymbolrenderer.cpp.
|
overridevirtual |
store renderer info to XML element
Reimplemented from QgsFeatureRenderer.
Definition at line 1040 of file qgsgraduatedsymbolrenderer.cpp.
|
inline |
Definition at line 162 of file qgsgraduatedsymbolrenderer.h.
void QgsGraduatedSymbolRenderer::setDataDefinedSizeLegend | ( | QgsDataDefinedSizeLegend * | settings | ) |
Configures appearance of legend when renderer is configured to use data-defined size for marker symbols.
This allows configuring for which values (symbol sizes) should be shown in the legend, whether to display different symbol sizes collapsed in one legend node or separated across multiple legend nodes etc.
When renderer does not use data-defined size or does not use marker symbols, these settings will be ignored. Takes ownership of the passed settings objects. Null pointer is a valid input that disables data-defined size legend.
Definition at line 1615 of file qgsgraduatedsymbolrenderer.cpp.
|
inline |
set the method used for graduation (either size or color)
Definition at line 361 of file qgsgraduatedsymbolrenderer.h.
void QgsGraduatedSymbolRenderer::setLabelFormat | ( | const QgsRendererRangeLabelFormat & | 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 1432 of file qgsgraduatedsymbolrenderer.cpp.
|
overridevirtual |
Sets the symbol to be used for a legend symbol item.
key | rule key for legend symbol |
symbol | new symbol for legend item. Ownership is transferred to renderer. |
Reimplemented from QgsFeatureRenderer.
Definition at line 1354 of file qgsgraduatedsymbolrenderer.cpp.
|
inline |
Definition at line 223 of file qgsgraduatedsymbolrenderer.h.
void QgsGraduatedSymbolRenderer::setSourceColorRamp | ( | QgsColorRamp * | ramp | ) |
Sets the source color ramp.
ramp | color ramp. Ownership is transferred to the renderer |
Definition at line 1223 of file qgsgraduatedsymbolrenderer.cpp.
void QgsGraduatedSymbolRenderer::setSourceSymbol | ( | QgsSymbol * | sym | ) |
Sets the source symbol for the renderer, which is the base symbol used for the each classes' symbol before applying the classes' color.
sym | source symbol, ownership is transferred to the renderer |
Definition at line 1213 of file qgsgraduatedsymbolrenderer.cpp.
void QgsGraduatedSymbolRenderer::setSymbolSizes | ( | double | minSize, |
double | maxSize | ||
) |
set varying symbol size for classes
Definition at line 1261 of file qgsgraduatedsymbolrenderer.cpp.
void QgsGraduatedSymbolRenderer::sortByLabel | ( | Qt::SortOrder | order = Qt::AscendingOrder | ) |
Definition at line 1563 of file qgsgraduatedsymbolrenderer.cpp.
void QgsGraduatedSymbolRenderer::sortByValue | ( | Qt::SortOrder | order = Qt::AscendingOrder | ) |
Definition at line 1491 of file qgsgraduatedsymbolrenderer.cpp.
QgsColorRamp * QgsGraduatedSymbolRenderer::sourceColorRamp | ( | ) |
Returns the source color ramp, from which each classes' color is derived.
Definition at line 1218 of file qgsgraduatedsymbolrenderer.cpp.
QgsSymbol * QgsGraduatedSymbolRenderer::sourceSymbol | ( | ) |
Returns the renderer's source symbol, which is the base symbol used for the each classes' symbol before applying the classes' color.
Definition at line 1209 of file qgsgraduatedsymbolrenderer.cpp.
|
overridevirtual |
Must be called when a new render cycle is started.
A call to startRender() must always be followed by a corresponding call to stopRender() after all features have been rendered.
context | Additional information passed to the renderer about the job which will be rendered |
fields | The fields available for rendering |
Reimplemented from QgsFeatureRenderer.
Definition at line 366 of file qgsgraduatedsymbolrenderer.cpp.
|
overridevirtual |
Must be called when a render cycle has finished, to allow the renderer to clean up.
Calls to stopRender() must always be preceded by a call to startRender().
Reimplemented from QgsFeatureRenderer.
Definition at line 390 of file qgsgraduatedsymbolrenderer.cpp.
|
overridevirtual |
To be overridden.
Must be called between startRender() and stopRender() calls.
feature | feature |
context | render context |
Implements QgsFeatureRenderer.
Definition at line 333 of file qgsgraduatedsymbolrenderer.cpp.
|
protected |
Gets the symbol which is used to represent value.
Definition at line 299 of file qgsgraduatedsymbolrenderer.cpp.
|
overridevirtual |
Returns list of symbols used by the renderer.
context | render context |
Reimplemented from QgsFeatureRenderer.
Definition at line 516 of file qgsgraduatedsymbolrenderer.cpp.
|
overridevirtual |
used from subclasses to create SLD Rule elements following SLD v1.1 specs
Reimplemented from QgsFeatureRenderer.
Definition at line 501 of file qgsgraduatedsymbolrenderer.cpp.
void QgsGraduatedSymbolRenderer::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 793 of file qgsgraduatedsymbolrenderer.cpp.
void QgsGraduatedSymbolRenderer::updateColorRamp | ( | QgsColorRamp * | ramp = nullptr | ) |
Update the color ramp used.
Also updates all symbols colors. Doesn't alter current breaks.
ramp | color ramp. Ownership is transferred to the renderer |
Definition at line 1277 of file qgsgraduatedsymbolrenderer.cpp.
bool QgsGraduatedSymbolRenderer::updateRangeLabel | ( | int | rangeIndex, |
const QString & | label | ||
) |
Definition at line 437 of file qgsgraduatedsymbolrenderer.cpp.
bool QgsGraduatedSymbolRenderer::updateRangeLowerValue | ( | int | rangeIndex, |
double | value | ||
) |
Definition at line 456 of file qgsgraduatedsymbolrenderer.cpp.
bool QgsGraduatedSymbolRenderer::updateRangeRenderState | ( | int | rangeIndex, |
bool | render | ||
) |
Definition at line 467 of file qgsgraduatedsymbolrenderer.cpp.
bool QgsGraduatedSymbolRenderer::updateRangeSymbol | ( | int | rangeIndex, |
QgsSymbol * | symbol | ||
) |
Definition at line 429 of file qgsgraduatedsymbolrenderer.cpp.
bool QgsGraduatedSymbolRenderer::updateRangeUpperValue | ( | int | rangeIndex, |
double | value | ||
) |
Definition at line 445 of file qgsgraduatedsymbolrenderer.cpp.
void QgsGraduatedSymbolRenderer::updateSymbols | ( | QgsSymbol * | sym | ) |
Update all the symbols but leave breaks and colors.
This method also sets the source symbol for the renderer.
sym | source symbol to use for classes. Ownership is not transferred. |
Definition at line 1303 of file qgsgraduatedsymbolrenderer.cpp.
|
overridevirtual |
Returns a list of attributes required by this renderer.
Attributes not listed in here may not have been requested from the provider at rendering time.
Implements QgsFeatureRenderer.
Definition at line 403 of file qgsgraduatedsymbolrenderer.cpp.
|
protected |
Definition at line 396 of file qgsgraduatedsymbolrenderer.h.
|
protected |
attribute index (derived from attribute name in startRender)
Definition at line 406 of file qgsgraduatedsymbolrenderer.h.
|
protected |
Definition at line 407 of file qgsgraduatedsymbolrenderer.h.
|
protected |
Definition at line 409 of file qgsgraduatedsymbolrenderer.h.
|
protected |
Definition at line 403 of file qgsgraduatedsymbolrenderer.h.
|
protected |
Definition at line 404 of file qgsgraduatedsymbolrenderer.h.
|
protected |
Definition at line 401 of file qgsgraduatedsymbolrenderer.h.
Definition at line 398 of file qgsgraduatedsymbolrenderer.h.
|
protected |
Definition at line 397 of file qgsgraduatedsymbolrenderer.h.
|
protected |
Definition at line 400 of file qgsgraduatedsymbolrenderer.h.
|
protected |
Definition at line 399 of file qgsgraduatedsymbolrenderer.h.