| 
    QGIS API Documentation
    3.26.3-Buenos Aires (65e4edfdad)
    
   | 
 
 
 
 
Go to the documentation of this file.
   16 #ifndef QGSLAYOUTATLAS_H 
   17 #define QGSLAYOUTATLAS_H 
   19 #include "qgis_core.h" 
   73     void setEnabled( 
bool enabled );
 
   85     void setHideCoverage( 
bool hide );
 
  103     bool setFilenameExpression( 
const QString &expression, QString &errorString 
SIP_OUT );
 
  110     QString currentFilename() 
const;
 
  135     void setPageNameExpression( 
const QString &expression );
 
  141     QString nameForPage( 
int page ) 
const;
 
  157     void setSortFeatures( 
bool enabled );
 
  179     void setSortAscending( 
bool ascending );
 
  201     void setSortExpression( 
const QString &expression );
 
  215     void setFilterFeatures( 
bool filtered );
 
  238     bool setFilterExpression( 
const QString &expression, QString &errorString 
SIP_OUT );
 
  244     int updateFeatures();
 
  248     int count() 
const override;
 
  249     QString 
filePath( 
const QString &baseFilePath, 
const QString &extension ) 
override;
 
  260     bool next() 
override;
 
  296     bool seekTo( 
int feature );
 
  310     void refreshCurrentFeature();
 
  318     void toggled( 
bool );
 
  324     void messagePushed( 
const QString &message );
 
  329     void numberFeaturesChanged( 
int numFeatures );
 
  332     void featureChanged( 
const QgsFeature &feature );
 
  341     void removeLayers( 
const QStringList &layers );
 
  349     bool updateFilenameExpression( QString &error );
 
  362     bool prepareForFeature( 
int i );
 
  364     QPointer< QgsLayout > mLayout;
 
  366     bool mEnabled = 
false;
 
  367     bool mHideCoverage = 
false;
 
  368     QString mFilenameExpressionString;
 
  369     QString mFilenameExpressionError;
 
  373     QString mCurrentFilename;
 
  374     bool mSortFeatures = 
false;
 
  375     bool mSortAscending = 
true;
 
  377     typedef QMap< QgsFeatureId, QVariant > SorterKeys;
 
  379     SorterKeys mFeatureKeys;
 
  381     QString mSortExpression;
 
  383     QString mPageNameExpression;
 
  385     bool mFilterFeatures = 
false;
 
  386     QString mFilterExpression;
 
  388     QString mFilterParserError;
 
  391     QVector< QPair<QgsFeatureId, QString> > mFeatureIds;
 
  393     int mCurrentFeatureNo = -1;
 
  397     friend class AtlasFeatureSorter;
 
  400 #endif //QGSLAYOUTATLAS_H 
  
virtual int count() const =0
Returns the number of features to iterate over.
 
Expression contexts are used to encapsulate the parameters around which a QgsExpression should be eva...
 
virtual bool next()=0
Iterates to next feature, returning false if no more features exist to iterate over.
 
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.
 
QString sortExpression() const
Returns the expression (or field name) to use for sorting features.
 
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.
 
QString filterExpression() const
Returns the expression used for filtering features in the coverage layer.
 
bool filterFeatures() const
Returns true if features should be filtered 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.
 
virtual QgsLayout * layout()=0
Returns the layout associated with the iterator.
 
virtual bool endRender()=0
Ends the render, performing any required cleanup tasks.
 
QgsVectorLayer * coverageLayer() const
Returns the coverage layer used for the atlas features.
 
virtual QgsExpressionContext createExpressionContext() const =0
This method needs to be reimplemented in all classes which implement this interface and return an exp...
 
virtual bool writeXml(QDomElement &parentElement, QDomDocument &document, const QgsReadWriteContext &context) const =0
Stores the objects's state in a DOM element.
 
QString filenameExpression() const
Returns the filename expression used for generating output filenames for each atlas page.
 
virtual bool readXml(const QDomElement &element, const QDomDocument &document, const QgsReadWriteContext &context)=0
Sets the objects's state from a DOM element.
 
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.
 
Base class for layouts, which can contain items such as maps, labels, scalebars, etc.
 
Represents a vector layer which manages a vector based data sets.
 
virtual bool beginRender()=0
Called when rendering begins, before iteration commences.
 
The feature class encapsulates a single feature including its unique ID, geometry and a list of field...
 
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.
 
Abstract interface for generating an expression context.
 
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.
 
bool sortFeatures() const
Returns true if features should be sorted in the atlas.