15 #ifndef QGSCATEGORIZEDSYMBOLRENDERERV2_H
16 #define QGSCATEGORIZEDSYMBOLRENDERERV2_H
23 #include <QScopedPointer>
46 void setValue(
const QVariant &value );
48 void setLabel(
const QString &label );
51 bool renderState()
const;
52 void setRenderState(
bool render );
103 int categoryIndexForValue(
QVariant val );
107 int categoryIndexForLabel(
QString val );
109 bool updateCategoryValue(
int catIndex,
const QVariant &value );
110 bool updateCategorySymbol(
int catIndex,
QgsSymbolV2* symbol );
111 bool updateCategoryLabel(
int catIndex,
QString label );
114 bool updateCategoryRenderState(
int catIndex,
bool render );
117 bool deleteCategory(
int catIndex );
118 void deleteAllCategories();
121 void moveCategory(
int from,
int to );
123 void sortByValue( Qt::SortOrder order = Qt::AscendingOrder );
124 void sortByLabel( Qt::SortOrder order = Qt::AscendingOrder );
162 void setSizeScaleField(
QString fieldOrExpression );
163 QString sizeScaleField()
const;
218 #endif // QGSCATEGORIZEDSYMBOLRENDERERV2_H
QgsSymbolV2::ScaleMethod mScaleMethod
virtual QgsSymbolV2 * originalSymbolForFeature(QgsFeature &feature)
Return symbol for feature.
virtual void setRotationField(QString fieldName)
sets rotation field of renderer (if supported by the renderer)
virtual void checkLegendSymbolItem(QString key, bool state=true)
item in symbology was checked
const QgsCategoryList & categories() const
virtual QString dump() const
for debugging
virtual QDomElement save(QDomDocument &doc)
store renderer info to XML element
QScopedPointer< QgsSymbolV2 > mSourceSymbol
virtual QgsLegendSymbolList legendSymbolItems(double scaleDenominator=-1, QString rule="")
return a list of item text / symbol
QScopedPointer< QgsExpression > mRotation
Container of fields for a vector layer.
virtual int capabilities() override
returns bitwise OR-ed capabilities of the renderer
virtual QList< QString > usedAttributes()=0
The feature class encapsulates a single feature including its id, geometry and a list of field/values...
QScopedPointer< QgsSymbolV2 > mSymbol
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
QScopedPointer< QgsExpression > mSizeScale
QgsCategoryList mCategories
virtual void stopRender(QgsRenderContext &context)=0
virtual QString rotationField() const
return rotation field name (or empty string if not set or not supported by renderer) ...
virtual QgsSymbolV2List symbols()=0
for symbol levels
virtual QgsFeatureRendererV2 * clone() const =0
QList< QgsRendererCategoryV2 > QgsCategoryList
QScopedPointer< QgsVectorColorRampV2 > mSourceColorRamp
virtual bool legendSymbolItemChecked(QString key)
items of symbology items in legend is checked
void setClassAttribute(QString attr)
static QgsMarkerSymbolV2 sSkipRender
QHash< QgsSymbolV2 *, QgsSymbolV2 * > mTempSymbols
temporary symbols, used for data-defined rotation and scaling
virtual void toSld(QDomDocument &doc, QDomElement &element) const
used from subclasses to create SLD Rule elements following SLD v1.1 specs
Contains information about the context of a rendering operation.
virtual QgsLegendSymbolListV2 legendSymbolItemsV2() const
Return a list of symbology items for the legend.
virtual bool legendSymbolItemsCheckable() const
items of symbology items in legend should be checkable
int mAttrNum
attribute index (derived from attribute name in startRender)
QString classAttribute() const
QgsSymbolV2::ScaleMethod scaleMethod() const
Represents a vector layer which manages a vector based data sets.
virtual QgsSymbolV2 * symbolForFeature(QgsFeature &feature)=0
to be overridden
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)