QGIS API Documentation
3.14.0-Pi (9f7028fd23)
|
Go to the documentation of this file.
15 #ifndef QGSCATEGORIZEDSYMBOLRENDERER_H
16 #define QGSCATEGORIZEDSYMBOLRENDERER_H
18 #include "qgis_core.h"
70 QVariant value()
const;
83 QString label()
const;
92 void setValue(
const QVariant &value );
108 void setLabel(
const QString &label );
115 bool renderState()
const;
122 void setRenderState(
bool render );
129 QString dump()
const;
134 void toSld( QDomDocument &doc, QDomElement &element,
QgsStringMap props )
const;
172 QString
dump()
const override;
196 int categoryIndexForValue(
const QVariant &val );
202 int categoryIndexForLabel(
const QString &val );
213 bool updateCategoryValue(
int catIndex,
const QVariant &value );
236 bool updateCategoryLabel(
int catIndex,
const QString &label );
250 bool updateCategoryRenderState(
int catIndex,
bool render );
264 bool deleteCategory(
int catIndex );
271 void deleteAllCategories();
276 void moveCategory(
int from,
int to );
283 void sortByValue( Qt::SortOrder order = Qt::AscendingOrder );
290 void sortByLabel( Qt::SortOrder order = Qt::AscendingOrder );
375 bool legendSymbolItemsCheckable() const override;
376 bool legendSymbolItemChecked( const QString &key ) override;
378 void checkLegendSymbolItem( const QString &key,
bool state = true ) override;
379 QString legendClassificationAttribute()
const override {
return classAttribute(); }
425 QVariantList &unmatchedCategories
SIP_OUT, QStringList &unmatchedSymbols
SIP_OUT,
bool caseSensitive =
true,
bool useTolerantMatch =
false );
454 bool mCounting =
false;
499 #endif // QGSCATEGORIZEDSYMBOLRENDERER_H
Abstract base class for color ramps.
@ Filter
Features may be filtered, i.e. some features may not be rendered (categorized, rule based ....
virtual QgsSymbol * originalSymbolForFeature(const QgsFeature &feature, QgsRenderContext &context) const
Returns symbol for feature.
virtual bool accept(QgsStyleEntityVisitorInterface *visitor) const
Accepts the specified symbology visitor, causing it to visit all symbols associated with the renderer...
std::unique_ptr< QgsColorRamp > mSourceColorRamp
const QgsCategoryList & categories() const
Returns a list of all categories recognized by the renderer.
Represents an individual category (class) from a QgsCategorizedSymbolRenderer.
virtual QSet< QString > usedAttributes(const QgsRenderContext &context) const =0
Returns a list of attributes required by this renderer.
virtual QgsLegendSymbolList legendSymbolItems() const
Returns a list of symbology items for the legend.
std::unique_ptr< QgsDataDefinedSizeLegend > mDataDefinedSizeLegend
void setClassAttribute(const QString &attr)
Sets the class attribute for the renderer, which is the field name or expression string from the laye...
virtual void toSld(QDomDocument &doc, QDomElement &element, const QgsStringMap &props=QgsStringMap()) const
used from subclasses to create SLD Rule elements following SLD v1.1 specs
virtual void stopRender(QgsRenderContext &context)
Must be called when a render cycle has finished, to allow the renderer to clean up.
virtual QString filter(const QgsFields &fields=QgsFields())
If a renderer does not require all the features this method may be overridden and return an expressio...
virtual QDomElement save(QDomDocument &doc, const QgsReadWriteContext &context)
store renderer info to XML element
virtual bool filterNeedsGeometry() const
Returns true if this renderer requires the geometry to apply the filter.
QList< QgsRendererCategory > QgsCategoryList
QList< QgsSymbol * > QgsSymbolList
virtual QgsFeatureRenderer * clone() const =0
Create a deep copy of this renderer.
virtual QgsSymbolList symbols(QgsRenderContext &context) const
Returns list of symbols used by the renderer.
std::unique_ptr< QgsSymbol > mSourceSymbol
virtual QgsSymbol * symbolForFeature(const QgsFeature &feature, QgsRenderContext &context) const =0
To be overridden.
std::unique_ptr< QgsExpression > mExpression
QHash< QString, QgsSymbol * > mSymbolHash
hashtable for faster access to symbols
QgsFeatureRenderer::Capabilities capabilities() override
Returns details about internals of this renderer.
QMap< QString, QString > QgsStringMap
QgsCategoryList mCategories
virtual QString dump() const
Returns debug information about this renderer.
SymbolType
Type of the symbol.
QList< QgsLegendSymbolItem > QgsLegendSymbolList
virtual void startRender(QgsRenderContext &context, const QgsFields &fields)
Must be called when a new render cycle is started.
QString classAttribute() const
Returns the class attribute for the renderer, which is the field name or expression string from the l...
virtual QSet< QString > legendKeysForFeature(const QgsFeature &feature, QgsRenderContext &context) const
Returns legend keys matching a specified feature.
std::unique_ptr< QgsSymbol > mSymbol