15 #ifndef QGSRULEBASEDLABELING_H 16 #define QGSRULEBASEDLABELING_H 18 #include <QStringList> 76 bool dependsOnScale()
const {
return mScaleMinDenom != 0 || mScaleMaxDenom != 0; }
113 bool active()
const {
return mIsActive; }
119 bool isElse()
const {
return mElseRule; }
170 const RuleList&
children()
const {
return mChildren; }
191 void appendChild(
Rule* rule );
194 void insertChild(
int i,
Rule* rule );
197 void removeChildAt(
int i );
217 void createSubProviders(
QgsVectorLayer* layer, RuleToProviderMap& subProviders );
240 bool isScaleOK(
double scale )
const;
250 void updateElseRules();
286 virtual QString type()
const override;
326 #endif // QGSRULEBASEDLABELING_H Class for parsing and evaluation of expressions (formerly called "search strings").
QgsPalLayerSettings * settings() const
Get the labeling settings.
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
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.
A geometry is the spatial representation of a feature.
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
The minimum scale at which this label rule should be applied.
const Rule * parent() const
The parent rule.
const RuleList & children() const
Return all children rules of this rule.
bool dependsOnScale() const
Determines if scale based labeling is active.
void setScaleMinDenom(int scaleMinDenom)
Set the minimum denominator for which this rule shall apply.
bool active() const
Returns if this rule is active.
virtual void registerFeature(QgsFeature &feature, QgsRenderContext &context, QgsGeometry *obstacleGeometry=nullptr)
Register a feature for labeling as one or more QgsLabelFeature objects stored into mLabels...
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
The maximum scale denominator at which this label rule should be applied.
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.