Skip to content
Permalink
Browse files

Add signals to atlas generation

  • Loading branch information
Hugo Mercier
Hugo Mercier committed Mar 18, 2014
1 parent 0a78102 commit 9eb8ef4e98ccd06f28eb7a4ed2da1e39e89ed3fb
@@ -122,4 +122,9 @@ public:
/**Is emitted when the coverage layer for an atlas changes*/
void coverageLayerChanged( QgsVectorLayer* layer );

/**Is emitted when atlas rendering has begun*/
void renderBegun();

/**Is emitted when atlas rendering has ended*/
void renderEnded();
};
@@ -407,6 +407,9 @@ class QgsComposerMap : QgsComposerItem
/**Is emitted on rotation change to notify north arrow pictures*/
void mapRotationChanged( double newRotation );

/**Is emitted when the map has been prepared for atlas rendering, just before actual rendering*/
void preparedForAtlas();

public slots:

/**Called if map canvas has changed*/
@@ -266,6 +266,8 @@ bool QgsAtlasComposition::beginRender()
return false;
}

emit renderBegun();

bool featuresUpdated = updateFeatures();
if ( !featuresUpdated )
{
@@ -296,6 +298,8 @@ void QgsAtlasComposition::endRender()
}

updateAtlasMaps();

emit renderEnded();
}

void QgsAtlasComposition::updateAtlasMaps()
@@ -150,6 +150,12 @@ class CORE_EXPORT QgsAtlasComposition : public QObject
/**Is emitted when the coverage layer for an atlas changes*/
void coverageLayerChanged( QgsVectorLayer* layer );

/**Is emitted when atlas rendering has begun*/
void renderBegun();

/**Is emitted when atlas rendering has ended*/
void renderEnded();

private:
/**Updates the filename expression*/
void updateFilenameExpression();
@@ -641,6 +641,7 @@ void QgsComposerMap::setNewAtlasFeatureExtent( const QgsRectangle& extent )

mAtlasFeatureExtent = newExtent;
mCacheUpdated = false;
emit preparedForAtlas();
updateItem();
emit itemChanged();
emit extentChanged();
@@ -445,6 +445,9 @@ class CORE_EXPORT QgsComposerMap : public QgsComposerItem
/**Is emitted on rotation change to notify north arrow pictures*/
void mapRotationChanged( double newRotation );

/**Is emitted when the map has been prepared for atlas rendering, just before actual rendering*/
void preparedForAtlas();

public slots:

/**Called if map canvas has changed*/
@@ -2537,6 +2537,7 @@ bool QgsComposition::setAtlasMode( QgsComposition::AtlasMode mode )
if ( ! atlasHasFeatures )
{
mAtlasMode = QgsComposition::AtlasOff;
mAtlasComposition.endRender();
return false;
}
}

0 comments on commit 9eb8ef4

Please sign in to comment.
You can’t perform that action at this time.