QGIS API Documentation 3.41.0-Master (d5b93354e9c)
|
3 More...
#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 | |
Rule (QgsAbstract3DSymbol *symbol, const QString &filterExp=QString(), const QString &description=QString(), bool elseRule=false) | |
takes ownership of symbol, symbol may be nullptr | |
~Rule () | |
bool | active () const |
Returns if this rule is active. | |
void | appendChild (QgsRuleBased3DRenderer::Rule *rule) |
add child rule, take ownership, sets this as parent | |
QgsRuleBased3DRenderer::RuleList & | children () |
Returns all children rules of this rule. | |
const QgsRuleBased3DRenderer::RuleList & | children () const |
Returns all children rules of this rule. | |
QgsRuleBased3DRenderer::Rule * | clone () const |
clone this rule, return new instance | |
void | createHandlers (QgsVectorLayer *layer, RuleToHandlerMap &handlers) const |
add handlers | |
QgsRuleBased3DRenderer::RuleList | descendants () const |
Returns all children, grand-children, grand-grand-children, grand-gra... you get it. | |
QString | description () const |
A human readable description for this rule. | |
QString | filterExpression () const |
A filter that will check if this rule applies. | |
QgsRuleBased3DRenderer::Rule * | findRuleByKey (const QString &key) |
Find a rule thanks to its key. | |
const QgsRuleBased3DRenderer::Rule * | findRuleByKey (const QString &key) const |
Try to find a rule given its unique key. | |
void | insertChild (int i, QgsRuleBased3DRenderer::Rule *rule) |
add child rule, take ownership, sets this as parent | |
bool | isElse () const |
Check if this rule is an ELSE rule. | |
Rule & | operator= (const Rule &rh)=delete |
QgsRuleBased3DRenderer::Rule * | parent () |
The parent rule. | |
const QgsRuleBased3DRenderer::Rule * | parent () const |
The parent rule. | |
void | prepare (const Qgs3DRenderContext &context, QSet< QString > &attributeNames, const QgsVector3D &chunkOrigin, RuleToHandlerMap &handlers) const |
call prepare() on handlers and populate attributeNames | |
RegisterResult | registerFeature (QgsFeature &feature, Qgs3DRenderContext &context, RuleToHandlerMap &handlers) const |
register individual features | |
void | removeChildAt (int i) |
delete child rule | |
QString | ruleKey () const |
Unique rule identifier (for identification of rule within labeling, used as provider ID) | |
QDomElement | save (QDomDocument &doc, const QgsReadWriteContext &context) const |
store labeling info to XML element | |
void | setActive (bool state) |
Sets if this rule is active. | |
void | setDescription (const QString &description) |
Set a human readable description for this rule. | |
void | setFilterExpression (const QString &filterExp) |
Set the expression used to check if a given feature shall be rendered with this rule. | |
void | setIsElse (bool iselse) |
Sets if this rule is an ELSE rule. | |
void | setRuleKey (const QString &key) |
Override the assigned rule key (should be used just internally by rule-based renderer) | |
void | setSymbol (QgsAbstract3DSymbol *symbol) |
Sets new symbol (or nullptr ). Deletes old symbol if any. | |
QgsAbstract3DSymbol * | symbol () const |
Returns the labeling settings. | |
Static Public Member Functions | |
static QgsRuleBased3DRenderer::Rule * | create (const QDomElement &ruleElem, const QgsReadWriteContext &context) |
Create a rule from an XML definition. | |
3
A child rule for a QgsRuleBased3DRenderer
Definition at line 74 of file qgsrulebased3drenderer.h.
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 85 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 52 of file qgsrulebased3drenderer.cpp.
QgsRuleBased3DRenderer::Rule::~Rule | ( | ) |
Definition at line 62 of file qgsrulebased3drenderer.cpp.
|
delete |
|
inline |
Returns if this rule is active.
true
if the rule is active Definition at line 115 of file qgsrulebased3drenderer.h.
void QgsRuleBased3DRenderer::Rule::appendChild | ( | QgsRuleBased3DRenderer::Rule * | rule | ) |
add child rule, take ownership, sets this as parent
Definition at line 115 of file qgsrulebased3drenderer.cpp.
|
inline |
Returns all children rules of this rule.
Definition at line 175 of file qgsrulebased3drenderer.h.
|
inline |
Returns all children rules of this rule.
Definition at line 168 of file qgsrulebased3drenderer.h.
QgsRuleBased3DRenderer::Rule * QgsRuleBased3DRenderer::Rule::clone | ( | ) | const |
clone this rule, return new instance
Definition at line 166 of file qgsrulebased3drenderer.cpp.
|
static |
Create a rule from an XML definition.
ruleElem | The XML rule element |
context | reading context |
Definition at line 177 of file qgsrulebased3drenderer.cpp.
void QgsRuleBased3DRenderer::Rule::createHandlers | ( | QgsVectorLayer * | layer, |
QgsRuleBased3DRenderer::RuleToHandlerMap & | handlers | ||
) | const |
add handlers
Definition at line 246 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 76 of file qgsrulebased3drenderer.cpp.
|
inline |
A human readable description for this rule.
Definition at line 108 of file qgsrulebased3drenderer.h.
|
inline |
A filter that will check if this rule applies.
Definition at line 101 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 152 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 136 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 122 of file qgsrulebased3drenderer.cpp.
|
inline |
Check if this rule is an ELSE rule.
true
if this rule is an else rule Definition at line 122 of file qgsrulebased3drenderer.h.
|
inline |
|
inline |
void QgsRuleBased3DRenderer::Rule::prepare | ( | const Qgs3DRenderContext & | context, |
QSet< QString > & | attributeNames, | ||
const QgsVector3D & | chunkOrigin, | ||
QgsRuleBased3DRenderer::RuleToHandlerMap & | handlers | ||
) | const |
call prepare() on handlers and populate attributeNames
Definition at line 265 of file qgsrulebased3drenderer.cpp.
QgsRuleBased3DRenderer::Rule::RegisterResult QgsRuleBased3DRenderer::Rule::registerFeature | ( | QgsFeature & | feature, |
Qgs3DRenderContext & | context, | ||
QgsRuleBased3DRenderer::RuleToHandlerMap & | handlers | ||
) | const |
register individual features
Definition at line 290 of file qgsrulebased3drenderer.cpp.
void QgsRuleBased3DRenderer::Rule::removeChildAt | ( | int | i | ) |
delete child rule
Definition at line 129 of file qgsrulebased3drenderer.cpp.
|
inline |
Unique rule identifier (for identification of rule within labeling, used as provider ID)
Definition at line 125 of file qgsrulebased3drenderer.h.
QDomElement QgsRuleBased3DRenderer::Rule::save | ( | QDomDocument & | doc, |
const QgsReadWriteContext & | context | ||
) | const |
store labeling info to XML element
Definition at line 217 of file qgsrulebased3drenderer.cpp.
|
inline |
Sets if this rule is active.
state | Determines if the rule should be activated or deactivated |
Definition at line 148 of file qgsrulebased3drenderer.h.
|
inline |
Set a human readable description for this rule.
description | Description |
Definition at line 142 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 135 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 155 of file qgsrulebased3drenderer.h.
|
inline |
Override the assigned rule key (should be used just internally by rule-based renderer)
Definition at line 159 of file qgsrulebased3drenderer.h.
void QgsRuleBased3DRenderer::Rule::setSymbol | ( | QgsAbstract3DSymbol * | symbol | ) |
Sets new symbol (or nullptr
). Deletes old symbol if any.
Definition at line 68 of file qgsrulebased3drenderer.cpp.
|
inline |
Returns the labeling settings.
May return nullptr
.
Definition at line 95 of file qgsrulebased3drenderer.h.