QGIS API Documentation  2.18.21-Las Palmas (9fba24a)
Classes | Public Types | Public Member Functions | Static Public Member Functions | Protected Attributes | List of all members
QgsRuleBasedRendererV2 Class Reference

When drawing a vector layer with rule-based renderer, it goes through the rules and draws features with symbols from rules that match. More...

#include <qgsrulebasedrendererv2.h>

Inheritance diagram for QgsRuleBasedRendererV2:
Inheritance graph
[legend]

Classes

struct  FeatureToRender
 
struct  RenderJob
 
struct  RenderLevel
 
class  Rule
 This class keeps data about a rules for rule-based renderer. More...
 

Public Types

enum  FeatureFlags { FeatIsSelected = 1, FeatDrawMarkers = 2 }
 
typedef QList< RenderLevelRenderQueue
 
typedef QList< Rule * > RuleList
 
- Public Types inherited from QgsFeatureRendererV2
enum  Capabilities {
  SymbolLevels = 1, RotationField = 1 << 1, MoreSymbolsPerFeature = 1 << 2, Filter = 1 << 3,
  ScaleDependent = 1 << 4
}
 

Public Member Functions

 QgsRuleBasedRendererV2 (QgsRuleBasedRendererV2::Rule *root)
 Constructs the renderer from given tree of rules (takes ownership) More...
 
 QgsRuleBasedRendererV2 (QgsSymbolV2 *defaultSymbol)
 Constructor for convenience. Creates a root rule and adds a default rule with symbol (takes ownership) More...
 
 ~QgsRuleBasedRendererV2 ()
 
virtual int capabilities () override
 returns bitwise OR-ed capabilities of the renderer More...
 
virtual void checkLegendSymbolItem (const QString &key, bool state=true) override
 item in symbology was checked More...
 
virtual QgsRuleBasedRendererV2clone () const override
 
virtual QString dump () const override
 for debugging More...
 
virtual QString filter (const QgsFields &fields=QgsFields()) override
 If a renderer does not require all the features this method may be overridden and return an expression used as where clause. More...
 
virtual bool filterNeedsGeometry () const override
 Returns true if this renderer requires the geometry to apply the filter. More...
 
virtual QSet< QStringlegendKeysForFeature (QgsFeature &feature, QgsRenderContext &context) override
 Return legend keys matching a specified feature. More...
 
virtual bool legendSymbolItemChecked (const QString &key) override
 items of symbology items in legend is checked More...
 
virtual QgsLegendSymbolList legendSymbolItems (double scaleDenominator=-1, const QString &rule="") override
 return a list of item text / symbol More...
 
virtual bool legendSymbolItemsCheckable () const override
 items of symbology items in legend should be checkable More...
 
virtual QgsLegendSymbolListV2 legendSymbolItemsV2 () const override
 Return a list of symbology items for the legend. More...
 
virtual QgsLegendSymbologyList legendSymbologyItems (QSize iconSize) override
 return a list of symbology items for the legend More...
 
virtual QgsSymbolV2List originalSymbolsForFeature (QgsFeature &feat, QgsRenderContext &context) override
 Equivalent of originalSymbolsForFeature() call extended to support renderers that may use more symbols per feature - similar to symbolsForFeature() More...
 
virtual bool renderFeature (QgsFeature &feature, QgsRenderContext &context, int layer=-1, bool selected=false, bool drawVertexMarker=false) override
 Render a feature using this renderer in the given context. More...
 
RulerootRule ()
 
virtual QDomElement save (QDomDocument &doc) override
 store renderer info to XML element More...
 
virtual void setLegendSymbolItem (const QString &key, QgsSymbolV2 *symbol) override
 Sets the symbol to be used for a legend symbol item. More...
 
virtual void startRender (QgsRenderContext &context, const QgsFields &fields) override
 Needs to be called when a new render cycle is started. More...
 
virtual void stopRender (QgsRenderContext &context) override
 Needs to be called when a render cycle has finished to clean up. More...
 
virtual QgsSymbolV2symbolForFeature (QgsFeature &feature, QgsRenderContext &context) override
 return symbol for current feature. Should not be used individually: there could be more symbols for a feature More...
 
virtual QgsSymbolV2List symbols (QgsRenderContext &context) override
 Returns list of symbols used by the renderer. More...
 
virtual QgsSymbolV2List symbolsForFeature (QgsFeature &feat, QgsRenderContext &context) override
 return list of symbols used for rendering the feature. More...
 
virtual void toSld (QDomDocument &doc, QDomElement &element) const override
 Writes the SLD element following the SLD v1.1 specs. More...
 
virtual void toSld (QDomDocument &doc, QDomElement &element, const QgsStringMap &props) const override
 Writes the SLD element following the SLD v1.1 specs. More...
 
virtual QList< QStringusedAttributes () override
 Returns a set of attributes required for this renderer. More...
 
virtual bool willRenderFeature (QgsFeature &feat, QgsRenderContext &context) override
 return whether the renderer will render a feature or not. More...
 
- Public Member Functions inherited from QgsFeatureRendererV2
virtual ~QgsFeatureRendererV2 ()
 
virtual const QgsFeatureRendererV2embeddedRenderer () const
 Returns the current embedded renderer (subrenderer) for this feature renderer. More...
 
bool forceRasterRender () const
 Returns whether the renderer must render as a raster. More...
 
virtual QString legendClassificationAttribute () const
 If supported by the renderer, return classification attribute for the use in legend. More...
 
virtual void modifyRequestExtent (QgsRectangle &extent, QgsRenderContext &context)
 Allows for a renderer to modify the extent of a feature request prior to rendering. More...
 
QgsFeatureRequest::OrderBy orderBy () const
 Get the order in which features shall be processed by this renderer. More...
 
bool orderByEnabled () const
 Returns whether custom ordering will be applied before features are processed by this renderer. More...
 
virtual Q_DECL_DEPRECATED QgsSymbolV2originalSymbolForFeature (QgsFeature &feature)
 Return symbol for feature. More...
 
virtual QgsSymbolV2originalSymbolForFeature (QgsFeature &feature, QgsRenderContext &context)
 Return symbol for feature. More...
 
virtual Q_DECL_DEPRECATED QgsSymbolV2List originalSymbolsForFeature (QgsFeature &feat)
 Equivalent of originalSymbolsForFeature() call extended to support renderers that may use more symbols per feature - similar to symbolsForFeature() More...
 
QgsPaintEffectpaintEffect () const
 Returns the current paint effect for the renderer. More...
 
virtual Q_DECL_DEPRECATED QString rotationField () const
 return rotation field name (or empty string if not set or not supported by renderer) More...
 
virtual void setEmbeddedRenderer (QgsFeatureRendererV2 *subRenderer)
 Sets an embedded renderer (subrenderer) for this feature renderer. More...
 
void setForceRasterRender (bool forceRaster)
 Sets whether the renderer should be rendered to a raster destination. More...
 
void setOrderBy (const QgsFeatureRequest::OrderBy &orderBy)
 Define the order in which features shall be processed by this renderer. More...
 
void setOrderByEnabled (bool enabled)
 Sets whether custom ordering should be applied before features are processed by this renderer. More...
 
void setPaintEffect (QgsPaintEffect *effect)
 Sets the current paint effect for the renderer. More...
 
virtual Q_DECL_DEPRECATED void setRotationField (const QString &fieldName)
 sets rotation field of renderer (if supported by the renderer) More...
 
void setUsingSymbolLevels (bool usingSymbolLevels)
 
void setVertexMarkerAppearance (int type, int size)
 set type and size of editing vertex markers for subsequent rendering More...
 
virtual Q_DECL_DEPRECATED void startRender (QgsRenderContext &context, const QgsVectorLayer *vlayer)
 
virtual Q_DECL_DEPRECATED QgsSymbolV2symbolForFeature (QgsFeature &feature)
 To be overridden. More...
 
virtual Q_DECL_DEPRECATED QgsSymbolV2List symbols ()
 For symbol levels. More...
 
virtual Q_DECL_DEPRECATED QgsSymbolV2List symbolsForFeature (QgsFeature &feat)
 Returns list of symbols used for rendering the feature. More...
 
QString type () const
 
bool usingSymbolLevels () const
 
virtual Q_DECL_DEPRECATED bool willRenderFeature (QgsFeature &feat)
 Returns whether the renderer will render a feature or not. More...
 
virtual Q_DECL_DEPRECATED QDomElement writeSld (QDomDocument &doc, const QgsVectorLayer &layer) const
 create the SLD UserStyle element following the SLD v1.1 specs More...
 
virtual QDomElement writeSld (QDomDocument &doc, const QString &styleName) const
 create the SLD UserStyle element following the SLD v1.1 specs with the given name More...
 
virtual QDomElement writeSld (QDomDocument &doc, const QString &styleName, const QgsStringMap &props) const
 create the SLD UserStyle element following the SLD v1.1 specs with the given name More...
 

Static Public Member Functions

static QgsRuleBasedRendererV2convertFromRenderer (const QgsFeatureRendererV2 *renderer)
 creates a QgsRuleBasedRendererV2 from an existing renderer. More...
 
static void convertToDataDefinedSymbology (QgsSymbolV2 *symbol, const QString &sizeScaleField, const QString &rotationField=QString())
 helper function to convert the size scale and rotation fields present in some other renderers to data defined symbology More...
 
static QgsFeatureRendererV2create (QDomElement &element)
 
static QgsFeatureRendererV2createFromSld (QDomElement &element, QGis::GeometryType geomType)
 
static void refineRuleCategories (Rule *initialRule, QgsCategorizedSymbolRendererV2 *r)
 take a rule and create a list of new rules based on the categories from categorized symbol renderer More...
 
static void refineRuleRanges (Rule *initialRule, QgsGraduatedSymbolRendererV2 *r)
 take a rule and create a list of new rules based on the ranges from graduated symbol renderer More...
 
static void refineRuleScales (Rule *initialRule, QList< int > scales)
 take a rule and create a list of new rules with intervals of scales given by the passed scale denominators More...
 
- Static Public Member Functions inherited from QgsFeatureRendererV2
static QgsFeatureRendererV2defaultRenderer (QGis::GeometryType geomType)
 return a new renderer - used by default in vector layers More...
 
static QgsFeatureRendererV2load (QDomElement &symbologyElem)
 create a renderer from XML element More...
 
static QgsFeatureRendererV2loadSld (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. More...
 

Protected Attributes

QList< FeatureToRendermCurrentFeatures
 
QString mFilter
 
RenderQueue mRenderQueue
 
RulemRootRule
 the root node with hierarchical list of rules More...
 
- Protected Attributes inherited from QgsFeatureRendererV2
int mCurrentVertexMarkerSize
 The current size of editing marker. More...
 
int mCurrentVertexMarkerType
 The current type of editing marker. More...
 
bool mForceRaster
 
QgsFeatureRequest::OrderBy mOrderBy
 
bool mOrderByEnabled
 
QgsPaintEffectmPaintEffect
 
QString mType
 
bool mUsingSymbolLevels
 

Additional Inherited Members

- Protected Member Functions inherited from QgsFeatureRendererV2
 QgsFeatureRendererV2 (const QString &type)
 
Q_DECL_DEPRECATED void copyPaintEffect (QgsFeatureRendererV2 *destRenderer) const
 Copies paint effect of this renderer to another renderer. More...
 
void copyRendererData (QgsFeatureRendererV2 *destRenderer) const
 Clones generic renderer data to another renderer. More...
 
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 More...
 
void renderVertexMarkerPolygon (QPolygonF &pts, QList< QPolygonF > *rings, QgsRenderContext &context)
 render editing vertex marker for a polygon More...
 
void renderVertexMarkerPolyline (QPolygonF &pts, QgsRenderContext &context)
 render editing vertex marker for a polyline More...
 
void setScaleMethodToSymbol (QgsSymbolV2 *symbol, int scaleMethod)
 
- Static Protected Member Functions inherited from QgsFeatureRendererV2
static QgsConstWkbPtr _getLineString (QPolygonF &pts, QgsRenderContext &context, QgsConstWkbPtr &wkb, bool clipToExtent=true)
 Creates a line string in screen coordinates from a wkb string in map coordinates. More...
 
static QgsConstWkbPtr _getPoint (QPointF &pt, QgsRenderContext &context, QgsConstWkbPtr &wkb)
 Creates a point in screen coordinates from a wkb string in map coordinates. More...
 
static QgsConstWkbPtr _getPolygon (QPolygonF &pts, QList< QPolygonF > &holes, QgsRenderContext &context, QgsConstWkbPtr &wkb, bool clipToExtent=true)
 Creates a polygon in screen coordinates from a wkb string in map coordinates. More...
 
static void convertSymbolRotation (QgsSymbolV2 *symbol, const QString &field)
 
static void convertSymbolSizeScale (QgsSymbolV2 *symbol, QgsSymbolV2::ScaleMethod method, const QString &field)
 

Detailed Description

When drawing a vector layer with rule-based renderer, it goes through the rules and draws features with symbols from rules that match.

Definition at line 34 of file qgsrulebasedrendererv2.h.

Member Typedef Documentation

◆ RenderQueue

Definition at line 97 of file qgsrulebasedrendererv2.h.

◆ RuleList

Definition at line 99 of file qgsrulebasedrendererv2.h.

Member Enumeration Documentation

◆ FeatureFlags

Enumerator
FeatIsSelected 
FeatDrawMarkers 

Definition at line 39 of file qgsrulebasedrendererv2.h.

Constructor & Destructor Documentation

◆ QgsRuleBasedRendererV2() [1/2]

QgsRuleBasedRendererV2::QgsRuleBasedRendererV2 ( QgsRuleBasedRendererV2::Rule root)

Constructs the renderer from given tree of rules (takes ownership)

Definition at line 809 of file qgsrulebasedrendererv2.cpp.

◆ QgsRuleBasedRendererV2() [2/2]

QgsRuleBasedRendererV2::QgsRuleBasedRendererV2 ( QgsSymbolV2 defaultSymbol)

Constructor for convenience. Creates a root rule and adds a default rule with symbol (takes ownership)

Definition at line 815 of file qgsrulebasedrendererv2.cpp.

◆ ~QgsRuleBasedRendererV2()

QgsRuleBasedRendererV2::~QgsRuleBasedRendererV2 ( )

Definition at line 822 of file qgsrulebasedrendererv2.cpp.

Member Function Documentation

◆ capabilities()

virtual int QgsRuleBasedRendererV2::capabilities ( )
inlineoverridevirtual

returns bitwise OR-ed capabilities of the renderer

Reimplemented from QgsFeatureRendererV2.

Definition at line 500 of file qgsrulebasedrendererv2.h.

◆ checkLegendSymbolItem()

void QgsRuleBasedRendererV2::checkLegendSymbolItem ( const QString key,
bool  state = true 
)
overridevirtual

item in symbology was checked

Note
added in 2.5

Reimplemented from QgsFeatureRendererV2.

Definition at line 1021 of file qgsrulebasedrendererv2.cpp.

◆ clone()

QgsRuleBasedRendererV2 * QgsRuleBasedRendererV2::clone ( ) const
overridevirtual

Implements QgsFeatureRendererV2.

Definition at line 931 of file qgsrulebasedrendererv2.cpp.

◆ convertFromRenderer()

QgsRuleBasedRendererV2 * QgsRuleBasedRendererV2::convertFromRenderer ( const QgsFeatureRendererV2 renderer)
static

creates a QgsRuleBasedRendererV2 from an existing renderer.

Note
added in 2.5
Returns
a new renderer if the conversion was possible, otherwise 0.

Definition at line 1212 of file qgsrulebasedrendererv2.cpp.

◆ convertToDataDefinedSymbology()

void QgsRuleBasedRendererV2::convertToDataDefinedSymbology ( QgsSymbolV2 symbol,
const QString sizeScaleField,
const QString rotationField = QString() 
)
static

helper function to convert the size scale and rotation fields present in some other renderers to data defined symbology

Definition at line 1370 of file qgsrulebasedrendererv2.cpp.

◆ create()

QgsFeatureRendererV2 * QgsRuleBasedRendererV2::create ( QDomElement element)
static

Definition at line 1048 of file qgsrulebasedrendererv2.cpp.

◆ createFromSld()

QgsFeatureRendererV2 * QgsRuleBasedRendererV2::createFromSld ( QDomElement element,
QGis::GeometryType  geomType 
)
static

Definition at line 1071 of file qgsrulebasedrendererv2.cpp.

◆ dump()

QString QgsRuleBasedRendererV2::dump ( ) const
overridevirtual

for debugging

Reimplemented from QgsFeatureRendererV2.

Definition at line 1185 of file qgsrulebasedrendererv2.cpp.

◆ filter()

QString QgsRuleBasedRendererV2::filter ( const QgsFields fields = QgsFields())
overridevirtual

If a renderer does not require all the features this method may be overridden and return an expression used as where clause.

This will be called once after startRender() and before the first call to renderFeature(). By default this returns a null string and all features will be requested. You do not need to specify the extent in here, this is taken care of separately and will be combined with a filter returned from this method.

Returns
An expression used as where clause

Reimplemented from QgsFeatureRendererV2.

Definition at line 915 of file qgsrulebasedrendererv2.cpp.

◆ filterNeedsGeometry()

bool QgsRuleBasedRendererV2::filterNeedsGeometry ( ) const
overridevirtual

Returns true if this renderer requires the geometry to apply the filter.

Reimplemented from QgsFeatureRendererV2.

Definition at line 926 of file qgsrulebasedrendererv2.cpp.

◆ legendKeysForFeature()

QSet< QString > QgsRuleBasedRendererV2::legendKeysForFeature ( QgsFeature feature,
QgsRenderContext context 
)
overridevirtual

Return legend keys matching a specified feature.

Note
added in 2.14

Reimplemented from QgsFeatureRendererV2.

Definition at line 1207 of file qgsrulebasedrendererv2.cpp.

◆ legendSymbolItemChecked()

bool QgsRuleBasedRendererV2::legendSymbolItemChecked ( const QString key)
overridevirtual

items of symbology items in legend is checked

Note
added in 2.5

Reimplemented from QgsFeatureRendererV2.

Definition at line 1015 of file qgsrulebasedrendererv2.cpp.

◆ legendSymbolItems()

QgsLegendSymbolList QgsRuleBasedRendererV2::legendSymbolItems ( double  scaleDenominator = -1,
const QString rule = "" 
)
overridevirtual

return a list of item text / symbol

Note
not available in python bindings

Reimplemented from QgsFeatureRendererV2.

Definition at line 1037 of file qgsrulebasedrendererv2.cpp.

◆ legendSymbolItemsCheckable()

bool QgsRuleBasedRendererV2::legendSymbolItemsCheckable ( ) const
overridevirtual

items of symbology items in legend should be checkable

Note
added in 2.5

Reimplemented from QgsFeatureRendererV2.

Definition at line 1010 of file qgsrulebasedrendererv2.cpp.

◆ legendSymbolItemsV2()

QgsLegendSymbolListV2 QgsRuleBasedRendererV2::legendSymbolItemsV2 ( ) const
overridevirtual

Return a list of symbology items for the legend.

Better choice than legendSymbolItems(). Default fallback implementation just uses legendSymbolItems() implementation

Note
added in 2.6

Reimplemented from QgsFeatureRendererV2.

Definition at line 1042 of file qgsrulebasedrendererv2.cpp.

◆ legendSymbologyItems()

QgsLegendSymbologyList QgsRuleBasedRendererV2::legendSymbologyItems ( QSize  iconSize)
overridevirtual

return a list of symbology items for the legend

Reimplemented from QgsFeatureRendererV2.

Definition at line 997 of file qgsrulebasedrendererv2.cpp.

◆ originalSymbolsForFeature()

QgsSymbolV2List QgsRuleBasedRendererV2::originalSymbolsForFeature ( QgsFeature feat,
QgsRenderContext context 
)
overridevirtual

Equivalent of originalSymbolsForFeature() call extended to support renderers that may use more symbols per feature - similar to symbolsForFeature()

Note
added in 2.12
available in Python bindings as originalSymbolsForFeature2

Reimplemented from QgsFeatureRendererV2.

Definition at line 1202 of file qgsrulebasedrendererv2.cpp.

◆ refineRuleCategories()

void QgsRuleBasedRendererV2::refineRuleCategories ( QgsRuleBasedRendererV2::Rule initialRule,
QgsCategorizedSymbolRendererV2 r 
)
static

take a rule and create a list of new rules based on the categories from categorized symbol renderer

Definition at line 1105 of file qgsrulebasedrendererv2.cpp.

◆ refineRuleRanges()

void QgsRuleBasedRendererV2::refineRuleRanges ( QgsRuleBasedRendererV2::Rule initialRule,
QgsGraduatedSymbolRendererV2 r 
)
static

take a rule and create a list of new rules based on the ranges from graduated symbol renderer

Definition at line 1135 of file qgsrulebasedrendererv2.cpp.

◆ refineRuleScales()

void QgsRuleBasedRendererV2::refineRuleScales ( QgsRuleBasedRendererV2::Rule initialRule,
QList< int >  scales 
)
static

take a rule and create a list of new rules with intervals of scales given by the passed scale denominators

Definition at line 1166 of file qgsrulebasedrendererv2.cpp.

◆ renderFeature()

bool QgsRuleBasedRendererV2::renderFeature ( QgsFeature feature,
QgsRenderContext context,
int  layer = -1,
bool  selected = false,
bool  drawVertexMarker = false 
)
overridevirtual

Render a feature using this renderer in the given context.

Must be called between startRender() and stopRender() calls. Default implementation renders a symbol as determined by symbolForFeature() call. Returns true if the feature has been returned (this is used for example to determine whether the feature may be labelled).

If layer is not -1, the renderer should draw only a particula layer from symbols (in order to support symbol level rendering).

Reimplemented from QgsFeatureRendererV2.

Definition at line 834 of file qgsrulebasedrendererv2.cpp.

◆ rootRule()

Rule* QgsRuleBasedRendererV2::rootRule ( )
inline

Definition at line 504 of file qgsrulebasedrendererv2.h.

◆ save()

QDomElement QgsRuleBasedRendererV2::save ( QDomDocument doc)
overridevirtual

store renderer info to XML element

Reimplemented from QgsFeatureRendererV2.

Definition at line 967 of file qgsrulebasedrendererv2.cpp.

◆ setLegendSymbolItem()

void QgsRuleBasedRendererV2::setLegendSymbolItem ( const QString key,
QgsSymbolV2 symbol 
)
overridevirtual

Sets the symbol to be used for a legend symbol item.

Parameters
keyrule key for legend symbol
symbolnew symbol for legend item. Ownership is transferred to renderer.
Note
added in QGIS 2.14

Reimplemented from QgsFeatureRendererV2.

Definition at line 1028 of file qgsrulebasedrendererv2.cpp.

◆ startRender()

void QgsRuleBasedRendererV2::startRender ( QgsRenderContext context,
const QgsFields fields 
)
overridevirtual

Needs to be called when a new render cycle is started.

Parameters
contextAdditional information passed to the renderer about the job which will be rendered
fieldsThe fields available for rendering
Returns
Information passed back from the renderer that can e.g. be used to reduce the amount of requested features

Implements QgsFeatureRendererV2.

Definition at line 850 of file qgsrulebasedrendererv2.cpp.

◆ stopRender()

void QgsRuleBasedRendererV2::stopRender ( QgsRenderContext context)
overridevirtual

Needs to be called when a render cycle has finished to clean up.

Implements QgsFeatureRendererV2.

Definition at line 873 of file qgsrulebasedrendererv2.cpp.

◆ symbolForFeature()

QgsSymbolV2 * QgsRuleBasedRendererV2::symbolForFeature ( QgsFeature feature,
QgsRenderContext context 
)
overridevirtual

return symbol for current feature. Should not be used individually: there could be more symbols for a feature

Reimplemented from QgsFeatureRendererV2.

Definition at line 828 of file qgsrulebasedrendererv2.cpp.

◆ symbols()

QgsSymbolV2List QgsRuleBasedRendererV2::symbols ( QgsRenderContext context)
overridevirtual

Returns list of symbols used by the renderer.

Parameters
contextrender context
Note
added in QGIS 2.12
available in Python bindings as symbols2

Reimplemented from QgsFeatureRendererV2.

Definition at line 962 of file qgsrulebasedrendererv2.cpp.

◆ symbolsForFeature()

QgsSymbolV2List QgsRuleBasedRendererV2::symbolsForFeature ( QgsFeature feat,
QgsRenderContext context 
)
overridevirtual

return list of symbols used for rendering the feature.

For renderers that do not support MoreSymbolsPerFeature it is more efficient to use symbolForFeature()

Reimplemented from QgsFeatureRendererV2.

Definition at line 1197 of file qgsrulebasedrendererv2.cpp.

◆ toSld() [1/2]

void QgsRuleBasedRendererV2::toSld ( QDomDocument doc,
QDomElement element 
) const
overridevirtual

Writes the SLD element following the SLD v1.1 specs.

Reimplemented from QgsFeatureRendererV2.

Definition at line 951 of file qgsrulebasedrendererv2.cpp.

◆ toSld() [2/2]

void QgsRuleBasedRendererV2::toSld ( QDomDocument doc,
QDomElement element,
const QgsStringMap props 
) const
overridevirtual

Writes the SLD element following the SLD v1.1 specs.

Reimplemented from QgsFeatureRendererV2.

Definition at line 956 of file qgsrulebasedrendererv2.cpp.

◆ usedAttributes()

QList< QString > QgsRuleBasedRendererV2::usedAttributes ( )
overridevirtual

Returns a set of attributes required for this renderer.

TODO QGIS3: Change QList to QSet

Implements QgsFeatureRendererV2.

Definition at line 920 of file qgsrulebasedrendererv2.cpp.

◆ willRenderFeature()

bool QgsRuleBasedRendererV2::willRenderFeature ( QgsFeature feat,
QgsRenderContext context 
)
overridevirtual

return whether the renderer will render a feature or not.

Must be called between startRender() and stopRender() calls.

Reimplemented from QgsFeatureRendererV2.

Definition at line 1192 of file qgsrulebasedrendererv2.cpp.

Member Data Documentation

◆ mCurrentFeatures

QList<FeatureToRender> QgsRuleBasedRendererV2::mCurrentFeatures
protected

Definition at line 529 of file qgsrulebasedrendererv2.h.

◆ mFilter

QString QgsRuleBasedRendererV2::mFilter
protected

Definition at line 531 of file qgsrulebasedrendererv2.h.

◆ mRenderQueue

RenderQueue QgsRuleBasedRendererV2::mRenderQueue
protected

Definition at line 528 of file qgsrulebasedrendererv2.h.

◆ mRootRule

Rule* QgsRuleBasedRendererV2::mRootRule
protected

the root node with hierarchical list of rules

Definition at line 525 of file qgsrulebasedrendererv2.h.


The documentation for this class was generated from the following files: