1 #ifndef QGSRULEBASEDLABELING_H
2 #define QGSRULEBASEDLABELING_H
41 bool dependsOnScale()
const {
return mScaleMinDenom != 0 || mScaleMaxDenom != 0; }
60 bool active()
const {
return mIsActive; }
66 bool isElse()
const {
return mElseRule; }
117 const RuleList&
children()
const {
return mChildren; }
138 void appendChild(
Rule* rule );
141 void insertChild(
int i,
Rule* rule );
144 void removeChildAt(
int i );
164 void createSubProviders(
QgsVectorLayer* layer, RuleToProviderMap& subProviders );
187 bool isScaleOK(
double scale )
const;
194 void updateElseRules();
225 virtual QString type()
const override;
261 #endif // QGSRULEBASEDLABELING_H
Class for parsing and evaluation of expressions (formerly called "search strings").
QgsPalLayerSettings * settings() const
bool isElse() const
Check if this rule is an ELSE rule.
void setFilterExpression(const QString &filterExp)
Set the expression used to check if a given feature shall be rendered with this rule.
QgsRuleBasedLabeling::RuleToProviderMap mSubProviders
label providers are owned by labeling engine
virtual void registerFeature(QgsFeature &feature, QgsRenderContext &context)
Register a feature for labeling as one or more QgsLabelFeature objects stored into mLabels...
QString description() const
A human readable description for this rule.
RegisterResult
The result of registering a rule.
QString filterExpression() const
A filter that will check if this rule applies.
The QgsVectorLayerLabelProvider class implements a label provider for vector layers.
Rule * parent()
The parent rule.
QMap< Rule *, QgsVectorLayerLabelProvider * > RuleToProviderMap
The feature class encapsulates a single feature including its id, geometry and a list of field/values...
virtual QList< QgsAbstractLabelProvider * > subProviders()
Return list of child providers - useful if the provider needs to put labels into more layers with dif...
virtual bool prepare(const QgsRenderContext &context, QStringList &attributeNames)
Prepare for registration of features.
int scaleMinDenom() const
const Rule * parent() const
The parent rule.
const RuleList & children() const
Return all children rules of this rule.
bool dependsOnScale() const
void setScaleMinDenom(int scaleMinDenom)
Set the minimum denominator for which this rule shall apply.
bool active() const
Returns if this rule is active.
void setActive(bool state)
Sets if this rule is active.
QgsPalLayerSettings * mSettings
const Rule * rootRule() const
Contains information about the context of a rendering operation.
QgsRuleBasedLabeling mRules
owned copy
Abstract base class - its implementations define different approaches to the labeling of a vector lay...
void setDescription(const QString &description)
Set a human readable description for this rule.
void setScaleMaxDenom(int scaleMaxDenom)
Set the maximum denominator for which this rule shall apply.
int scaleMaxDenom() const
void setIsElse(bool iselse)
Sets if this rule is an ELSE rule.
RuleList & children()
Return all children rules of this rule.
Represents a vector layer which manages a vector based data sets.