15 #ifndef QGSCATEGORIZEDSYMBOLRENDERERV2_H 16 #define QGSCATEGORIZEDSYMBOLRENDERERV2_H 23 #include <QScopedPointer> 50 void setValue(
const QVariant &value );
52 void setLabel(
const QString &label );
55 bool renderState()
const;
56 void setRenderState(
bool render );
130 int categoryIndexForValue(
const QVariant& val );
134 int categoryIndexForLabel(
const QString& val );
136 bool updateCategoryValue(
int catIndex,
const QVariant &value );
137 bool updateCategorySymbol(
int catIndex,
QgsSymbolV2* symbol );
138 bool updateCategoryLabel(
int catIndex,
const QString& label );
141 bool updateCategoryRenderState(
int catIndex,
bool render );
144 bool deleteCategory(
int catIndex );
145 void deleteAllCategories();
148 void moveCategory(
int from,
int to );
150 void sortByValue( Qt::SortOrder order = Qt::AscendingOrder );
151 void sortByLabel( Qt::SortOrder order = Qt::AscendingOrder );
216 void setSizeScaleField(
const QString& fieldOrExpression );
217 QString sizeScaleField()
const;
281 #endif // QGSCATEGORIZEDSYMBOLRENDERERV2_H const QgsCategoryList & categories() const
virtual Q_DECL_DEPRECATED QString rotationField() const
return rotation field name (or empty string if not set or not supported by renderer) ...
QgsSymbolV2::ScaleMethod mScaleMethod
virtual QSet< QString > legendKeysForFeature(QgsFeature &feature, QgsRenderContext &context)
Return legend keys matching a specified feature.
virtual Q_DECL_DEPRECATED QgsSymbolV2 * originalSymbolForFeature(QgsFeature &feature)
Return symbol for feature.
virtual QDomElement save(QDomDocument &doc)
store renderer info to XML element
QScopedPointer< QgsSymbolV2 > mSourceSymbol
#define Q_NOWARN_DEPRECATED_PUSH
QScopedPointer< QgsExpression > mRotation
Container of fields for a vector layer.
virtual QgsLegendSymbolListV2 legendSymbolItemsV2() const
Return a list of symbology items for the legend.
virtual int capabilities() override
returns bitwise OR-ed capabilities of the renderer
virtual QList< QString > usedAttributes()=0
Returns a set of attributes required for this renderer.
The feature class encapsulates a single feature including its id, geometry and a list of field/values...
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 void toSld(QDomDocument &doc, QDomElement &element) const
used from subclasses to create SLD Rule elements following SLD v1.1 specs
QScopedPointer< QgsSymbolV2 > mSymbol
virtual bool legendSymbolItemChecked(const QString &key)
items of symbology items in legend is checked
void setClassAttribute(const QString &attr)
virtual void checkLegendSymbolItem(const QString &key, bool state=true)
item in symbology was checked
virtual QgsLegendSymbologyList legendSymbologyItems(QSize iconSize)
return a list of symbology items for the legend
QHash< QString, QgsSymbolV2 * > mSymbolHash
hashtable for faster access to symbols
virtual void startRender(QgsRenderContext &context, const QgsFields &fields)=0
Needs to be called when a new render cycle is started.
QScopedPointer< QgsExpression > mSizeScale
QgsCategoryList mCategories
virtual void stopRender(QgsRenderContext &context)=0
Needs to be called when a render cycle has finished to clean up.
QgsSymbolV2::ScaleMethod scaleMethod() const
virtual QgsFeatureRendererV2 * clone() const =0
QList< QgsRendererCategoryV2 > QgsCategoryList
virtual Q_DECL_DEPRECATED QgsSymbolV2 * symbolForFeature(QgsFeature &feature)
To be overridden.
virtual QString dump() const
for debugging
QScopedPointer< QgsVectorColorRampV2 > mSourceColorRamp
virtual QgsLegendSymbolList legendSymbolItems(double scaleDenominator=-1, const QString &rule="")
return a list of item text / symbol
QString classAttribute() const
virtual Q_DECL_DEPRECATED QgsSymbolV2List symbols()
For symbol levels.
QHash< QgsSymbolV2 *, QgsSymbolV2 * > mTempSymbols
temporary symbols, used for data-defined rotation and scaling
#define Q_NOWARN_DEPRECATED_POP
Contains information about the context of a rendering operation.
int mAttrNum
attribute index (derived from attribute name in startRender)
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 Q_DECL_DEPRECATED void setRotationField(const QString &fieldName)
sets rotation field of renderer (if supported by the renderer)
Represents a vector layer which manages a vector based data sets.
Abstract base class for color ramps.
virtual void setLegendSymbolItem(const QString &key, QgsSymbolV2 *symbol)
Sets the symbol to be used for a legend symbol item.
QScopedPointer< QgsExpression > mExpression
virtual QString legendClassificationAttribute() const override
If supported by the renderer, return classification attribute for the use in legend.
void setInvertedColorRamp(bool inverted)