QGIS API Documentation  3.20.0-Odense (decaadbb31)
Public Types | Public Member Functions | Static Public Member Functions | List of all members
QgsRuleBased3DRenderer::Rule Class Reference

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
 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::RuleListchildren ()
 Returns all children rules of this rule. More...
 
const QgsRuleBased3DRenderer::RuleListchildren () const
 Returns all children rules of this rule. More...
 
QgsRuleBased3DRenderer::Ruleclone () 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::RulefindRuleByKey (const QString &key)
 Find a rule thanks to its key. More...
 
const QgsRuleBased3DRenderer::RulefindRuleByKey (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...
 
Ruleoperator= (const Rule &rh)=delete
 Rules cannot be copied. More...
 
QgsRuleBased3DRenderer::Ruleparent ()
 The parent rule. More...
 
const QgsRuleBased3DRenderer::Ruleparent () 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...
 
QgsAbstract3DSymbolsymbol () const
 Returns the labeling settings. More...
 

Static Public Member Functions

static QgsRuleBased3DRenderer::Rulecreate (const QDomElement &ruleElem, const QgsReadWriteContext &context)
 Create a rule from an XML definition. More...
 

Detailed Description

3

A child rule for a QgsRuleBased3DRenderer

Since
QGIS 3.6

Definition at line 74 of file qgsrulebased3drenderer.h.

Member Enumeration Documentation

◆ RegisterResult

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.

Constructor & Destructor Documentation

◆ Rule() [1/2]

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 55 of file qgsrulebased3drenderer.cpp.

◆ ~Rule()

QgsRuleBased3DRenderer::Rule::~Rule ( )

Definition at line 65 of file qgsrulebased3drenderer.cpp.

◆ Rule() [2/2]

QgsRuleBased3DRenderer::Rule::Rule ( const Rule rh)
delete

Rules cannot be copied.

Member Function Documentation

◆ active()

bool QgsRuleBased3DRenderer::Rule::active ( ) const
inline

Returns if this rule is active.

Returns
true if the rule is active

Definition at line 117 of file qgsrulebased3drenderer.h.

◆ appendChild()

void QgsRuleBased3DRenderer::Rule::appendChild ( QgsRuleBased3DRenderer::Rule rule)

add child rule, take ownership, sets this as parent

Definition at line 118 of file qgsrulebased3drenderer.cpp.

◆ children() [1/2]

QgsRuleBased3DRenderer::RuleList& QgsRuleBased3DRenderer::Rule::children ( )
inline

Returns all children rules of this rule.

Returns
A list of rules

Definition at line 177 of file qgsrulebased3drenderer.h.

◆ children() [2/2]

const QgsRuleBased3DRenderer::RuleList& QgsRuleBased3DRenderer::Rule::children ( ) const
inline

Returns all children rules of this rule.

Returns
A list of rules

Definition at line 170 of file qgsrulebased3drenderer.h.

◆ clone()

QgsRuleBased3DRenderer::Rule * QgsRuleBased3DRenderer::Rule::clone ( ) const

clone this rule, return new instance

Definition at line 169 of file qgsrulebased3drenderer.cpp.

◆ create()

QgsRuleBased3DRenderer::Rule * QgsRuleBased3DRenderer::Rule::create ( const QDomElement &  ruleElem,
const QgsReadWriteContext context 
)
static

Create a rule from an XML definition.

Parameters
ruleElemThe XML rule element
contextreading context
Returns
A new rule

Definition at line 180 of file qgsrulebased3drenderer.cpp.

◆ createHandlers()

void QgsRuleBased3DRenderer::Rule::createHandlers ( QgsVectorLayer layer,
QgsRuleBased3DRenderer::RuleToHandlerMap handlers 
) const

add handlers

Note
not available in Python bindings

Definition at line 249 of file qgsrulebased3drenderer.cpp.

◆ descendants()

QgsRuleBased3DRenderer::RuleList QgsRuleBased3DRenderer::Rule::descendants ( ) const

Returns all children, grand-children, grand-grand-children, grand-gra...

you get it

Returns
A list of descendant rules

Definition at line 79 of file qgsrulebased3drenderer.cpp.

◆ description()

QString QgsRuleBased3DRenderer::Rule::description ( ) const
inline

A human readable description for this rule.

Returns
Description

Definition at line 110 of file qgsrulebased3drenderer.h.

◆ filterExpression()

QString QgsRuleBased3DRenderer::Rule::filterExpression ( ) const
inline

A filter that will check if this rule applies.

Returns
An expression

Definition at line 103 of file qgsrulebased3drenderer.h.

◆ findRuleByKey() [1/2]

QgsRuleBased3DRenderer::Rule * QgsRuleBased3DRenderer::Rule::findRuleByKey ( const QString &  key)

Find a rule thanks to its key.

Parameters
keyThe key of the rule to find
Returns
The rule or nullptr if not found

Definition at line 155 of file qgsrulebased3drenderer.cpp.

◆ findRuleByKey() [2/2]

const QgsRuleBased3DRenderer::Rule * QgsRuleBased3DRenderer::Rule::findRuleByKey ( const QString &  key) const

Try to find a rule given its unique key.

Definition at line 139 of file qgsrulebased3drenderer.cpp.

◆ insertChild()

void QgsRuleBased3DRenderer::Rule::insertChild ( int  i,
QgsRuleBased3DRenderer::Rule rule 
)

add child rule, take ownership, sets this as parent

Definition at line 125 of file qgsrulebased3drenderer.cpp.

◆ isElse()

bool QgsRuleBased3DRenderer::Rule::isElse ( ) const
inline

Check if this rule is an ELSE rule.

Returns
true if this rule is an else rule

Definition at line 124 of file qgsrulebased3drenderer.h.

◆ operator=()

Rule& QgsRuleBased3DRenderer::Rule::operator= ( const Rule rh)
delete

Rules cannot be copied.

◆ parent() [1/2]

QgsRuleBased3DRenderer::Rule* QgsRuleBased3DRenderer::Rule::parent ( )
inline

The parent rule.

Returns
Parent rule

Definition at line 198 of file qgsrulebased3drenderer.h.

◆ parent() [2/2]

const QgsRuleBased3DRenderer::Rule* QgsRuleBased3DRenderer::Rule::parent ( ) const
inline

The parent rule.

Returns
Parent rule

Definition at line 191 of file qgsrulebased3drenderer.h.

◆ prepare()

void QgsRuleBased3DRenderer::Rule::prepare ( const Qgs3DRenderContext &  context,
QSet< QString > &  attributeNames,
QgsRuleBased3DRenderer::RuleToHandlerMap handlers 
) const

call prepare() on handlers and populate attributeNames

Note
not available in Python bindings

Definition at line 268 of file qgsrulebased3drenderer.cpp.

◆ registerFeature()

QgsRuleBased3DRenderer::Rule::RegisterResult QgsRuleBased3DRenderer::Rule::registerFeature ( QgsFeature feature,
Qgs3DRenderContext &  context,
QgsRuleBased3DRenderer::RuleToHandlerMap handlers 
) const

register individual features

Note
not available in Python bindings

Definition at line 293 of file qgsrulebased3drenderer.cpp.

◆ removeChildAt()

void QgsRuleBased3DRenderer::Rule::removeChildAt ( int  i)

delete child rule

Definition at line 132 of file qgsrulebased3drenderer.cpp.

◆ ruleKey()

QString QgsRuleBased3DRenderer::Rule::ruleKey ( ) const
inline

Unique rule identifier (for identification of rule within labeling, used as provider ID)

Definition at line 127 of file qgsrulebased3drenderer.h.

◆ save()

QDomElement QgsRuleBased3DRenderer::Rule::save ( QDomDocument &  doc,
const QgsReadWriteContext context 
) const

store labeling info to XML element

Definition at line 220 of file qgsrulebased3drenderer.cpp.

◆ setActive()

void QgsRuleBased3DRenderer::Rule::setActive ( bool  state)
inline

Sets if this rule is active.

Parameters
stateDetermines if the rule should be activated or deactivated

Definition at line 150 of file qgsrulebased3drenderer.h.

◆ setDescription()

void QgsRuleBased3DRenderer::Rule::setDescription ( const QString &  description)
inline

Set a human readable description for this rule.

Parameters
descriptionDescription

Definition at line 144 of file qgsrulebased3drenderer.h.

◆ setFilterExpression()

void QgsRuleBased3DRenderer::Rule::setFilterExpression ( const QString &  filterExp)
inline

Set the expression used to check if a given feature shall be rendered with this rule.

Parameters
filterExpAn expression

Definition at line 137 of file qgsrulebased3drenderer.h.

◆ setIsElse()

void QgsRuleBased3DRenderer::Rule::setIsElse ( bool  iselse)
inline

Sets if this rule is an ELSE rule.

Parameters
iselseIf true, this rule is an ELSE rule

Definition at line 157 of file qgsrulebased3drenderer.h.

◆ setRuleKey()

void QgsRuleBased3DRenderer::Rule::setRuleKey ( const QString &  key)
inline

Override the assigned rule key (should be used just internally by rule-based renderer)

Definition at line 161 of file qgsrulebased3drenderer.h.

◆ setSymbol()

void QgsRuleBased3DRenderer::Rule::setSymbol ( QgsAbstract3DSymbol symbol)

Sets new symbol (or nullptr). Deletes old symbol if any.

Definition at line 71 of file qgsrulebased3drenderer.cpp.

◆ symbol()

QgsAbstract3DSymbol* QgsRuleBased3DRenderer::Rule::symbol ( ) const
inline

Returns the labeling settings.

May return nullptr.

Definition at line 97 of file qgsrulebased3drenderer.h.


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