QGIS API Documentation
2.0.1-Dufour
|
Class used to render an Atlas, iterating over geometry features. More...
#include <qgsatlascomposition.h>
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 () | |
bool | enabled () const |
Is the atlas generation enabled ? | |
void | setEnabled (bool e) |
QgsComposerMap * | composerMap () const |
void | setComposerMap (QgsComposerMap *map) |
bool | hideCoverage () const |
void | setHideCoverage (bool hide) |
bool | fixedScale () const |
void | setFixedScale (bool fixed) |
float | margin () const |
void | setMargin (float margin) |
QString | filenamePattern () const |
void | setFilenamePattern (const QString &pattern) |
QgsVectorLayer * | coverageLayer () const |
void | setCoverageLayer (QgsVectorLayer *lmap) |
bool | singleFile () const |
void | setSingleFile (bool single) |
bool | sortFeatures () const |
void | setSortFeatures (bool doSort) |
bool | sortAscending () const |
void | setSortAscending (bool ascending) |
bool | filterFeatures () const |
void | setFilterFeatures (bool doFilter) |
QString | featureFilter () const |
void | setFeatureFilter (const QString &expression) |
size_t | sortKeyAttributeIndex () const |
void | setSortKeyAttributeIndex (size_t idx) |
void | beginRender () |
Begins the rendering. | |
void | endRender () |
Ends the rendering. | |
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. | |
const QString & | currentFilename () const |
Returns the current filename. | |
void | writeXML (QDomElement &elem, QDomDocument &doc) const |
void | readXML (const QDomElement &elem, const QDomDocument &doc) |
QgsComposition * | composition () |
Private Attributes | |
QgsComposition * | mComposition |
bool | mEnabled |
QgsComposerMap * | mComposerMap |
bool | mHideCoverage |
bool | mFixedScale |
double | mMargin |
QString | mFilenamePattern |
QgsVectorLayer * | mCoverageLayer |
bool | mSingleFile |
QgsCoordinateTransform | mTransform |
QString | mCurrentFilename |
bool | mSortFeatures |
bool | mSortAscending |
SorterKeys | mFeatureKeys |
size_t | mSortKeyAttributeIdx |
bool | mFilterFeatures |
QString | mFeatureFilter |
std::vector< QgsFeatureId > | mFeatureIds |
QgsFeature | mCurrentFeature |
QgsRectangle | mOrigExtent |
bool | mRestoreLayer |
std::auto_ptr< QgsExpression > | mFilenameExpr |
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().
QgsAtlasComposition::~QgsAtlasComposition | ( | ) |
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.
|
inline |
Definition at line 48 of file qgsatlascomposition.h.
|
inline |
Definition at line 101 of file qgsatlascomposition.h.
|
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.
|
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().
|
inline |
Definition at line 78 of file qgsatlascomposition.h.
|
inline |
Definition at line 60 of file qgsatlascomposition.h.
|
inline |
Definition at line 75 of file qgsatlascomposition.h.
|
inline |
Definition at line 54 of file qgsatlascomposition.h.
|
inline |
Definition at line 51 of file qgsatlascomposition.h.
|
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.
|
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().
|
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().
|
inline |
Definition at line 46 of file qgsatlascomposition.h.
|
inline |
Definition at line 79 of file qgsatlascomposition.h.
|
inline |
Definition at line 61 of file qgsatlascomposition.h.
|
inline |
Definition at line 76 of file qgsatlascomposition.h.
|
inline |
Definition at line 55 of file qgsatlascomposition.h.
|
inline |
Definition at line 52 of file qgsatlascomposition.h.
|
inline |
Definition at line 58 of file qgsatlascomposition.h.
|
inline |
Definition at line 67 of file qgsatlascomposition.h.
|
inline |
Definition at line 73 of file qgsatlascomposition.h.
|
inline |
Definition at line 70 of file qgsatlascomposition.h.
|
inline |
Definition at line 82 of file qgsatlascomposition.h.
|
inline |
Definition at line 66 of file qgsatlascomposition.h.
|
inline |
Definition at line 72 of file qgsatlascomposition.h.
|
inline |
Definition at line 69 of file qgsatlascomposition.h.
|
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.
|
private |
Definition at line 111 of file qgsatlascomposition.h.
Referenced by beginRender(), endRender(), prepareForFeature(), readXML(), and writeXML().
|
private |
Definition at line 108 of file qgsatlascomposition.h.
Referenced by beginRender(), endRender(), prepareForFeature(), and readXML().
|
private |
Definition at line 116 of file qgsatlascomposition.h.
Referenced by beginRender(), endRender(), prepareForFeature(), readXML(), setCoverageLayer(), and writeXML().
|
private |
Definition at line 141 of file qgsatlascomposition.h.
Referenced by prepareForFeature().
|
private |
Definition at line 120 of file qgsatlascomposition.h.
Referenced by currentFilename(), and prepareForFeature().
|
private |
Definition at line 110 of file qgsatlascomposition.h.
Referenced by readXML(), and writeXML().
|
private |
Definition at line 136 of file qgsatlascomposition.h.
Referenced by beginRender(), readXML(), and writeXML().
|
private |
Definition at line 139 of file qgsatlascomposition.h.
Referenced by beginRender(), numFeatures(), prepareForFeature(), and setCoverageLayer().
|
private |
Definition at line 129 of file qgsatlascomposition.h.
Referenced by beginRender().
|
private |
Definition at line 144 of file qgsatlascomposition.h.
Referenced by beginRender(), and prepareForFeature().
|
private |
Definition at line 115 of file qgsatlascomposition.h.
Referenced by beginRender(), prepareForFeature(), readXML(), and writeXML().
|
private |
Definition at line 134 of file qgsatlascomposition.h.
Referenced by beginRender(), readXML(), and writeXML().
|
private |
Definition at line 113 of file qgsatlascomposition.h.
Referenced by prepareForFeature(), readXML(), and writeXML().
|
private |
Definition at line 112 of file qgsatlascomposition.h.
Referenced by beginRender(), readXML(), and writeXML().
|
private |
Definition at line 114 of file qgsatlascomposition.h.
Referenced by prepareForFeature(), readXML(), and writeXML().
|
private |
Definition at line 142 of file qgsatlascomposition.h.
Referenced by beginRender(), endRender(), and prepareForFeature().
|
private |
Definition at line 143 of file qgsatlascomposition.h.
Referenced by beginRender(), and endRender().
|
private |
Definition at line 117 of file qgsatlascomposition.h.
Referenced by beginRender(), prepareForFeature(), readXML(), and writeXML().
|
private |
Definition at line 124 of file qgsatlascomposition.h.
Referenced by beginRender(), readXML(), and writeXML().
|
private |
Definition at line 122 of file qgsatlascomposition.h.
Referenced by beginRender(), readXML(), and writeXML().
|
private |
Definition at line 131 of file qgsatlascomposition.h.
Referenced by beginRender(), readXML(), and writeXML().
|
private |
Definition at line 119 of file qgsatlascomposition.h.
Referenced by beginRender(), and prepareForFeature().