16#ifndef QGSLAYOUTATLAS_H
17#define QGSLAYOUTATLAS_H
73 void setEnabled(
bool enabled );
85 void setHideCoverage(
bool hide );
101 void setLimitCoverageLayerRenderToCurrentFeature(
bool limit );
119 bool setFilenameExpression(
const QString &expression, QString &errorString
SIP_OUT );
126 QString currentFilename()
const;
151 void setPageNameExpression(
const QString &expression );
157 QString nameForPage(
int page )
const;
173 void setSortFeatures(
bool enabled );
195 void setSortAscending(
bool ascending );
217 void setSortExpression(
const QString &expression );
231 void setFilterFeatures(
bool filtered );
254 bool setFilterExpression(
const QString &expression, QString &errorString
SIP_OUT );
260 int updateFeatures();
264 int count()
const override;
265 QString
filePath(
const QString &baseFilePath,
const QString &extension )
override;
276 bool next()
override;
312 bool seekTo(
int feature );
326 void refreshCurrentFeature();
357 void removeLayers(
const QStringList &layers );
365 bool updateFilenameExpression( QString &error );
378 bool prepareForFeature(
int i );
380 QPointer< QgsLayout > mLayout;
382 bool mEnabled =
false;
383 bool mHideCoverage =
false;
384 bool mLimitCoverageLayerRenderToCurrentFeature =
false;
385 QString mFilenameExpressionString;
386 QString mFilenameExpressionError;
390 QString mCurrentFilename;
391 bool mSortFeatures =
false;
392 bool mSortAscending =
true;
394 typedef QMap< QgsFeatureId, QVariant > SorterKeys;
396 SorterKeys mFeatureKeys;
398 QString mSortExpression;
400 QString mPageNameExpression;
402 bool mFilterFeatures =
false;
403 QString mFilterExpression;
405 QString mFilterParserError;
408 QVector< QPair<QgsFeatureId, QString> > mFeatureIds;
410 int mCurrentFeatureNo = -1;
An abstract base class for QgsLayout based classes which can be exported by QgsLayoutExporter.
virtual bool endRender()=0
Ends the render, performing any required cleanup tasks.
virtual QgsLayout * layout()=0
Returns the layout associated with the iterator.
virtual bool next()=0
Iterates to next feature, returning false if no more features exist to iterate over.
virtual bool beginRender()=0
Called when rendering begins, before iteration commences.
virtual QString filePath(const QString &baseFilePath, const QString &extension)=0
Returns the file path for the current feature, based on a specified base file path and extension.
virtual int count() const =0
Returns the number of features to iterate over.
Abstract interface for generating an expression context.
virtual QgsExpressionContext createExpressionContext() const =0
This method needs to be reimplemented in all classes which implement this interface and return an exp...
Expression contexts are used to encapsulate the parameters around which a QgsExpression should be eva...
The feature class encapsulates a single feature including its unique ID, geometry and a list of field...
QString sortExpression() const
Returns the expression (or field name) to use for sorting features.
bool filterFeatures() const
Returns true if features should be filtered in the coverage layer.
QString filenameExpression() const
Returns the filename expression used for generating output filenames for each atlas page.
void toggled(bool enabled)
Emitted when atlas is enabled or disabled.
bool sortAscending() const
Returns true if features should be sorted in an ascending order.
bool hideCoverage() const
Returns true if the atlas is set to hide the coverage layer.
void featureChanged(const QgsFeature &feature)
Emitted when the current atlas feature changes.
friend class AtlasFeatureSorter
QString filterExpression() const
Returns the expression used for filtering features in the coverage layer.
QgsLayout * layout() override
Returns the layout associated with the iterator.
bool enabled() const
Returns whether the atlas generation is enabled.
bool limitCoverageLayerRenderToCurrentFeature() const
Returns true if the atlas is set to limit rendering on the coverage layer to the current feature.
QString pageNameExpression() const
Returns the expression (or field name) used for calculating the page name.
QgsLayoutAtlas(QgsLayout *layout)
Constructor for new QgsLayoutAtlas.
void numberFeaturesChanged(int numFeatures)
Emitted when the number of features for the atlas changes.
void messagePushed(const QString &message)
Emitted when the atlas has an updated status bar message.
void coverageLayerChanged(QgsVectorLayer *layer)
Emitted when the coverage layer for the atlas changes.
QgsVectorLayer * coverageLayer() const
Returns the coverage layer used for the atlas features.
void renderBegun()
Emitted when atlas rendering has begun.
void renderEnded()
Emitted when atlas rendering has ended.
void changed()
Emitted when one of the atlas parameters changes.
bool sortFeatures() const
Returns true if features should be sorted in the atlas.
int currentFeatureNumber() const
Returns the current feature number, where a value of 0 corresponds to the first feature.
An interface for layout objects which can be stored and read from DOM elements.
virtual bool writeXml(QDomElement &parentElement, QDomDocument &document, const QgsReadWriteContext &context) const =0
Stores the objects's state in a DOM element.
virtual bool readXml(const QDomElement &element, const QDomDocument &document, const QgsReadWriteContext &context)=0
Sets the objects's state from a DOM element.
virtual QString stringType() const =0
Returns the object type as a string.
Base class for layouts, which can contain items such as maps, labels, scalebars, etc.
A container for the context for various read/write operations on objects.
Represents a vector layer which manages a vector based dataset.
_LayerRef< QgsVectorLayer > QgsVectorLayerRef