16 #ifndef QGSLAYOUTATLAS_H 17 #define QGSLAYOUTATLAS_H 19 #include "qgis_core.h" 72 void setEnabled(
bool enabled );
84 void setHideCoverage(
bool hide );
102 bool setFilenameExpression(
const QString &expression, QString &errorString
SIP_OUT );
109 QString currentFilename()
const;
140 QString nameForPage(
int page )
const;
237 bool setFilterExpression(
const QString &expression, QString &errorString SIP_OUT );
243 int updateFeatures();
247 int count()
override;
248 QString
filePath(
const QString &baseFilePath,
const QString &extension )
override;
257 bool next()
override;
293 bool seekTo(
int feature );
307 void refreshCurrentFeature();
315 void toggled(
bool );
321 void messagePushed(
const QString &message );
326 void numberFeaturesChanged(
int numFeatures );
329 void featureChanged(
const QgsFeature &feature );
338 void removeLayers(
const QStringList &layers );
346 bool updateFilenameExpression( QString &error );
359 bool prepareForFeature(
int i );
361 QPointer< QgsLayout > mLayout;
363 bool mEnabled =
false;
364 bool mHideCoverage =
false;
365 QString mFilenameExpressionString;
370 QString mCurrentFilename;
371 bool mSortFeatures =
false;
372 bool mSortAscending =
true;
374 typedef QMap< QgsFeatureId, QVariant > SorterKeys;
376 SorterKeys mFeatureKeys;
378 QString mSortExpression;
380 QString mPageNameExpression;
382 bool mFilterFeatures =
false;
383 QString mFilterExpression;
385 QString mFilterParserError;
388 QVector< QPair<QgsFeatureId, QString> > mFeatureIds;
390 int mCurrentFeatureNo = -1;
395 friend class AtlasFeatureSorter;
398 #endif //QGSLAYOUTATLAS_H Class for parsing and evaluation of expressions (formerly called "search strings").
The class is used as a container of context for various read/write operations on other objects...
QString pageNameExpression() const
Returns the expression (or field name) used for calculating the page name.
bool filterFeatures() const
Returns true if features should be filtered in the coverage layer.
virtual bool writeXml(QDomElement &parentElement, QDomDocument &document, const QgsReadWriteContext &context) const =0
Stores the objects's state in a DOM element.
virtual bool endRender()=0
Ends the render, performing any required cleanup tasks.
int currentFeatureNumber() const
Returns the current feature number, where a value of 0 corresponds to the first feature.
void setSortAscending(bool ascending)
Sets whether features should be sorted in an ascending order.
virtual bool next()=0
Iterates to next feature, returning false if no more features exist to iterate over.
void setFilterFeatures(bool filtered)
Sets whether features should be filtered in the coverage layer.
The feature class encapsulates a single feature including its id, geometry and a list of field/values...
QString filenameExpression() const
Returns the filename expression used for generating output filenames for each atlas page...
void setSortExpression(const QString &expression)
Sets the expression (or field name) to use for sorting features.
QString filterExpression() const
Returns the expression used for filtering features in the coverage layer.
An abstract base class for QgsLayout based classes which can be exported by QgsLayoutExporter.
bool enabled() const
Returns whether the atlas generation is enabled.
bool sortFeatures() const
Returns true if features should be sorted in the atlas.
Expression contexts are used to encapsulate the parameters around which a QgsExpression should be eva...
Class used to render QgsLayout as an atlas, by iterating over the features from an associated vector ...
virtual QString stringType() const =0
Returns the object type as a string.
virtual int count()=0
Returns the number of features to iterate over.
virtual QgsLayout * layout()=0
Returns the layout associated with the iterator.
Base class for layouts, which can contain items such as maps, labels, scalebars, etc.
bool hideCoverage() const
Returns true if the atlas is set to hide the coverage layer.
bool sortAscending() const
Returns true if features should be sorted in an ascending order.
An interface for layout objects which can be stored and read from DOM elements.
virtual bool readXml(const QDomElement &element, const QDomDocument &document, const QgsReadWriteContext &context)=0
Sets the objects's state from a DOM element.
void setSortFeatures(bool enabled)
Sets whether features should be sorted in the atlas.
QString sortExpression() const
Returns the expression (or field name) to use for sorting features.
void setPageNameExpression(const QString &expression)
Sets the expression (or field name) used for calculating the page name.
Represents a vector layer which manages a vector based data sets.
virtual bool beginRender()=0
Called when rendering begins, before iteration commences.
QgsVectorLayer * coverageLayer() const
Returns the coverage layer used for the atlas features.
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...