|
QGIS API Documentation
master-59fd5e0
|
Class used to render an Atlas, iterating over geometry features. More...
#include <qgsatlascomposition.h>
Collaboration diagram for QgsAtlasComposition:Public Types | |
| typedef std::map< QgsFeatureId, QVariant > | SorterKeys |
Signals | |
| void | parameterChanged () |
| emitted when one of the parameters changes | |
Public Member Functions | |
| QgsAtlasComposition (QgsComposition *composition) | |
| ~QgsAtlasComposition () | |
| void | beginRender () |
| Begins the rendering. | |
| QgsComposerMap * | composerMap () const |
| QgsComposition * | composition () |
| QgsVectorLayer * | coverageLayer () const |
| const QString & | currentFilename () const |
| Returns the current filename. | |
| bool | enabled () const |
| Is the atlas generation enabled ? | |
| void | endRender () |
| Ends the rendering. | |
| QString | featureFilter () const |
| QString | filenamePattern () const |
| bool | filterFeatures () const |
| bool | fixedScale () const |
| bool | hideCoverage () const |
| float | margin () const |
| size_t | numFeatures () const |
| Returns the number of features in the coverage layer. | |
| void | prepareForFeature (size_t i) |
| Prepare the atlas map for the given feature. | |
| void | readXML (const QDomElement &elem, const QDomDocument &doc) |
| void | setComposerMap (QgsComposerMap *map) |
| void | setCoverageLayer (QgsVectorLayer *lmap) |
| void | setEnabled (bool e) |
| void | setFeatureFilter (const QString &expression) |
| void | setFilenamePattern (const QString &pattern) |
| void | setFilterFeatures (bool doFilter) |
| void | setFixedScale (bool fixed) |
| void | setHideCoverage (bool hide) |
| void | setMargin (float margin) |
| void | setSingleFile (bool single) |
| void | setSortAscending (bool ascending) |
| void | setSortFeatures (bool doSort) |
| void | setSortKeyAttributeIndex (size_t idx) |
| bool | singleFile () const |
| bool | sortAscending () const |
| bool | sortFeatures () const |
| size_t | sortKeyAttributeIndex () const |
| void | writeXML (QDomElement &elem, QDomDocument &doc) const |
Private Attributes | |
| QgsComposerMap * | mComposerMap |
| QgsComposition * | mComposition |
| QgsVectorLayer * | mCoverageLayer |
| QgsFeature | mCurrentFeature |
| QString | mCurrentFilename |
| bool | mEnabled |
| QString | mFeatureFilter |
| std::vector< QgsFeatureId > | mFeatureIds |
| SorterKeys | mFeatureKeys |
| std::auto_ptr< QgsExpression > | mFilenameExpr |
| QString | mFilenamePattern |
| bool | mFilterFeatures |
| bool | mFixedScale |
| bool | mHideCoverage |
| double | mMargin |
| QgsRectangle | mOrigExtent |
| bool | mRestoreLayer |
| bool | mSingleFile |
| bool | mSortAscending |
| bool | mSortFeatures |
| size_t | mSortKeyAttributeIdx |
| QgsCoordinateTransform | mTransform |
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 37 of file qgsatlascomposition.h.
| typedef std::map< QgsFeatureId, QVariant > QgsAtlasComposition::SorterKeys |
Definition at line 126 of file qgsatlascomposition.h.
| QgsAtlasComposition::QgsAtlasComposition | ( | QgsComposition * | composition | ) |
Definition at line 29 of file qgsatlascomposition.cpp.
References QgsExpression::setSpecialColumn().
Definition at line 46 of file qgsatlascomposition.cpp.
| void QgsAtlasComposition::beginRender | ( | ) |
Begins the rendering.
Definition at line 89 of file qgsatlascomposition.cpp.
References QgsFeature::attributes(), QgsMapLayer::crs(), QgsMapRenderer::destinationCrs(), QgsComposerMap::extent(), QgsVectorLayer::getFeatures(), QgsMapLayer::id(), QgsFeature::id(), QgsMapRenderer::layerSet(), QgsComposerMap::mapRenderer(), QgsComposition::mapRenderer(), mComposerMap, mComposition, mCoverageLayer, mFeatureFilter, mFeatureIds, mFeatureKeys, mFilenameExpr, mFilenamePattern, mFilterFeatures, mHideCoverage, mOrigExtent, mRestoreLayer, mSingleFile, mSortAscending, mSortFeatures, mSortKeyAttributeIdx, mTransform, QgsFeatureIterator::nextFeature(), QgsComposition::numPages(), QgsVectorLayer::pendingFields(), QgsCoordinateTransform::setDestCRS(), QgsCoordinateTransform::setSourceCrs(), QgsExpression::setSpecialColumn(), and tr.
| QgsComposerMap* QgsAtlasComposition::composerMap | ( | ) | const [inline] |
Definition at line 48 of file qgsatlascomposition.h.
| QgsComposition* QgsAtlasComposition::composition | ( | ) | [inline] |
Definition at line 101 of file qgsatlascomposition.h.
| QgsVectorLayer* QgsAtlasComposition::coverageLayer | ( | ) | const [inline] |
Definition at line 63 of file qgsatlascomposition.h.
| const QString & QgsAtlasComposition::currentFilename | ( | ) | const |
Returns the current filename.
Must be called after prepareForFeature( i )
Definition at line 322 of file qgsatlascomposition.cpp.
References mCurrentFilename.
| bool QgsAtlasComposition::enabled | ( | ) | const [inline] |
Is the atlas generation enabled ?
Definition at line 45 of file qgsatlascomposition.h.
| void QgsAtlasComposition::endRender | ( | ) |
Ends the rendering.
Restores original extent
Definition at line 187 of file qgsatlascomposition.cpp.
References QgsComposerMap::cache(), QgsComposition::composerItems(), QgsMapLayer::id(), QgsMapRenderer::layerSet(), QgsComposition::mapRenderer(), mComposerMap, mComposition, mCoverageLayer, mOrigExtent, mRestoreLayer, and QgsComposerMap::setNewExtent().
| QString QgsAtlasComposition::featureFilter | ( | ) | const [inline] |
Definition at line 78 of file qgsatlascomposition.h.
| QString QgsAtlasComposition::filenamePattern | ( | ) | const [inline] |
Definition at line 60 of file qgsatlascomposition.h.
| bool QgsAtlasComposition::filterFeatures | ( | ) | const [inline] |
Definition at line 75 of file qgsatlascomposition.h.
| bool QgsAtlasComposition::fixedScale | ( | ) | const [inline] |
Definition at line 54 of file qgsatlascomposition.h.
| bool QgsAtlasComposition::hideCoverage | ( | ) | const [inline] |
Definition at line 51 of file qgsatlascomposition.h.
| float QgsAtlasComposition::margin | ( | ) | const [inline] |
Definition at line 57 of file qgsatlascomposition.h.
| size_t QgsAtlasComposition::numFeatures | ( | ) | const |
Returns the number of features in the coverage layer.
Definition at line 214 of file qgsatlascomposition.cpp.
References mFeatureIds.
| void QgsAtlasComposition::parameterChanged | ( | ) | [signal] |
emitted when one of the parameters changes
Referenced by readXML().
| void QgsAtlasComposition::prepareForFeature | ( | size_t | i | ) |
Prepare the atlas map for the given feature.
Sets the extent and context variables
Definition at line 219 of file qgsatlascomposition.cpp.
References QgsComposition::composerItems(), QgsFeature::geometry(), QgsVectorLayer::getFeatures(), QgsRectangle::height(), mComposerMap, mComposition, mCoverageLayer, mCurrentFeature, mCurrentFilename, mFeatureIds, mFilenameExpr, mFilenamePattern, mFixedScale, mMargin, mOrigExtent, mSingleFile, mTransform, QgsFeatureIterator::nextFeature(), QgsVectorLayer::pendingFields(), QgsRectangle::scale(), QgsComposerMap::setNewExtent(), QgsExpression::setSpecialColumn(), tr, QgsGeometry::transform(), QgsRectangle::width(), QgsRectangle::xMaximum(), QgsRectangle::xMinimum(), QgsRectangle::yMaximum(), and QgsRectangle::yMinimum().
| void QgsAtlasComposition::readXML | ( | const QDomElement & | elem, |
| const QDomDocument & | doc | ||
| ) |
Definition at line 373 of file qgsatlascomposition.cpp.
References QgsComposition::composerMapItems(), QgsMapLayerRegistry::instance(), QgsMapLayerRegistry::mapLayers(), mComposerMap, mComposition, mCoverageLayer, mEnabled, mFeatureFilter, mFilenamePattern, mFilterFeatures, mFixedScale, mHideCoverage, mMargin, mSingleFile, mSortAscending, mSortFeatures, mSortKeyAttributeIdx, and parameterChanged().
Referenced by QgsComposition::loadFromTemplate().
| void QgsAtlasComposition::setComposerMap | ( | QgsComposerMap * | map | ) | [inline] |
Definition at line 49 of file qgsatlascomposition.h.
| void QgsAtlasComposition::setCoverageLayer | ( | QgsVectorLayer * | lmap | ) |
Definition at line 50 of file qgsatlascomposition.cpp.
References mCoverageLayer, mFeatureIds, and QgsExpression::setSpecialColumn().
| void QgsAtlasComposition::setEnabled | ( | bool | e | ) | [inline] |
Definition at line 46 of file qgsatlascomposition.h.
| void QgsAtlasComposition::setFeatureFilter | ( | const QString & | expression | ) | [inline] |
Definition at line 79 of file qgsatlascomposition.h.
| void QgsAtlasComposition::setFilenamePattern | ( | const QString & | pattern | ) | [inline] |
Definition at line 61 of file qgsatlascomposition.h.
| void QgsAtlasComposition::setFilterFeatures | ( | bool | doFilter | ) | [inline] |
Definition at line 76 of file qgsatlascomposition.h.
| void QgsAtlasComposition::setFixedScale | ( | bool | fixed | ) | [inline] |
Definition at line 55 of file qgsatlascomposition.h.
| void QgsAtlasComposition::setHideCoverage | ( | bool | hide | ) | [inline] |
Definition at line 52 of file qgsatlascomposition.h.
| void QgsAtlasComposition::setMargin | ( | float | margin | ) | [inline] |
Definition at line 58 of file qgsatlascomposition.h.
| void QgsAtlasComposition::setSingleFile | ( | bool | single | ) | [inline] |
Definition at line 67 of file qgsatlascomposition.h.
| void QgsAtlasComposition::setSortAscending | ( | bool | ascending | ) | [inline] |
Definition at line 73 of file qgsatlascomposition.h.
| void QgsAtlasComposition::setSortFeatures | ( | bool | doSort | ) | [inline] |
Definition at line 70 of file qgsatlascomposition.h.
| void QgsAtlasComposition::setSortKeyAttributeIndex | ( | size_t | idx | ) | [inline] |
Definition at line 82 of file qgsatlascomposition.h.
| bool QgsAtlasComposition::singleFile | ( | ) | const [inline] |
Definition at line 66 of file qgsatlascomposition.h.
| bool QgsAtlasComposition::sortAscending | ( | ) | const [inline] |
Definition at line 72 of file qgsatlascomposition.h.
| bool QgsAtlasComposition::sortFeatures | ( | ) | const [inline] |
Definition at line 69 of file qgsatlascomposition.h.
| size_t QgsAtlasComposition::sortKeyAttributeIndex | ( | ) | const [inline] |
Definition at line 81 of file qgsatlascomposition.h.
| void QgsAtlasComposition::writeXML | ( | QDomElement & | elem, |
| QDomDocument & | doc | ||
| ) | const |
Definition at line 327 of file qgsatlascomposition.cpp.
References QgsMapLayer::id(), QgsComposerMap::id(), mComposerMap, mCoverageLayer, mEnabled, mFeatureFilter, mFilenamePattern, mFilterFeatures, mFixedScale, mHideCoverage, mMargin, mSingleFile, mSortAscending, mSortFeatures, and mSortKeyAttributeIdx.
QgsComposerMap* QgsAtlasComposition::mComposerMap [private] |
Definition at line 111 of file qgsatlascomposition.h.
Referenced by beginRender(), endRender(), prepareForFeature(), readXML(), and writeXML().
QgsComposition* QgsAtlasComposition::mComposition [private] |
Definition at line 108 of file qgsatlascomposition.h.
Referenced by beginRender(), endRender(), prepareForFeature(), and readXML().
Definition at line 116 of file qgsatlascomposition.h.
Referenced by beginRender(), endRender(), prepareForFeature(), readXML(), setCoverageLayer(), and writeXML().
Definition at line 141 of file qgsatlascomposition.h.
Referenced by prepareForFeature().
QString QgsAtlasComposition::mCurrentFilename [private] |
Definition at line 120 of file qgsatlascomposition.h.
Referenced by currentFilename(), and prepareForFeature().
bool QgsAtlasComposition::mEnabled [private] |
Definition at line 110 of file qgsatlascomposition.h.
Referenced by readXML(), and writeXML().
QString QgsAtlasComposition::mFeatureFilter [private] |
Definition at line 136 of file qgsatlascomposition.h.
Referenced by beginRender(), readXML(), and writeXML().
std::vector<QgsFeatureId> QgsAtlasComposition::mFeatureIds [private] |
Definition at line 139 of file qgsatlascomposition.h.
Referenced by beginRender(), numFeatures(), prepareForFeature(), and setCoverageLayer().
SorterKeys QgsAtlasComposition::mFeatureKeys [private] |
Definition at line 129 of file qgsatlascomposition.h.
Referenced by beginRender().
std::auto_ptr<QgsExpression> QgsAtlasComposition::mFilenameExpr [private] |
Definition at line 144 of file qgsatlascomposition.h.
Referenced by beginRender(), and prepareForFeature().
QString QgsAtlasComposition::mFilenamePattern [private] |
Definition at line 115 of file qgsatlascomposition.h.
Referenced by beginRender(), prepareForFeature(), readXML(), and writeXML().
bool QgsAtlasComposition::mFilterFeatures [private] |
Definition at line 134 of file qgsatlascomposition.h.
Referenced by beginRender(), readXML(), and writeXML().
bool QgsAtlasComposition::mFixedScale [private] |
Definition at line 113 of file qgsatlascomposition.h.
Referenced by prepareForFeature(), readXML(), and writeXML().
bool QgsAtlasComposition::mHideCoverage [private] |
Definition at line 112 of file qgsatlascomposition.h.
Referenced by beginRender(), readXML(), and writeXML().
double QgsAtlasComposition::mMargin [private] |
Definition at line 114 of file qgsatlascomposition.h.
Referenced by prepareForFeature(), readXML(), and writeXML().
QgsRectangle QgsAtlasComposition::mOrigExtent [private] |
Definition at line 142 of file qgsatlascomposition.h.
Referenced by beginRender(), endRender(), and prepareForFeature().
bool QgsAtlasComposition::mRestoreLayer [private] |
Definition at line 143 of file qgsatlascomposition.h.
Referenced by beginRender(), and endRender().
bool QgsAtlasComposition::mSingleFile [private] |
Definition at line 117 of file qgsatlascomposition.h.
Referenced by beginRender(), prepareForFeature(), readXML(), and writeXML().
bool QgsAtlasComposition::mSortAscending [private] |
Definition at line 124 of file qgsatlascomposition.h.
Referenced by beginRender(), readXML(), and writeXML().
bool QgsAtlasComposition::mSortFeatures [private] |
Definition at line 122 of file qgsatlascomposition.h.
Referenced by beginRender(), readXML(), and writeXML().
size_t QgsAtlasComposition::mSortKeyAttributeIdx [private] |
Definition at line 131 of file qgsatlascomposition.h.
Referenced by beginRender(), readXML(), and writeXML().
Definition at line 119 of file qgsatlascomposition.h.
Referenced by beginRender(), and prepareForFeature().