15 #ifndef QGSCATEGORIZEDSYMBOLRENDERERV2_H 16 #define QGSCATEGORIZEDSYMBOLRENDERERV2_H 18 #include "qgis_core.h" 51 QVariant value()
const;
53 QString label()
const;
55 void setValue(
const QVariant &value );
56 void setSymbol(
QgsSymbol *s SIP_TRANSFER );
57 void setLabel(
const QString &label );
64 bool renderState()
const;
71 void setRenderState(
bool render );
76 void toSld( QDomDocument &doc, QDomElement &element,
QgsStringMap props )
const;
104 QString
dump()
const override;
122 int categoryIndexForValue(
const QVariant &val );
128 int categoryIndexForLabel(
const QString &val );
130 bool updateCategoryValue(
int catIndex,
const QVariant &value );
132 bool updateCategoryLabel(
int catIndex,
const QString &label );
135 bool updateCategoryRenderState(
int catIndex,
bool render );
138 bool deleteCategory(
int catIndex );
139 void deleteAllCategories();
142 void moveCategory(
int from,
int to );
144 void sortByValue( Qt::SortOrder order = Qt::AscendingOrder );
145 void sortByLabel( Qt::SortOrder order = Qt::AscendingOrder );
172 void setSourceSymbol(
QgsSymbol *sym SIP_TRANSFER );
187 void setSourceColorRamp(
QgsColorRamp *ramp SIP_TRANSFER );
194 void updateColorRamp(
QgsColorRamp *ramp SIP_TRANSFER );
242 bool mCounting =
false;
287 #endif // QGSCATEGORIZEDSYMBOLRENDERERV2_H The class is used as a container of context for various read/write operations on other objects...
virtual QgsLegendSymbolList legendSymbolItems() const
Returns a list of symbology items for the legend.
QList< QgsLegendSymbolItem > QgsLegendSymbolList
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
Features may be filtered, i.e. some features may not be rendered (categorized, rule based ...
virtual QDomElement save(QDomDocument &doc, const QgsReadWriteContext &context)
store renderer info to XML element
Abstract base class for color ramps.
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...
QString classAttribute() const
Container of fields for a vector layer.
The feature class encapsulates a single feature including its id, geometry and a list of field/values...
std::unique_ptr< QgsSymbol > mSourceSymbol
QMap< QString, QString > QgsStringMap
virtual QgsSymbol * symbolForFeature(const QgsFeature &feature, QgsRenderContext &context) const =0
To be overridden.
QList< QgsRendererCategory > QgsCategoryList
virtual QSet< QString > usedAttributes(const QgsRenderContext &context) const =0
Returns a list of attributes required by this renderer.
QList< QgsSymbol * > QgsSymbolList
const QgsCategoryList & categories() const
std::unique_ptr< QgsSymbol > mSymbol
QgsCategoryList mCategories
virtual QgsSymbol * originalSymbolForFeature(const QgsFeature &feature, QgsRenderContext &context) const
Returns symbol for feature.
void setClassAttribute(const QString &attr)
virtual bool legendSymbolItemChecked(const QString &key)
items of symbology items in legend is checked
virtual void checkLegendSymbolItem(const QString &key, bool state=true)
item in symbology was checked
virtual void setLegendSymbolItem(const QString &key, QgsSymbol *symbol)
Sets the symbol to be used for a legend symbol item.
Contains information about the context of a rendering operation.
virtual QgsSymbolList symbols(QgsRenderContext &context) const
Returns list of symbols used by the renderer.
virtual void startRender(QgsRenderContext &context, const QgsFields &fields)
Must be called when a new render cycle is started.
std::unique_ptr< QgsColorRamp > mSourceColorRamp
QString legendClassificationAttribute() const override
If supported by the renderer, return classification attribute for the use in legend.
virtual void stopRender(QgsRenderContext &context)
Must be called when a render cycle has finished, to allow the renderer to clean up.
virtual QSet< QString > legendKeysForFeature(const QgsFeature &feature, QgsRenderContext &context) const
Returns legend keys matching a specified feature.
QHash< QString, QgsSymbol * > mSymbolHash
hashtable for faster access to symbols
virtual bool legendSymbolItemsCheckable() const
items of symbology items in legend should be checkable
Represents a vector layer which manages a vector based data sets.
Object that keeps configuration of appearance of marker symbol's data-defined size in legend...
std::unique_ptr< QgsExpression > mExpression
QgsFeatureRenderer::Capabilities capabilities() override
Returns details about internals of this renderer.
virtual QgsFeatureRenderer * clone() const =0
Create a deep copy of this renderer.
std::unique_ptr< QgsDataDefinedSizeLegend > mDataDefinedSizeLegend
virtual QString dump() const
Returns debug information about this renderer.