15#ifndef QGSLABELINGENGINERULE_H
16#define QGSLABELINGENGINERULE_H
107 void setMapBoundaryGeometry(
const QgsGeometry &geometry );
137 if ( sipCpp->id() ==
"minimumDistanceLabelToFeature" )
139 sipType = sipType_QgsLabelingEngineRuleMinimumDistanceLabelToFeature;
141 else if ( sipCpp->id() ==
"minimumDistanceLabelToLabel" )
143 sipType = sipType_QgsLabelingEngineRuleMinimumDistanceLabelToLabel;
145 else if ( sipCpp->id() ==
"maximumDistanceLabelToFeature" )
147 sipType = sipType_QgsLabelingEngineRuleMaximumDistanceLabelToFeature;
149 else if ( sipCpp->id() ==
"avoidLabelOverlapWithFeature" )
151 sipType = sipType_QgsLabelingEngineRuleAvoidLabelOverlapWithFeature;
174 virtual QString
id()
const = 0;
189 virtual bool isAvailable()
const;
199 virtual QString description()
const;
209 QString
name()
const {
return mName; }
219 void setName(
const QString &name ) { mName = name; }
233 void setActive(
bool active );
263 virtual void resolveReferences(
const QgsProject *project );
305 bool mIsActive =
true;
Abstract base class for labeling engine rules.
virtual bool prepare(QgsRenderContext &context)=0
Prepares the rule.
virtual void readXml(const QDomElement &element, const QgsReadWriteContext &context)=0
Reads the rule properties from an XML element.
virtual void writeXml(QDomDocument &doc, QDomElement &element, const QgsReadWriteContext &context) const =0
Writes the rule properties to an XML element.
QString name() const
Returns the name for this instance of the rule.
virtual ~QgsAbstractLabelingEngineRule()
virtual QgsAbstractLabelingEngineRule * clone() const =0
Creates a clone of this rule.
virtual QString displayType() const =0
Returns a user-friendly, translated string representing the rule type.
void setName(const QString &name)
Sets the name for this instance of the rule.
virtual QString id() const =0
Returns a string uniquely identifying the rule subclass.
A geometry is the spatial representation of a feature.
Encapsulates the context for a labeling engine run.
QgsLabelingEngineContext & operator=(const QgsLabelingEngineContext &other)=delete
QgsLabelingEngineContext(const QgsLabelingEngineContext &other)=delete
QgsRenderContext & renderContext()
Returns a reference to the context's render context.
const QgsRenderContext & renderContext() const
Returns a reference to the context's render context.
Encapsulates a QGIS project, including sets of map layers and their styles, layouts,...
The class is used as a container of context for various read/write operations on other objects.
A rectangle specified with double values.
Contains information about the context of a rendering operation.
LabelPosition is a candidate feature label position.
#define SIP_CONVERT_TO_SUBCLASS_CODE(code)