QGIS API Documentation
2.8.2-Wien
|
#include <qgsrendererv2.h>
Public Types | |
enum | Capabilities { SymbolLevels = 1, RotationField = 1 << 1, MoreSymbolsPerFeature = 1 << 2, Filter = 1 << 3, ScaleDependent = 1 << 4 } |
Public Member Functions | |
virtual | ~QgsFeatureRendererV2 () |
virtual int | capabilities () |
returns bitwise OR-ed capabilities of the renderer | |
virtual void | checkLegendSymbolItem (QString key, bool state=true) |
item in symbology was checked | |
virtual QgsFeatureRendererV2 * | clone () const =0 |
virtual QString | dump () const |
for debugging | |
virtual QString | legendClassificationAttribute () const |
If supported by the renderer, return classification attribute for the use in legend. | |
virtual bool | legendSymbolItemChecked (QString key) |
items of symbology items in legend is checked | |
virtual QgsLegendSymbolList | legendSymbolItems (double scaleDenominator=-1, QString rule="") |
return a list of item text / symbol | |
virtual bool | legendSymbolItemsCheckable () const |
items of symbology items in legend should be checkable | |
virtual QgsLegendSymbolListV2 | legendSymbolItemsV2 () const |
Return a list of symbology items for the legend. | |
virtual QgsLegendSymbologyList | legendSymbologyItems (QSize iconSize) |
return a list of symbology items for the legend | |
virtual void | modifyRequestExtent (QgsRectangle &extent, QgsRenderContext &context) |
Allows for a renderer to modify the extent of a feature request prior to rendering. | |
virtual QgsSymbolV2 * | originalSymbolForFeature (QgsFeature &feature) |
Return symbol for feature. | |
virtual QgsSymbolV2List | originalSymbolsForFeature (QgsFeature &feat) |
Equivalent of originalSymbolsForFeature() call extended to support renderers that may use more symbols per feature - similar to symbolsForFeature() | |
virtual bool | renderFeature (QgsFeature &feature, QgsRenderContext &context, int layer=-1, bool selected=false, bool drawVertexMarker=false) |
virtual QString | rotationField () const |
return rotation field name (or empty string if not set or not supported by renderer) | |
virtual QDomElement | save (QDomDocument &doc) |
store renderer info to XML element | |
virtual void | setRotationField (QString fieldName) |
sets rotation field of renderer (if supported by the renderer) | |
void | setUsingSymbolLevels (bool usingSymbolLevels) |
void | setVertexMarkerAppearance (int type, int size) |
set type and size of editing vertex markers for subsequent rendering | |
virtual void | startRender (QgsRenderContext &context, const QgsFields &fields)=0 |
virtual Q_DECL_DEPRECATED void | startRender (QgsRenderContext &context, const QgsVectorLayer *vlayer) |
virtual void | stopRender (QgsRenderContext &context)=0 |
virtual QgsSymbolV2 * | symbolForFeature (QgsFeature &feature)=0 |
to be overridden | |
virtual QgsSymbolV2List | symbols ()=0 |
for symbol levels | |
virtual QgsSymbolV2List | symbolsForFeature (QgsFeature &feat) |
return list of symbols used for rendering the feature. | |
virtual void | toSld (QDomDocument &doc, QDomElement &element) const |
used from subclasses to create SLD Rule elements following SLD v1.1 specs | |
QString | type () const |
virtual QList< QString > | usedAttributes ()=0 |
bool | usingSymbolLevels () const |
virtual bool | willRenderFeature (QgsFeature &feat) |
return whether the renderer will render a feature or not. | |
virtual Q_DECL_DEPRECATED QDomElement | writeSld (QDomDocument &doc, const QgsVectorLayer &layer) const |
create the SLD UserStyle element following the SLD v1.1 specs | |
virtual QDomElement | writeSld (QDomDocument &doc, const QString &styleName) const |
create the SLD UserStyle element following the SLD v1.1 specs with the given name |
Static Public Member Functions | |
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 | |
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 | renderVertexMarkerPolygon (QPolygonF &pts, QList< QPolygonF > *rings, QgsRenderContext &context) |
render editing vertex marker for a polygon | |
void | renderVertexMarkerPolyline (QPolygonF &pts, QgsRenderContext &context) |
render editing vertex marker for a polyline | |
void | setScaleMethodToSymbol (QgsSymbolV2 *symbol, int scaleMethod) |
Static Protected Member Functions | |
static const unsigned char * | _getLineString (QPolygonF &pts, QgsRenderContext &context, const unsigned char *wkb) |
static const unsigned char * | _getPoint (QPointF &pt, QgsRenderContext &context, const unsigned char *wkb) |
static const unsigned char * | _getPolygon (QPolygonF &pts, QList< QPolygonF > &holes, QgsRenderContext &context, const unsigned char *wkb) |
Protected Attributes | |
int | mCurrentVertexMarkerSize |
The current size of editing marker. | |
int | mCurrentVertexMarkerType |
The current type of editing marker. | |
QString | mType |
bool | mUsingSymbolLevels |
Definition at line 73 of file qgsrendererv2.h.
Definition at line 115 of file qgsrendererv2.h.
|
inlinevirtual |
Definition at line 106 of file qgsrendererv2.h.
|
protected |
Definition at line 196 of file qgsrendererv2.cpp.
|
staticprotected |
Definition at line 62 of file qgsrendererv2.cpp.
|
staticprotected |
Definition at line 38 of file qgsrendererv2.cpp.
|
staticprotected |
Definition at line 112 of file qgsrendererv2.cpp.
|
inlinevirtual |
returns bitwise OR-ed capabilities of the renderer
Reimplemented in QgsRuleBasedRendererV2, QgsGraduatedSymbolRendererV2, QgsCategorizedSymbolRendererV2, QgsInvertedPolygonRenderer, QgsSingleSymbolRendererV2, and QgsPointDisplacementRenderer.
Definition at line 125 of file qgsrendererv2.h.
|
virtual |
item in symbology was checked
Reimplemented in QgsGraduatedSymbolRendererV2, QgsRuleBasedRendererV2, and QgsCategorizedSymbolRendererV2.
Definition at line 528 of file qgsrendererv2.cpp.
|
pure virtual |
|
static |
return a new renderer - used by default in vector layers
Definition at line 203 of file qgsrendererv2.cpp.
|
virtual |
for debugging
Reimplemented in QgsRuleBasedRendererV2, QgsGraduatedSymbolRendererV2, QgsCategorizedSymbolRendererV2, QgsInvertedPolygonRenderer, QgsSingleSymbolRendererV2, and QgsHeatmapRenderer.
Definition at line 367 of file qgsrendererv2.cpp.
|
inlinevirtual |
If supported by the renderer, return classification attribute for the use in legend.
Reimplemented in QgsGraduatedSymbolRendererV2, and QgsCategorizedSymbolRendererV2.
Definition at line 188 of file qgsrendererv2.h.
|
virtual |
items of symbology items in legend is checked
Reimplemented in QgsGraduatedSymbolRendererV2, QgsRuleBasedRendererV2, and QgsCategorizedSymbolRendererV2.
Definition at line 522 of file qgsrendererv2.cpp.
|
virtual |
return a list of item text / symbol
Reimplemented in QgsRuleBasedRendererV2, QgsGraduatedSymbolRendererV2, QgsCategorizedSymbolRendererV2, QgsInvertedPolygonRenderer, QgsSingleSymbolRendererV2, and QgsPointDisplacementRenderer.
Definition at line 534 of file qgsrendererv2.cpp.
|
virtual |
items of symbology items in legend should be checkable
Reimplemented in QgsGraduatedSymbolRendererV2, QgsRuleBasedRendererV2, and QgsCategorizedSymbolRendererV2.
Definition at line 517 of file qgsrendererv2.cpp.
|
virtual |
Return a list of symbology items for the legend.
Better choice than legendSymbolItems(). Default fallback implementation just uses legendSymbolItems() implementation
Reimplemented in QgsRuleBasedRendererV2, and QgsSingleSymbolRendererV2.
Definition at line 541 of file qgsrendererv2.cpp.
|
virtual |
return a list of symbology items for the legend
Reimplemented in QgsRuleBasedRendererV2, QgsGraduatedSymbolRendererV2, QgsCategorizedSymbolRendererV2, QgsInvertedPolygonRenderer, QgsSingleSymbolRendererV2, and QgsPointDisplacementRenderer.
Definition at line 510 of file qgsrendererv2.cpp.
|
static |
create a renderer from XML element
Definition at line 373 of file qgsrendererv2.cpp.
|
static |
create a new renderer according to the information contained in the UserStyle element of a SLD style document
node | the node in the SLD document whose the UserStyle element is a child |
geomType | the geometry type of the features, used to convert Symbolizer elements |
errorMessage | it will contain the error message if something went wrong |
Definition at line 401 of file qgsrendererv2.cpp.
|
inlinevirtual |
Allows for a renderer to modify the extent of a feature request prior to rendering.
extent | reference to request's filter extent. Modify extent to change the extent of feature request |
context | render context |
Reimplemented in QgsHeatmapRenderer.
Definition at line 219 of file qgsrendererv2.h.
|
inlinevirtual |
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 in QgsGraduatedSymbolRendererV2, QgsInvertedPolygonRenderer, QgsCategorizedSymbolRendererV2, QgsPointDisplacementRenderer, and QgsSingleSymbolRendererV2.
Definition at line 95 of file qgsrendererv2.h.
|
virtual |
Equivalent of originalSymbolsForFeature() call extended to support renderers that may use more symbols per feature - similar to symbolsForFeature()
Reimplemented in QgsRuleBasedRendererV2, QgsInvertedPolygonRenderer, and QgsPointDisplacementRenderer.
Definition at line 595 of file qgsrendererv2.cpp.
|
virtual |
Reimplemented in QgsRuleBasedRendererV2, QgsInvertedPolygonRenderer, QgsHeatmapRenderer, and QgsPointDisplacementRenderer.
Definition at line 214 of file qgsrendererv2.cpp.
|
protected |
Definition at line 224 of file qgsrendererv2.cpp.
|
protected |
render editing vertex marker at specified point
Definition at line 559 of file qgsrendererv2.cpp.
|
protected |
render editing vertex marker for a polygon
Definition at line 572 of file qgsrendererv2.cpp.
|
protected |
render editing vertex marker for a polyline
Definition at line 566 of file qgsrendererv2.cpp.
|
inlinevirtual |
return rotation field name (or empty string if not set or not supported by renderer)
Reimplemented in QgsGraduatedSymbolRendererV2, QgsCategorizedSymbolRendererV2, and QgsSingleSymbolRendererV2.
Definition at line 194 of file qgsrendererv2.h.
|
virtual |
store renderer info to XML element
Reimplemented in QgsRuleBasedRendererV2, QgsGraduatedSymbolRendererV2, QgsCategorizedSymbolRendererV2, QgsInvertedPolygonRenderer, QgsSingleSymbolRendererV2, QgsPointDisplacementRenderer, and QgsHeatmapRenderer.
Definition at line 395 of file qgsrendererv2.cpp.
|
inlinevirtual |
sets rotation field of renderer (if supported by the renderer)
Reimplemented in QgsGraduatedSymbolRendererV2, QgsCategorizedSymbolRendererV2, and QgsSingleSymbolRendererV2.
Definition at line 196 of file qgsrendererv2.h.
|
protected |
Definition at line 180 of file qgsrendererv2.cpp.
|
inline |
Definition at line 131 of file qgsrendererv2.h.
void QgsFeatureRendererV2::setVertexMarkerAppearance | ( | int | type, |
int | size | ||
) |
set type and size of editing vertex markers for subsequent rendering
Definition at line 553 of file qgsrendererv2.cpp.
|
pure virtual |
|
virtual |
Definition at line 208 of file qgsrendererv2.cpp.
|
pure virtual |
|
pure virtual |
to be overridden
feature | feature |
Implemented in QgsRuleBasedRendererV2, QgsGraduatedSymbolRendererV2, QgsInvertedPolygonRenderer, QgsCategorizedSymbolRendererV2, QgsPointDisplacementRenderer, QgsHeatmapRenderer, and QgsSingleSymbolRendererV2.
|
pure virtual |
for symbol levels
Implemented in QgsRuleBasedRendererV2, QgsGraduatedSymbolRendererV2, QgsCategorizedSymbolRendererV2, QgsInvertedPolygonRenderer, QgsSingleSymbolRendererV2, QgsPointDisplacementRenderer, and QgsHeatmapRenderer.
|
virtual |
return list of symbols used for rendering the feature.
For renderers that do not support MoreSymbolsPerFeature it is more efficient to use symbolForFeature()
Reimplemented in QgsRuleBasedRendererV2, QgsInvertedPolygonRenderer, and QgsPointDisplacementRenderer.
Definition at line 587 of file qgsrendererv2.cpp.
|
inlinevirtual |
used from subclasses to create SLD Rule elements following SLD v1.1 specs
Reimplemented in QgsRuleBasedRendererV2, QgsGraduatedSymbolRendererV2, QgsCategorizedSymbolRendererV2, QgsSingleSymbolRendererV2, and QgsPointDisplacementRenderer.
Definition at line 159 of file qgsrendererv2.h.
|
inline |
Definition at line 81 of file qgsrendererv2.h.
|
pure virtual |
|
inline |
Definition at line 130 of file qgsrendererv2.h.
|
inlinevirtual |
return whether the renderer will render a feature or not.
Must be called between startRender() and stopRender() calls. Default implementation uses symbolForFeature().
Reimplemented in QgsRuleBasedRendererV2, QgsInvertedPolygonRenderer, and QgsPointDisplacementRenderer.
Definition at line 201 of file qgsrendererv2.h.
|
virtual |
create the SLD UserStyle element following the SLD v1.1 specs
Definition at line 490 of file qgsrendererv2.cpp.
|
virtual |
create the SLD UserStyle element following the SLD v1.1 specs with the given name
Definition at line 495 of file qgsrendererv2.cpp.
|
protected |
The current size of editing marker.
Definition at line 251 of file qgsrendererv2.h.
|
protected |
The current type of editing marker.
Definition at line 249 of file qgsrendererv2.h.
|
protected |
Definition at line 244 of file qgsrendererv2.h.
|
protected |
Definition at line 246 of file qgsrendererv2.h.