15 #ifndef QGSCATEGORIZEDSYMBOLRENDERERV2_H 16 #define QGSCATEGORIZEDSYMBOLRENDERERV2_H 18 #include "qgis_core.h" 65 QVariant value()
const;
78 QString label()
const;
84 void setValue(
const QVariant &value );
93 void setSymbol(
QgsSymbol *s SIP_TRANSFER );
100 void setLabel(
const QString &label );
107 bool renderState()
const;
114 void setRenderState(
bool render );
121 QString dump()
const;
126 void toSld( QDomDocument &doc, QDomElement &element,
QgsStringMap props )
const;
163 QString
dump()
const override;
186 int categoryIndexForValue(
const QVariant &val );
192 int categoryIndexForLabel(
const QString &val );
201 bool updateCategoryValue(
int catIndex,
const QVariant &value );
224 bool updateCategoryLabel(
int catIndex,
const QString &label );
238 bool updateCategoryRenderState(
int catIndex,
bool render );
252 bool deleteCategory(
int catIndex );
259 void deleteAllCategories();
264 void moveCategory(
int from,
int to );
271 void sortByValue( Qt::SortOrder order = Qt::AscendingOrder );
278 void sortByLabel( Qt::SortOrder order = Qt::AscendingOrder );
322 void setSourceSymbol(
QgsSymbol *sym SIP_TRANSFER );
337 void setSourceColorRamp(
QgsColorRamp *ramp SIP_TRANSFER );
344 void updateColorRamp(
QgsColorRamp *ramp SIP_TRANSFER );
396 QVariantList &unmatchedCategories
SIP_OUT, QStringList &unmatchedSymbols SIP_OUT,
bool caseSensitive =
true,
bool useTolerantMatch =
false );
412 bool mCounting =
false;
442 QgsSymbol *symbolForValue( const QVariant &value,
bool &foundMatchingSymbol SIP_OUT ) const
SIP_PYNAME( symbolForValue2 );
457 #endif // QGSCATEGORIZEDSYMBOLRENDERERV2_H The class is used as a container of context for various read/write operations on other objects...
QList< QgsLegendSymbolItem > QgsLegendSymbolList
Represents an individual category (class) from a QgsCategorizedSymbolRenderer.
Abstract base class for all rendered symbols.
virtual bool legendSymbolItemsCheckable() const
items of symbology items in legend should be checkable
Features may be filtered, i.e. some features may not be rendered (categorized, rule based ...
virtual QgsSymbolList symbols(QgsRenderContext &context) const
Returns list of symbols used by the renderer.
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...
virtual QgsLegendSymbolList legendSymbolItems() const
Returns a list of symbology items for the legend.
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
virtual QgsSymbol * originalSymbolForFeature(const QgsFeature &feature, QgsRenderContext &context) const
Returns symbol for feature.
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.
const QgsCategoryList & categories() const
Returns a list of all categories recognized by the renderer.
virtual QSet< QString > usedAttributes(const QgsRenderContext &context) const =0
Returns a list of attributes required by this renderer.
QList< QgsSymbol * > QgsSymbolList
std::unique_ptr< QgsSymbol > mSymbol
QgsCategoryList mCategories
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 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 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.
QString classAttribute() const
Returns the class attribute for the renderer, which is the field name or expression string from the l...
Contains information about the context of a rendering operation.
virtual QString dump() const
Returns debug information about this 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.
QHash< QString, QgsSymbol * > mSymbolHash
hashtable for faster access to symbols
virtual QSet< QString > legendKeysForFeature(const QgsFeature &feature, QgsRenderContext &context) const
Returns legend keys matching a specified feature.
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