QGIS API Documentation
2.8.2-Wien
|
Class used to render an Atlas, iterating over geometry features. More...
#include <qgsatlascomposition.h>
Public Types | |
typedef QMap< QgsFeatureId, QVariant > | SorterKeys |
Public Slots | |
void | firstFeature () |
void | lastFeature () |
void | nextFeature () |
void | prevFeature () |
void | refreshFeature () |
Refreshes the current atlas feature, by refetching its attributes from the vector layer provider. |
Signals | |
void | coverageLayerChanged (QgsVectorLayer *layer) |
Is emitted when the coverage layer for an atlas changes. | |
void | featureChanged (QgsFeature *feature) |
Is emitted when the current atlas feature changes. | |
void | parameterChanged () |
emitted when one of the parameters changes | |
void | renderBegun () |
Is emitted when atlas rendering has begun. | |
void | renderEnded () |
Is emitted when atlas rendering has ended. | |
void | statusMsgChanged (QString message) |
Is emitted when the atlas has an updated status bar message for the composer window. | |
void | toggled (bool) |
emitted when atlas is enabled or disabled |
Public Member Functions | |
QgsAtlasComposition (QgsComposition *composition) | |
~QgsAtlasComposition () | |
bool | beginRender () |
Begins the rendering. | |
Q_DECL_DEPRECATED QgsComposerMap * | composerMap () const |
Returns the map used by the atlas. | |
QgsComposition * | composition () |
QgsVectorLayer * | coverageLayer () const |
Returns the coverage layer used for the atlas features. | |
QgsFeature * | currentFeature () |
Returns the current atlas feature. | |
const QString & | currentFilename () const |
Returns the current filename. | |
bool | enabled () const |
Returns whether the atlas generation is enabled. | |
void | endRender () |
Ends the rendering. | |
QString | featureFilter () const |
QString | featureFilterErrorString () const |
Returns an error string from parsing the feature filter expression. | |
QString | filenamePattern () const |
Returns the filename expression used for generating output filenames for each atlas page. | |
QString | filenamePatternErrorString () const |
Returns an error string from parsing the filename expression. | |
bool | filterFeatures () const |
Q_DECL_DEPRECATED bool | fixedScale () const |
Returns whether the atlas map uses a fixed scale. | |
bool | hideCoverage () const |
Returns true if the atlas is set to hide the coverage layer. | |
Q_DECL_DEPRECATED float | margin () const |
Returns the margin for the atlas map. | |
int | numFeatures () const |
Returns the number of features in the coverage layer. | |
const QVector< qreal > & | predefinedScales () const |
Returns the current list of predefined scales for the atlas. | |
bool | prepareForFeature (const int i, const bool updateMaps=true) |
Prepare the atlas map for the given feature. | |
bool | prepareForFeature (const QgsFeature *feat) |
Prepare the atlas map for the given feature. | |
void | prepareMap (QgsComposerMap *map) |
Recalculates the bounds of an atlas driven map. | |
void | readXML (const QDomElement &elem, const QDomDocument &doc) |
Reads general atlas settings from xml. | |
void | readXMLMapSettings (const QDomElement &elem, const QDomDocument &doc) |
Reads old (pre 2.2) map related atlas settings from xml. | |
Q_DECL_DEPRECATED void | setComposerMap (QgsComposerMap *map) |
Sets the map used by the atlas. | |
void | setCoverageLayer (QgsVectorLayer *layer) |
Sets the coverage layer to use for the atlas features. | |
void | setEnabled (bool enabled) |
Sets whether the atlas is enabled. | |
void | setFeatureFilter (const QString &expression) |
bool | setFilenamePattern (const QString &pattern) |
Sets the filename expression used for generating output filenames for each atlas page. | |
void | setFilterFeatures (bool doFilter) |
Q_DECL_DEPRECATED void | setFixedScale (bool fixed) |
Sets whether the atlas map should use a fixed scale. | |
void | setHideCoverage (bool hide) |
Sets whether the coverage layer should be hidden in map items in the composition. | |
Q_DECL_DEPRECATED void | setMargin (float margin) |
Sets the margin for the atlas map. | |
void | setPredefinedScales (const QVector< qreal > &scales) |
Sets the list of predefined scales for the atlas. | |
void | setSingleFile (bool single) |
Sets whether the atlas should be exported to a single file. | |
void | setSortAscending (bool ascending) |
void | setSortFeatures (bool doSort) |
Q_DECL_DEPRECATED void | setSortKeyAttributeIndex (int idx) |
void | setSortKeyAttributeName (QString fieldName) |
bool | singleFile () const |
Returns whether the atlas will be exported to a single file. | |
bool | sortAscending () const |
bool | sortFeatures () const |
Q_DECL_DEPRECATED int | sortKeyAttributeIndex () const |
QString | sortKeyAttributeName () const |
int | updateFeatures () |
Requeries the current atlas coverage layer and applies filtering and sorting. | |
void | writeXML (QDomElement &elem, QDomDocument &doc) const |
Class used to render an Atlas, iterating over geometry features.
prepareForFeature() modifies the atlas map's extent to zoom on the given feature. This class is used for printing, exporting to PDF and images.
Definition at line 41 of file qgsatlascomposition.h.
typedef QMap< QgsFeatureId, QVariant > QgsAtlasComposition::SorterKeys |
Definition at line 316 of file qgsatlascomposition.h.
QgsAtlasComposition::QgsAtlasComposition | ( | QgsComposition * | composition | ) |
Definition at line 31 of file qgsatlascomposition.cpp.
QgsAtlasComposition::~QgsAtlasComposition | ( | ) |
Definition at line 55 of file qgsatlascomposition.cpp.
bool QgsAtlasComposition::beginRender | ( | ) |
Begins the rendering.
Returns true if successful, false if no matching atlas features found.
Definition at line 278 of file qgsatlascomposition.cpp.
QgsComposerMap * QgsAtlasComposition::composerMap | ( | ) | const |
Returns the map used by the atlas.
Definition at line 116 of file qgsatlascomposition.cpp.
|
inline |
Definition at line 240 of file qgsatlascomposition.h.
|
inline |
Returns the coverage layer used for the atlas features.
Definition at line 132 of file qgsatlascomposition.h.
|
signal |
Is emitted when the coverage layer for an atlas changes.
|
inline |
Returns the current atlas feature.
Must be called after prepareForFeature( i ).
Definition at line 247 of file qgsatlascomposition.h.
const QString & QgsAtlasComposition::currentFilename | ( | ) | const |
Returns the current filename.
Must be called after prepareForFeature( i )
Definition at line 626 of file qgsatlascomposition.cpp.
|
inline |
Returns whether the atlas generation is enabled.
Definition at line 52 of file qgsatlascomposition.h.
void QgsAtlasComposition::endRender | ( | ) |
Ends the rendering.
Restores original extent
Definition at line 301 of file qgsatlascomposition.cpp.
|
signal |
Is emitted when the current atlas feature changes.
|
inline |
Definition at line 165 of file qgsatlascomposition.h.
|
inline |
Returns an error string from parsing the feature filter expression.
Definition at line 173 of file qgsatlascomposition.h.
|
inline |
Returns the filename expression used for generating output filenames for each atlas page.
Definition at line 109 of file qgsatlascomposition.h.
|
inline |
Returns an error string from parsing the filename expression.
Definition at line 126 of file qgsatlascomposition.h.
|
inline |
Definition at line 162 of file qgsatlascomposition.h.
|
slot |
Definition at line 359 of file qgsatlascomposition.cpp.
Q_NOWARN_DEPRECATED_PUSH bool QgsAtlasComposition::fixedScale | ( | ) | const |
Returns whether the atlas map uses a fixed scale.
Definition at line 833 of file qgsatlascomposition.cpp.
|
inline |
Returns true if the atlas is set to hide the coverage layer.
Definition at line 74 of file qgsatlascomposition.h.
|
slot |
Definition at line 364 of file qgsatlascomposition.cpp.
float QgsAtlasComposition::margin | ( | ) | const |
Returns the margin for the atlas map.
Definition at line 857 of file qgsatlascomposition.cpp.
|
slot |
Definition at line 337 of file qgsatlascomposition.cpp.
int QgsAtlasComposition::numFeatures | ( | ) | const |
Returns the number of features in the coverage layer.
Definition at line 332 of file qgsatlascomposition.cpp.
|
signal |
emitted when one of the parameters changes
|
inline |
Returns the current list of predefined scales for the atlas.
This is used for maps which are set to the predefined atlas scaling mode.
Definition at line 187 of file qgsatlascomposition.h.
bool QgsAtlasComposition::prepareForFeature | ( | const int | i, |
const bool | updateMaps = true |
||
) |
Prepare the atlas map for the given feature.
Sets the extent and context variables
i | feature number |
updateMaps | set to true to redraw maps and recalculate their extent |
Definition at line 386 of file qgsatlascomposition.cpp.
bool QgsAtlasComposition::prepareForFeature | ( | const QgsFeature * | feat | ) |
Prepare the atlas map for the given feature.
Sets the extent and context variables
Definition at line 369 of file qgsatlascomposition.cpp.
void QgsAtlasComposition::prepareMap | ( | QgsComposerMap * | map | ) |
Recalculates the bounds of an atlas driven map.
Definition at line 498 of file qgsatlascomposition.cpp.
|
slot |
Definition at line 348 of file qgsatlascomposition.cpp.
void QgsAtlasComposition::readXML | ( | const QDomElement & | elem, |
const QDomDocument & | doc | ||
) |
Reads general atlas settings from xml.
elem | a QDomElement holding the atlas properties. |
doc | QDomDocument for the source xml. |
Definition at line 668 of file qgsatlascomposition.cpp.
void QgsAtlasComposition::readXMLMapSettings | ( | const QDomElement & | elem, |
const QDomDocument & | doc | ||
) |
Reads old (pre 2.2) map related atlas settings from xml.
elem | a QDomElement holding the atlas map properties. |
doc | QDomDocument for the source xml. |
Definition at line 723 of file qgsatlascomposition.cpp.
|
slot |
Refreshes the current atlas feature, by refetching its attributes from the vector layer provider.
Definition at line 381 of file qgsatlascomposition.cpp.
|
signal |
Is emitted when atlas rendering has begun.
|
signal |
Is emitted when atlas rendering has ended.
void QgsAtlasComposition::setComposerMap | ( | QgsComposerMap * | map | ) |
Sets the map used by the atlas.
Definition at line 135 of file qgsatlascomposition.cpp.
void QgsAtlasComposition::setCoverageLayer | ( | QgsVectorLayer * | layer | ) |
Sets the coverage layer to use for the atlas features.
layer | vector coverage layer |
Definition at line 91 of file qgsatlascomposition.cpp.
void QgsAtlasComposition::setEnabled | ( | bool | enabled | ) |
Sets whether the atlas is enabled.
enabled | set to true to enable to atlas |
Definition at line 59 of file qgsatlascomposition.cpp.
|
inline |
Definition at line 166 of file qgsatlascomposition.h.
bool QgsAtlasComposition::setFilenamePattern | ( | const QString & | pattern | ) |
Sets the filename expression used for generating output filenames for each atlas page.
pattern | expression to use for output filenames |
Definition at line 770 of file qgsatlascomposition.cpp.
|
inline |
Definition at line 163 of file qgsatlascomposition.h.
void QgsAtlasComposition::setFixedScale | ( | bool | fixed | ) |
Sets whether the atlas map should use a fixed scale.
Definition at line 845 of file qgsatlascomposition.cpp.
void QgsAtlasComposition::setHideCoverage | ( | bool | hide | ) |
Sets whether the coverage layer should be hidden in map items in the composition.
hide | set to true to hide the coverage layer |
Definition at line 757 of file qgsatlascomposition.cpp.
void QgsAtlasComposition::setMargin | ( | float | margin | ) |
Sets the margin for the atlas map.
Definition at line 869 of file qgsatlascomposition.cpp.
void QgsAtlasComposition::setPredefinedScales | ( | const QVector< qreal > & | scales | ) |
Sets the list of predefined scales for the atlas.
This is used for maps which are set to the predefined atlas scaling mode.
scales | a vector of doubles representing predefined scales |
Definition at line 825 of file qgsatlascomposition.cpp.
|
inline |
Sets whether the atlas should be exported to a single file.
This is only applicable for PDF exports.
single | set to true to export atlas to a single file. |
Definition at line 154 of file qgsatlascomposition.h.
|
inline |
Definition at line 160 of file qgsatlascomposition.h.
|
inline |
Definition at line 157 of file qgsatlascomposition.h.
void QgsAtlasComposition::setSortKeyAttributeIndex | ( | int | idx | ) |
Definition at line 157 of file qgsatlascomposition.cpp.
|
inline |
Definition at line 176 of file qgsatlascomposition.h.
|
inline |
Returns whether the atlas will be exported to a single file.
This is only applicable for PDF exports.
Definition at line 146 of file qgsatlascomposition.h.
|
inline |
Definition at line 159 of file qgsatlascomposition.h.
|
inline |
Definition at line 156 of file qgsatlascomposition.h.
int QgsAtlasComposition::sortKeyAttributeIndex | ( | ) | const |
Definition at line 148 of file qgsatlascomposition.cpp.
|
inline |
Definition at line 175 of file qgsatlascomposition.h.
|
signal |
Is emitted when the atlas has an updated status bar message for the composer window.
|
signal |
emitted when atlas is enabled or disabled
int QgsAtlasComposition::updateFeatures | ( | ) |
Requeries the current atlas coverage layer and applies filtering and sorting.
Returns number of matching features. Must be called after prepareForFeature( i )
Definition at line 202 of file qgsatlascomposition.cpp.
void QgsAtlasComposition::writeXML | ( | QDomElement & | elem, |
QDomDocument & | doc | ||
) | const |
Definition at line 631 of file qgsatlascomposition.cpp.