|
QGIS API Documentation
2.6.0-Brighton
|
#include <qgscategorizedsymbolrendererv2.h>

Public Member Functions | |
| QgsCategorizedSymbolRendererV2 (QString attrName=QString(), QgsCategoryList categories=QgsCategoryList()) | |
| virtual | ~QgsCategorizedSymbolRendererV2 () |
| virtual QgsSymbolV2 * | symbolForFeature (QgsFeature &feature) |
| to be overridden | |
| virtual QgsSymbolV2 * | originalSymbolForFeature (QgsFeature &feature) |
| Return symbol for feature. | |
| virtual void | startRender (QgsRenderContext &context, const QgsFields &fields) |
| virtual void | stopRender (QgsRenderContext &context) |
| virtual QList< QString > | usedAttributes () |
| virtual QString | dump () const |
| for debugging | |
| virtual QgsFeatureRendererV2 * | clone () const |
| virtual void | toSld (QDomDocument &doc, QDomElement &element) const |
| used from subclasses to create SLD Rule elements following SLD v1.1 specs | |
| virtual int | capabilities () |
| returns bitwise OR-ed capabilities of the renderer | |
| virtual QgsSymbolV2List | symbols () |
| for symbol levels | |
| void | updateSymbols (QgsSymbolV2 *sym) |
| const QgsCategoryList & | categories () const |
| int | categoryIndexForValue (QVariant val) |
| return index of category with specified value (-1 if not found) | |
| int | categoryIndexForLabel (QString val) |
| return index of category with specified label (-1 if not found or not unique) | |
| bool | updateCategoryValue (int catIndex, const QVariant &value) |
| bool | updateCategorySymbol (int catIndex, QgsSymbolV2 *symbol) |
| bool | updateCategoryLabel (int catIndex, QString label) |
| bool | updateCategoryRenderState (int catIndex, bool render) |
| void | addCategory (const QgsRendererCategoryV2 &category) |
| bool | deleteCategory (int catIndex) |
| void | deleteAllCategories () |
| void | moveCategory (int from, int to) |
| Moves the category at index position from to index position to. | |
| void | sortByValue (Qt::SortOrder order=Qt::AscendingOrder) |
| void | sortByLabel (Qt::SortOrder order=Qt::AscendingOrder) |
| QString | classAttribute () const |
| void | setClassAttribute (QString attr) |
| virtual QDomElement | save (QDomDocument &doc) |
| store renderer info to XML element | |
| virtual QgsLegendSymbologyList | legendSymbologyItems (QSize iconSize) |
| return a list of symbology items for the legend | |
| virtual QgsLegendSymbolList | legendSymbolItems (double scaleDenominator=-1, QString rule=QString()) |
| return a list of item text / symbol | |
| QgsSymbolV2 * | sourceSymbol () |
| void | setSourceSymbol (QgsSymbolV2 *sym) |
| QgsVectorColorRampV2 * | sourceColorRamp () |
| void | setSourceColorRamp (QgsVectorColorRampV2 *ramp) |
| bool | invertedColorRamp () |
| void | setInvertedColorRamp (bool inverted) |
| void | updateColorRamp (QgsVectorColorRampV2 *ramp, bool inverted=false) |
| void | setRotationField (QString fieldOrExpression) |
| sets rotation field of renderer (if supported by the renderer) | |
| QString | rotationField () const |
| return rotation field name (or empty string if not set or not supported by renderer) | |
| void | setSizeScaleField (QString fieldOrExpression) |
| QString | sizeScaleField () const |
| void | setScaleMethod (QgsSymbolV2::ScaleMethod scaleMethod) |
| QgsSymbolV2::ScaleMethod | scaleMethod () const |
| virtual bool | legendSymbolItemsCheckable () const |
| items of symbology items in legend should be checkable | |
| virtual bool | legendSymbolItemChecked (QString key) |
| item in symbology was checked | |
| virtual void | checkLegendSymbolItem (QString key, bool state=true) |
| item in symbology was checked | |
| virtual QString | legendClassificationAttribute () const |
| If supported by the renderer, return classification attribute for the use in legend. | |
Public Member Functions inherited from QgsFeatureRendererV2 | |
| QString | type () const |
| virtual Q_DECL_DEPRECATED void | startRender (QgsRenderContext &context, const QgsVectorLayer *vlayer) |
| virtual | ~QgsFeatureRendererV2 () |
| virtual bool | renderFeature (QgsFeature &feature, QgsRenderContext &context, int layer=-1, bool selected=false, bool drawVertexMarker=false) |
| bool | usingSymbolLevels () const |
| void | setUsingSymbolLevels (bool usingSymbolLevels) |
| virtual QDomElement | writeSld (QDomDocument &doc, const QgsVectorLayer &layer) const |
| create the SLD UserStyle element following the SLD v1.1 specs | |
| virtual QgsLegendSymbolListV2 | legendSymbolItemsV2 () const |
| Return a list of symbology items for the legend. | |
| void | setVertexMarkerAppearance (int type, int size) |
| set type and size of editing vertex markers for subsequent rendering | |
| virtual bool | willRenderFeature (QgsFeature &feat) |
| return whether the renderer will render a feature or not. | |
| virtual QgsSymbolV2List | symbolsForFeature (QgsFeature &feat) |
| return list of symbols used for rendering the feature. | |
| virtual QgsSymbolV2List | originalSymbolsForFeature (QgsFeature &feat) |
| Equivalent of originalSymbolsForFeature() call extended to support renderers that may use more symbols per feature - similar to symbolsForFeature() | |
Static Public Member Functions | |
| static QgsFeatureRendererV2 * | create (QDomElement &element) |
| create renderer from XML element | |
| static QgsCategorizedSymbolRendererV2 * | convertFromRenderer (const QgsFeatureRendererV2 *renderer) |
| creates a QgsCategorizedSymbolRendererV2 from an existing renderer. | |
Static Public Member Functions inherited from QgsFeatureRendererV2 | |
| static QgsFeatureRendererV2 * | defaultRenderer (QGis::GeometryType geomType) |
| return a new renderer - used by default in vector layers | |
| static QgsFeatureRendererV2 * | load (QDomElement &symbologyElem) |
| create a renderer from XML element | |
| static QgsFeatureRendererV2 * | loadSld (const QDomNode &node, QGis::GeometryType geomType, QString &errorMessage) |
| create a new renderer according to the information contained in the UserStyle element of a SLD style document | |
Protected Member Functions | |
| void | rebuildHash () |
| QgsSymbolV2 * | symbolForValue (QVariant value) |
Protected Member Functions inherited from QgsFeatureRendererV2 | |
| QgsFeatureRendererV2 (QString type) | |
| void | renderFeatureWithSymbol (QgsFeature &feature, QgsSymbolV2 *symbol, QgsRenderContext &context, int layer, bool selected, bool drawVertexMarker) |
| void | renderVertexMarker (QPointF &pt, QgsRenderContext &context) |
| render editing vertex marker at specified point | |
| void | renderVertexMarkerPolyline (QPolygonF &pts, QgsRenderContext &context) |
| render editing vertex marker for a polyline | |
| void | renderVertexMarkerPolygon (QPolygonF &pts, QList< QPolygonF > *rings, QgsRenderContext &context) |
| render editing vertex marker for a polygon | |
| void | setScaleMethodToSymbol (QgsSymbolV2 *symbol, int scaleMethod) |
Protected Attributes | |
| QString | mAttrName |
| QgsCategoryList | mCategories |
| QScopedPointer< QgsSymbolV2 > | mSourceSymbol |
| QScopedPointer < QgsVectorColorRampV2 > | mSourceColorRamp |
| bool | mInvertedColorRamp |
| QScopedPointer< QgsExpression > | mRotation |
| QScopedPointer< QgsExpression > | mSizeScale |
| QgsSymbolV2::ScaleMethod | mScaleMethod |
| QScopedPointer< QgsExpression > | mExpression |
| int | mAttrNum |
| attribute index (derived from attribute name in startRender) | |
| QHash< QString, QgsSymbolV2 * > | mSymbolHash |
| hashtable for faster access to symbols | |
| bool | mCounting |
| QHash< QgsSymbolV2 *, QgsSymbolV2 * > | mTempSymbols |
| temporary symbols, used for data-defined rotation and scaling | |
Protected Attributes inherited from QgsFeatureRendererV2 | |
| QString | mType |
| bool | mUsingSymbolLevels |
| int | mCurrentVertexMarkerType |
| The current type of editing marker. | |
| int | mCurrentVertexMarkerSize |
| The current size of editing marker. | |
Static Protected Attributes | |
| static QgsMarkerSymbolV2 | sSkipRender |
Additional Inherited Members | |
Public Types inherited from QgsFeatureRendererV2 | |
| enum | Capabilities { SymbolLevels = 1, RotationField = 1 << 1, MoreSymbolsPerFeature = 1 << 2, Filter = 1 << 3, ScaleDependent = 1 << 4 } |
Static Protected Member Functions inherited from QgsFeatureRendererV2 | |
| static const unsigned char * | _getPoint (QPointF &pt, QgsRenderContext &context, const unsigned char *wkb) |
| static const unsigned char * | _getLineString (QPolygonF &pts, QgsRenderContext &context, const unsigned char *wkb) |
| static const unsigned char * | _getPolygon (QPolygonF &pts, QList< QPolygonF > &holes, QgsRenderContext &context, const unsigned char *wkb) |
| QgsCategorizedSymbolRendererV2::QgsCategorizedSymbolRendererV2 | ( | QString | attrName = QString(), |
| QgsCategoryList | categories = QgsCategoryList() |
||
| ) |
|
virtual |
| void QgsCategorizedSymbolRendererV2::addCategory | ( | const QgsRendererCategoryV2 & | category | ) |
|
inlinevirtual |
returns bitwise OR-ed capabilities of the renderer
Reimplemented from QgsFeatureRendererV2.
|
inline |
| int QgsCategorizedSymbolRendererV2::categoryIndexForLabel | ( | QString | val | ) |
return index of category with specified label (-1 if not found or not unique)
| int QgsCategorizedSymbolRendererV2::categoryIndexForValue | ( | QVariant | val | ) |
return index of category with specified value (-1 if not found)
|
virtual |
item in symbology was checked
Reimplemented from QgsFeatureRendererV2.
|
inline |
|
virtual |
Implements QgsFeatureRendererV2.
|
static |
creates a QgsCategorizedSymbolRendererV2 from an existing renderer.
|
static |
create renderer from XML element
| void QgsCategorizedSymbolRendererV2::deleteAllCategories | ( | ) |
| bool QgsCategorizedSymbolRendererV2::deleteCategory | ( | int | catIndex | ) |
|
virtual |
for debugging
Reimplemented from QgsFeatureRendererV2.
|
inline |
|
inlinevirtual |
If supported by the renderer, return classification attribute for the use in legend.
Reimplemented from QgsFeatureRendererV2.
|
virtual |
item in symbology was checked
Reimplemented from QgsFeatureRendererV2.
|
virtual |
return a list of item text / symbol
Reimplemented from QgsFeatureRendererV2.
|
virtual |
items of symbology items in legend should be checkable
Reimplemented from QgsFeatureRendererV2.
|
virtual |
return a list of symbology items for the legend
Reimplemented from QgsFeatureRendererV2.
| void QgsCategorizedSymbolRendererV2::moveCategory | ( | int | from, |
| int | to | ||
| ) |
Moves the category at index position from to index position to.
|
virtual |
Return symbol for feature.
The difference compared to symbolForFeature() is that it returns original symbol which can be used as an identifier for renderer's rule - the former may return a temporary replacement of a symbol for use in rendering.
Reimplemented from QgsFeatureRendererV2.
|
protected |
|
virtual |
return rotation field name (or empty string if not set or not supported by renderer)
Reimplemented from QgsFeatureRendererV2.
|
virtual |
store renderer info to XML element
Reimplemented from QgsFeatureRendererV2.
|
inline |
|
inline |
|
inline |
|
virtual |
sets rotation field of renderer (if supported by the renderer)
Reimplemented from QgsFeatureRendererV2.
| void QgsCategorizedSymbolRendererV2::setScaleMethod | ( | QgsSymbolV2::ScaleMethod | scaleMethod | ) |
| void QgsCategorizedSymbolRendererV2::setSizeScaleField | ( | QString | fieldOrExpression | ) |
| void QgsCategorizedSymbolRendererV2::setSourceColorRamp | ( | QgsVectorColorRampV2 * | ramp | ) |
| void QgsCategorizedSymbolRendererV2::setSourceSymbol | ( | QgsSymbolV2 * | sym | ) |
| QString QgsCategorizedSymbolRendererV2::sizeScaleField | ( | ) | const |
| void QgsCategorizedSymbolRendererV2::sortByLabel | ( | Qt::SortOrder | order = Qt::AscendingOrder | ) |
| void QgsCategorizedSymbolRendererV2::sortByValue | ( | Qt::SortOrder | order = Qt::AscendingOrder | ) |
| QgsVectorColorRampV2 * QgsCategorizedSymbolRendererV2::sourceColorRamp | ( | ) |
| QgsSymbolV2 * QgsCategorizedSymbolRendererV2::sourceSymbol | ( | ) |
|
virtual |
Implements QgsFeatureRendererV2.
|
virtual |
Implements QgsFeatureRendererV2.
|
virtual |
to be overridden
| feature | feature |
Implements QgsFeatureRendererV2.
|
protected |
|
virtual |
for symbol levels
Implements QgsFeatureRendererV2.
|
virtual |
used from subclasses to create SLD Rule elements following SLD v1.1 specs
Reimplemented from QgsFeatureRendererV2.
| bool QgsCategorizedSymbolRendererV2::updateCategoryLabel | ( | int | catIndex, |
| QString | label | ||
| ) |
| bool QgsCategorizedSymbolRendererV2::updateCategoryRenderState | ( | int | catIndex, |
| bool | render | ||
| ) |
| bool QgsCategorizedSymbolRendererV2::updateCategorySymbol | ( | int | catIndex, |
| QgsSymbolV2 * | symbol | ||
| ) |
| bool QgsCategorizedSymbolRendererV2::updateCategoryValue | ( | int | catIndex, |
| const QVariant & | value | ||
| ) |
| void QgsCategorizedSymbolRendererV2::updateColorRamp | ( | QgsVectorColorRampV2 * | ramp, |
| bool | inverted = false |
||
| ) |
| void QgsCategorizedSymbolRendererV2::updateSymbols | ( | QgsSymbolV2 * | sym | ) |
|
virtual |
Implements QgsFeatureRendererV2.
|
protected |
|
protected |
attribute index (derived from attribute name in startRender)
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
hashtable for faster access to symbols
|
protected |
temporary symbols, used for data-defined rotation and scaling
|
staticprotected |
1.8.1.2