QGIS API Documentation
2.6.0-Brighton
|
This class keeps data about a rules for rule-based renderer. More...
#include <qgsrulebasedrendererv2.h>
Public Member Functions | |
Rule (QgsSymbolV2 *symbol, int scaleMinDenom=0, int scaleMaxDenom=0, QString filterExp=QString(), QString label=QString(), QString description=QString(), bool elseRule=false) | |
Constructor takes ownership of the symbol. | |
~Rule () | |
QString | dump (int offset=0) const |
QSet< QString > | usedAttributes () |
QgsSymbolV2List | symbols () |
QgsLegendSymbolList | legendSymbolItems (double scaleDenominator=-1, QString rule="") |
QgsLegendSymbolListV2 | legendSymbolItemsV2 (int currentLevel=-1) const |
bool | isFilterOK (QgsFeature &f) const |
bool | isScaleOK (double scale) const |
QgsSymbolV2 * | symbol () |
QString | label () const |
bool | dependsOnScale () const |
int | scaleMinDenom () const |
int | scaleMaxDenom () const |
QgsExpression * | filter () const |
QString | filterExpression () const |
QString | description () const |
bool | checkState () const |
QString | ruleKey () const |
Unique rule identifier (for identification of rule within renderer) | |
void | setRuleKey (const QString &key) |
Override the assigned rule key (should be used just internally by rule-based renderer) | |
void | setSymbol (QgsSymbolV2 *sym) |
set a new symbol (or NULL). Deletes old symbol. | |
void | setLabel (QString label) |
void | setScaleMinDenom (int scaleMinDenom) |
void | setScaleMaxDenom (int scaleMaxDenom) |
void | setFilterExpression (QString filterExp) |
void | setDescription (QString description) |
void | setCheckState (bool state) |
Rule * | clone () const |
clone this rule, return new instance | |
void | toSld (QDomDocument &doc, QDomElement &element, QgsStringMap props) |
QDomElement | save (QDomDocument &doc, QgsSymbolV2Map &symbolMap) |
bool | startRender (QgsRenderContext &context, const QgsFields &fields) |
prepare the rule for rendering and its children (build active children array) | |
QSet< int > | collectZLevels () |
get all used z-levels from this rule and children | |
void | setNormZLevels (const QMap< int, int > &zLevelsToNormLevels) |
assign normalized z-levels [0..N-1] for this rule's symbol for quick access during rendering | |
bool | renderFeature (FeatureToRender &featToRender, QgsRenderContext &context, RenderQueue &renderQueue) |
bool | willRenderFeature (QgsFeature &feat) |
only tell whether a feature will be rendered without actually rendering it | |
QgsSymbolV2List | symbolsForFeature (QgsFeature &feat) |
tell which symbols will be used to render the feature | |
RuleList | rulesForFeature (QgsFeature &feat) |
tell which rules will be used to render the feature | |
void | stopRender (QgsRenderContext &context) |
RuleList & | children () |
RuleList | descendants () const |
Rule * | parent () |
void | appendChild (Rule *rule) |
add child rule, take ownership, sets this as parent | |
void | insertChild (int i, Rule *rule) |
add child rule, take ownership, sets this as parent | |
void | removeChild (Rule *rule) |
delete child rule | |
void | removeChildAt (int i) |
delete child rule | |
void | takeChild (Rule *rule) |
take child rule out, set parent as null | |
Rule * | takeChildAt (int i) |
take child rule out, set parent as null | |
Rule * | findRuleByKey (QString key) |
Try to find a rule given its unique key. | |
void | updateElseRules () |
void | setIsElse (bool iselse) |
bool | isElse () |
Static Public Member Functions | |
static Rule * | createFromSld (QDomElement &element, QGis::GeometryType geomType) |
static Rule * | create (QDomElement &ruleElem, QgsSymbolV2Map &symbolMap) |
Protected Member Functions | |
void | initFilter () |
Protected Attributes | |
Rule * | mParent |
QgsSymbolV2 * | mSymbol |
int | mScaleMinDenom |
int | mScaleMaxDenom |
QString | mFilterExp |
QString | mLabel |
QString | mDescription |
bool | mElseRule |
RuleList | mChildren |
RuleList | mElseRules |
bool | mCheckState |
QString | mRuleKey |
QgsExpression * | mFilter |
QList< int > | mSymbolNormZLevels |
RuleList | mActiveChildren |
This class keeps data about a rules for rule-based renderer.
A rule consists of a symbol, filter expression and range of scales. If filter is empty, it matches all features. If scale range has both values zero, it matches all scales. If one of the min/max scale denominators is zero, there is no lower/upper bound for scales. A rule matches if both filter and scale range match.
QgsRuleBasedRendererV2::Rule::Rule | ( | QgsSymbolV2 * | symbol, |
int | scaleMinDenom = 0 , |
||
int | scaleMaxDenom = 0 , |
||
QString | filterExp = QString() , |
||
QString | label = QString() , |
||
QString | description = QString() , |
||
bool | elseRule = false |
||
) |
Constructor takes ownership of the symbol.
QgsRuleBasedRendererV2::Rule::~Rule | ( | ) |
void QgsRuleBasedRendererV2::Rule::appendChild | ( | Rule * | rule | ) |
add child rule, take ownership, sets this as parent
|
inline |
|
inline |
QgsRuleBasedRendererV2::Rule * QgsRuleBasedRendererV2::Rule::clone | ( | ) | const |
clone this rule, return new instance
QSet< int > QgsRuleBasedRendererV2::Rule::collectZLevels | ( | ) |
get all used z-levels from this rule and children
|
static |
|
static |
|
inline |
|
inline |
|
inline |
QString QgsRuleBasedRendererV2::Rule::dump | ( | int | offset = 0 | ) | const |
|
inline |
|
inline |
QgsRuleBasedRendererV2::Rule * QgsRuleBasedRendererV2::Rule::findRuleByKey | ( | QString | key | ) |
Try to find a rule given its unique key.
|
protected |
void QgsRuleBasedRendererV2::Rule::insertChild | ( | int | i, |
Rule * | rule | ||
) |
add child rule, take ownership, sets this as parent
|
inline |
bool QgsRuleBasedRendererV2::Rule::isFilterOK | ( | QgsFeature & | f | ) | const |
bool QgsRuleBasedRendererV2::Rule::isScaleOK | ( | double | scale | ) | const |
|
inline |
QgsLegendSymbolList QgsRuleBasedRendererV2::Rule::legendSymbolItems | ( | double | scaleDenominator = -1 , |
QString | rule = "" |
||
) |
QgsLegendSymbolListV2 QgsRuleBasedRendererV2::Rule::legendSymbolItemsV2 | ( | int | currentLevel = -1 | ) | const |
|
inline |
void QgsRuleBasedRendererV2::Rule::removeChild | ( | Rule * | rule | ) |
delete child rule
void QgsRuleBasedRendererV2::Rule::removeChildAt | ( | int | i | ) |
delete child rule
bool QgsRuleBasedRendererV2::Rule::renderFeature | ( | QgsRuleBasedRendererV2::FeatureToRender & | featToRender, |
QgsRenderContext & | context, | ||
QgsRuleBasedRendererV2::RenderQueue & | renderQueue | ||
) |
|
inline |
Unique rule identifier (for identification of rule within renderer)
QgsRuleBasedRendererV2::RuleList QgsRuleBasedRendererV2::Rule::rulesForFeature | ( | QgsFeature & | feat | ) |
tell which rules will be used to render the feature
QDomElement QgsRuleBasedRendererV2::Rule::save | ( | QDomDocument & | doc, |
QgsSymbolV2Map & | symbolMap | ||
) |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
void QgsRuleBasedRendererV2::Rule::setNormZLevels | ( | const QMap< int, int > & | zLevelsToNormLevels | ) |
assign normalized z-levels [0..N-1] for this rule's symbol for quick access during rendering
|
inline |
Override the assigned rule key (should be used just internally by rule-based renderer)
|
inline |
|
inline |
void QgsRuleBasedRendererV2::Rule::setSymbol | ( | QgsSymbolV2 * | sym | ) |
set a new symbol (or NULL). Deletes old symbol.
bool QgsRuleBasedRendererV2::Rule::startRender | ( | QgsRenderContext & | context, |
const QgsFields & | fields | ||
) |
prepare the rule for rendering and its children (build active children array)
void QgsRuleBasedRendererV2::Rule::stopRender | ( | QgsRenderContext & | context | ) |
|
inline |
QgsSymbolV2List QgsRuleBasedRendererV2::Rule::symbols | ( | ) |
QgsSymbolV2List QgsRuleBasedRendererV2::Rule::symbolsForFeature | ( | QgsFeature & | feat | ) |
tell which symbols will be used to render the feature
void QgsRuleBasedRendererV2::Rule::takeChild | ( | Rule * | rule | ) |
take child rule out, set parent as null
QgsRuleBasedRendererV2::Rule * QgsRuleBasedRendererV2::Rule::takeChildAt | ( | int | i | ) |
take child rule out, set parent as null
void QgsRuleBasedRendererV2::Rule::toSld | ( | QDomDocument & | doc, |
QDomElement & | element, | ||
QgsStringMap | props | ||
) |
void QgsRuleBasedRendererV2::Rule::updateElseRules | ( | ) |
QSet< QString > QgsRuleBasedRendererV2::Rule::usedAttributes | ( | ) |
bool QgsRuleBasedRendererV2::Rule::willRenderFeature | ( | QgsFeature & | feat | ) |
only tell whether a feature will be rendered without actually rendering it
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |