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 );
101 void setSymbol(
QgsSymbol *s SIP_TRANSFER );
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;
171 QString
dump()
const override;
195 int categoryIndexForValue(
const QVariant &val );
201 int categoryIndexForLabel(
const QString &val );
212 bool updateCategoryValue(
int catIndex,
const QVariant &value );
235 bool updateCategoryLabel(
int catIndex,
const QString &label );
249 bool updateCategoryRenderState(
int catIndex,
bool render );
263 bool deleteCategory(
int catIndex );
270 void deleteAllCategories();
275 void moveCategory(
int from,
int to );
282 void sortByValue( Qt::SortOrder order = Qt::AscendingOrder );
289 void sortByLabel( Qt::SortOrder order = Qt::AscendingOrder );
342 void setSourceSymbol(
QgsSymbol *sym SIP_TRANSFER );
365 void setSourceColorRamp(
QgsColorRamp *ramp SIP_TRANSFER );
372 void updateColorRamp(
QgsColorRamp *ramp SIP_TRANSFER );
424 QVariantList &unmatchedCategories
SIP_OUT, QStringList &unmatchedSymbols SIP_OUT,
bool caseSensitive =
true,
bool useTolerantMatch =
false );
453 bool mCounting =
false;
483 QgsSymbol *symbolForValue( const QVariant &value,
bool &foundMatchingSymbol SIP_OUT ) const
SIP_PYNAME( symbolForValue2 );
498 #endif // QGSCATEGORIZEDSYMBOLRENDERER_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
Represents an individual category (class) from a QgsCategorizedSymbolRenderer.
Abstract base class for all rendered symbols.
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
Returns the class attribute for the renderer, which is the field name or expression string from the l...
Container of fields for a vector layer.
The feature class encapsulates a single feature including its id, geometry and a list of field/values...
An interface for classes which can visit style entity (e.g.
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
SymbolType
Type of the symbol.
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
Returns a list of all categories recognized by the renderer.
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)
Sets the class attribute for the renderer, which is the field name or expression string from the laye...
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.
virtual bool accept(QgsStyleEntityVisitorInterface *visitor) const
Accepts the specified symbology visitor, causing it to visit all symbols associated with the renderer...
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
virtual bool filterNeedsGeometry() const
Returns true if this renderer requires the geometry to apply the filter.
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.