QGIS API Documentation
3.14.0-Pi (9f7028fd23)
|
#include <qgsrulebased3drenderer.h>
Public Types | |
enum | RegisterResult { Filtered = 0, Inactive, Registered } |
The result of registering a rule. More... | |
Public Member Functions | |
Rule (const Rule &rh)=delete | |
Rules cannot be copied. More... | |
Rule (QgsAbstract3DSymbol *symbol, const QString &filterExp=QString(), const QString &description=QString(), bool elseRule=false) | |
takes ownership of symbol, symbol may be nullptr More... | |
~Rule () | |
bool | active () const |
Returns if this rule is active. More... | |
void | appendChild (QgsRuleBased3DRenderer::Rule *rule) |
add child rule, take ownership, sets this as parent More... | |
QgsRuleBased3DRenderer::RuleList & | children () |
Returns all children rules of this rule. More... | |
const QgsRuleBased3DRenderer::RuleList & | children () const |
Returns all children rules of this rule. More... | |
QgsRuleBased3DRenderer::Rule * | clone () const |
clone this rule, return new instance More... | |
void | createHandlers (QgsVectorLayer *layer, RuleToHandlerMap &handlers) const |
add handlers More... | |
QgsRuleBased3DRenderer::RuleList | descendants () const |
Returns all children, grand-children, grand-grand-children, grand-gra... More... | |
QString | description () const |
A human readable description for this rule. More... | |
QString | filterExpression () const |
A filter that will check if this rule applies. More... | |
QgsRuleBased3DRenderer::Rule * | findRuleByKey (const QString &key) |
Find a rule thanks to its key. More... | |
const QgsRuleBased3DRenderer::Rule * | findRuleByKey (const QString &key) const |
Try to find a rule given its unique key. More... | |
void | insertChild (int i, QgsRuleBased3DRenderer::Rule *rule) |
add child rule, take ownership, sets this as parent More... | |
bool | isElse () const |
Check if this rule is an ELSE rule. More... | |
Rule & | operator= (const Rule &rh)=delete |
Rules cannot be copied. More... | |
QgsRuleBased3DRenderer::Rule * | parent () |
The parent rule. More... | |
const QgsRuleBased3DRenderer::Rule * | parent () const |
The parent rule. More... | |
void | prepare (const Qgs3DRenderContext &context, QSet< QString > &attributeNames, RuleToHandlerMap &handlers) const |
call prepare() on handlers and populate attributeNames More... | |
RegisterResult | registerFeature (QgsFeature &feature, Qgs3DRenderContext &context, RuleToHandlerMap &handlers) const |
register individual features More... | |
void | removeChildAt (int i) |
delete child rule More... | |
QString | ruleKey () const |
Unique rule identifier (for identification of rule within labeling, used as provider ID) More... | |
QDomElement | save (QDomDocument &doc, const QgsReadWriteContext &context) const |
store labeling info to XML element More... | |
void | setActive (bool state) |
Sets if this rule is active. More... | |
void | setDescription (const QString &description) |
Set a human readable description for this rule. More... | |
void | setFilterExpression (const QString &filterExp) |
Set the expression used to check if a given feature shall be rendered with this rule. More... | |
void | setIsElse (bool iselse) |
Sets if this rule is an ELSE rule. More... | |
void | setRuleKey (const QString &key) |
Override the assigned rule key (should be used just internally by rule-based renderer) More... | |
void | setSymbol (QgsAbstract3DSymbol *symbol) |
Sets new symbol (or nullptr ). Deletes old symbol if any. More... | |
QgsAbstract3DSymbol * | symbol () const |
Returns the labeling settings. More... | |
Static Public Member Functions | |
static QgsRuleBased3DRenderer::Rule * | create (const QDomElement &ruleElem, const QgsReadWriteContext &context) |
Create a rule from an XML definition. More... | |
The result of registering a rule.
Enumerator | |
---|---|
Filtered | The rule does not apply. |
Inactive | The rule is inactive. |
Registered | Something was registered. |
Definition at line 87 of file qgsrulebased3drenderer.h.
QgsRuleBased3DRenderer::Rule::Rule | ( | QgsAbstract3DSymbol * | symbol, |
const QString & | filterExp = QString() , |
||
const QString & | description = QString() , |
||
bool | elseRule = false |
||
) |
takes ownership of symbol, symbol may be nullptr
Definition at line 56 of file qgsrulebased3drenderer.cpp.
QgsRuleBased3DRenderer::Rule::~Rule | ( | ) |
Definition at line 66 of file qgsrulebased3drenderer.cpp.
|
delete |
Rules cannot be copied.
|
inline |
Returns if this rule is active.
true
if the rule is active Definition at line 117 of file qgsrulebased3drenderer.h.
void QgsRuleBased3DRenderer::Rule::appendChild | ( | QgsRuleBased3DRenderer::Rule * | rule | ) |
add child rule, take ownership, sets this as parent
Definition at line 119 of file qgsrulebased3drenderer.cpp.
|
inline |
Returns all children rules of this rule.
Definition at line 177 of file qgsrulebased3drenderer.h.
|
inline |
Returns all children rules of this rule.
Definition at line 170 of file qgsrulebased3drenderer.h.
QgsRuleBased3DRenderer::Rule * QgsRuleBased3DRenderer::Rule::clone | ( | ) | const |
clone this rule, return new instance
Definition at line 170 of file qgsrulebased3drenderer.cpp.
|
static |
Create a rule from an XML definition.
ruleElem | The XML rule element |
context | reading context |
Definition at line 181 of file qgsrulebased3drenderer.cpp.
void QgsRuleBased3DRenderer::Rule::createHandlers | ( | QgsVectorLayer * | layer, |
QgsRuleBased3DRenderer::RuleToHandlerMap & | handlers | ||
) | const |
add handlers
Definition at line 256 of file qgsrulebased3drenderer.cpp.
QgsRuleBased3DRenderer::RuleList QgsRuleBased3DRenderer::Rule::descendants | ( | ) | const |
Returns all children, grand-children, grand-grand-children, grand-gra...
you get it
Definition at line 80 of file qgsrulebased3drenderer.cpp.
|
inline |
A human readable description for this rule.
Definition at line 110 of file qgsrulebased3drenderer.h.
|
inline |
A filter that will check if this rule applies.
Definition at line 103 of file qgsrulebased3drenderer.h.
QgsRuleBased3DRenderer::Rule * QgsRuleBased3DRenderer::Rule::findRuleByKey | ( | const QString & | key | ) |
Find a rule thanks to its key.
key | The key of the rule to find |
nullptr
if not found Definition at line 156 of file qgsrulebased3drenderer.cpp.
const QgsRuleBased3DRenderer::Rule * QgsRuleBased3DRenderer::Rule::findRuleByKey | ( | const QString & | key | ) | const |
Try to find a rule given its unique key.
Definition at line 140 of file qgsrulebased3drenderer.cpp.
void QgsRuleBased3DRenderer::Rule::insertChild | ( | int | i, |
QgsRuleBased3DRenderer::Rule * | rule | ||
) |
add child rule, take ownership, sets this as parent
Definition at line 126 of file qgsrulebased3drenderer.cpp.
|
inline |
Check if this rule is an ELSE rule.
true
if this rule is an else rule Definition at line 124 of file qgsrulebased3drenderer.h.
|
inline |
|
inline |
void QgsRuleBased3DRenderer::Rule::prepare | ( | const Qgs3DRenderContext & | context, |
QSet< QString > & | attributeNames, | ||
QgsRuleBased3DRenderer::RuleToHandlerMap & | handlers | ||
) | const |
call prepare() on handlers and populate attributeNames
Definition at line 288 of file qgsrulebased3drenderer.cpp.
QgsRuleBased3DRenderer::Rule::RegisterResult QgsRuleBased3DRenderer::Rule::registerFeature | ( | QgsFeature & | feature, |
Qgs3DRenderContext & | context, | ||
QgsRuleBased3DRenderer::RuleToHandlerMap & | handlers | ||
) | const |
register individual features
Definition at line 313 of file qgsrulebased3drenderer.cpp.
void QgsRuleBased3DRenderer::Rule::removeChildAt | ( | int | i | ) |
delete child rule
Definition at line 133 of file qgsrulebased3drenderer.cpp.
|
inline |
Unique rule identifier (for identification of rule within labeling, used as provider ID)
Definition at line 127 of file qgsrulebased3drenderer.h.
QDomElement QgsRuleBased3DRenderer::Rule::save | ( | QDomDocument & | doc, |
const QgsReadWriteContext & | context | ||
) | const |
store labeling info to XML element
Definition at line 227 of file qgsrulebased3drenderer.cpp.
|
inline |
Sets if this rule is active.
state | Determines if the rule should be activated or deactivated |
Definition at line 150 of file qgsrulebased3drenderer.h.
|
inline |
Set a human readable description for this rule.
description | Description |
Definition at line 144 of file qgsrulebased3drenderer.h.
|
inline |
Set the expression used to check if a given feature shall be rendered with this rule.
filterExp | An expression |
Definition at line 137 of file qgsrulebased3drenderer.h.
|
inline |
Sets if this rule is an ELSE rule.
iselse | If true , this rule is an ELSE rule |
Definition at line 157 of file qgsrulebased3drenderer.h.
|
inline |
Override the assigned rule key (should be used just internally by rule-based renderer)
Definition at line 161 of file qgsrulebased3drenderer.h.
void QgsRuleBased3DRenderer::Rule::setSymbol | ( | QgsAbstract3DSymbol * | symbol | ) |
Sets new symbol (or nullptr
). Deletes old symbol if any.
Definition at line 72 of file qgsrulebased3drenderer.cpp.
|
inline |
Returns the labeling settings.
May return nullptr
.
Definition at line 97 of file qgsrulebased3drenderer.h.