QGIS API Documentation 3.41.0-Master (45a0abf3bec)
Loading...
Searching...
No Matches
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
 
 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::RuleListchildren ()
 Returns all children rules of this rule.
 
const QgsRuleBased3DRenderer::RuleListchildren () const
 Returns all children rules of this rule.
 
QgsRuleBased3DRenderer::Ruleclone () 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::RulefindRuleByKey (const QString &key)
 Find a rule thanks to its key.
 
const QgsRuleBased3DRenderer::RulefindRuleByKey (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.
 
Ruleoperator= (const Rule &rh)=delete
 
QgsRuleBased3DRenderer::Ruleparent ()
 The parent rule.
 
const QgsRuleBased3DRenderer::Ruleparent () 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.
 
QgsAbstract3DSymbolsymbol () const
 Returns the labeling settings.
 

Static Public Member Functions

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

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

◆ ~Rule()

QgsRuleBased3DRenderer::Rule::~Rule ( )

Definition at line 62 of file qgsrulebased3drenderer.cpp.

◆ Rule() [2/2]

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

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 115 of file qgsrulebased3drenderer.h.

◆ appendChild()

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

add child rule, take ownership, sets this as parent

Definition at line 115 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 175 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 168 of file qgsrulebased3drenderer.h.

◆ clone()

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

clone this rule, return new instance

Definition at line 166 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 177 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 246 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 76 of file qgsrulebased3drenderer.cpp.

◆ description()

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

A human readable description for this rule.

Returns
Description

Definition at line 108 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 101 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 152 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 136 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 122 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 122 of file qgsrulebased3drenderer.h.

◆ operator=()

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

◆ parent() [1/2]

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

The parent rule.

Returns
Parent rule

Definition at line 196 of file qgsrulebased3drenderer.h.

◆ parent() [2/2]

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

The parent rule.

Returns
Parent rule

Definition at line 189 of file qgsrulebased3drenderer.h.

◆ prepare()

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

call prepare() on handlers and populate attributeNames

Note
not available in Python bindings

Definition at line 265 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 290 of file qgsrulebased3drenderer.cpp.

◆ removeChildAt()

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

delete child rule

Definition at line 129 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 125 of file qgsrulebased3drenderer.h.

◆ save()

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

store labeling info to XML element

Definition at line 217 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 148 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 142 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 135 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 155 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 159 of file qgsrulebased3drenderer.h.

◆ setSymbol()

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

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

Definition at line 68 of file qgsrulebased3drenderer.cpp.

◆ symbol()

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

Returns the labeling settings.

May return nullptr.

Definition at line 95 of file qgsrulebased3drenderer.h.


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