@@ -45,61 +45,61 @@ class CORE_EXPORT QgsAtlasComposition : public QObject
45
45
QgsAtlasComposition ( QgsComposition* composition );
46
46
~QgsAtlasComposition ();
47
47
48
- /* *Returns whether the atlas generation is enabled
48
+ /* * Returns whether the atlas generation is enabled
49
49
* @returns true if atlas is enabled
50
50
* @see setEnabled
51
51
*/
52
52
bool enabled () const { return mEnabled ; }
53
53
54
- /* *Sets whether the atlas is enabled
54
+ /* * Sets whether the atlas is enabled
55
55
* @param enabled set to true to enable to atlas
56
56
* @see enabled
57
57
*/
58
58
void setEnabled ( bool enabled );
59
59
60
- /* *Returns the map used by the atlas
60
+ /* * Returns the map used by the atlas
61
61
* @deprecated Use QgsComposerMap::atlasDriven() instead
62
62
*/
63
63
Q_DECL_DEPRECATED QgsComposerMap* composerMap () const ;
64
64
65
- /* *Sets the map used by the atlas
65
+ /* * Sets the map used by the atlas
66
66
* @deprecated Use QgsComposerMap::setAtlasDriven( true ) instead
67
67
*/
68
68
Q_DECL_DEPRECATED void setComposerMap ( QgsComposerMap* map );
69
69
70
- /* *Returns true if the atlas is set to hide the coverage layer
70
+ /* * Returns true if the atlas is set to hide the coverage layer
71
71
* @returns true if coverage layer is hidden
72
72
* @see setHideCoverage
73
73
*/
74
74
bool hideCoverage () const { return mHideCoverage ; }
75
75
76
- /* *Sets whether the coverage layer should be hidden in map items in the composition
76
+ /* * Sets whether the coverage layer should be hidden in map items in the composition
77
77
* @param hide set to true to hide the coverage layer
78
78
* @see hideCoverage
79
79
*/
80
80
void setHideCoverage ( bool hide );
81
81
82
- /* *Returns whether the atlas map uses a fixed scale
82
+ /* * Returns whether the atlas map uses a fixed scale
83
83
* @deprecated since 2.4 Use QgsComposerMap::atlasScalingMode() instead
84
84
*/
85
85
Q_DECL_DEPRECATED bool fixedScale () const ;
86
86
87
- /* *Sets whether the atlas map should use a fixed scale
87
+ /* * Sets whether the atlas map should use a fixed scale
88
88
* @deprecated since 2.4 Use QgsComposerMap::setAtlasScalingMode() instead
89
89
*/
90
90
Q_DECL_DEPRECATED void setFixedScale ( bool fixed );
91
91
92
- /* *Returns the margin for the atlas map
92
+ /* * Returns the margin for the atlas map
93
93
* @deprecated Use QgsComposerMap::atlasMargin() instead
94
94
*/
95
95
Q_DECL_DEPRECATED float margin () const ;
96
96
97
- /* *Sets the margin for the atlas map
97
+ /* * Sets the margin for the atlas map
98
98
* @deprecated Use QgsComposerMap::setAtlasMargin( double ) instead
99
99
*/
100
100
Q_DECL_DEPRECATED void setMargin ( float margin );
101
101
102
- /* *Returns the filename expression used for generating output filenames for each
102
+ /* * Returns the filename expression used for generating output filenames for each
103
103
* atlas page.
104
104
* @returns filename pattern
105
105
* @see setFilenamePattern
@@ -108,7 +108,7 @@ class CORE_EXPORT QgsAtlasComposition : public QObject
108
108
*/
109
109
QString filenamePattern () const { return mFilenamePattern ; }
110
110
111
- /* *Sets the filename expression used for generating output filenames for each
111
+ /* * Sets the filename expression used for generating output filenames for each
112
112
* atlas page.
113
113
* @returns true if filename expression could be successful set, false if expression is invalid
114
114
* @param pattern expression to use for output filenames
@@ -118,34 +118,34 @@ class CORE_EXPORT QgsAtlasComposition : public QObject
118
118
*/
119
119
bool setFilenamePattern ( const QString& pattern );
120
120
121
- /* *Returns an error string from parsing the filename expression.
121
+ /* * Returns an error string from parsing the filename expression.
122
122
* @returns filename pattern parser error
123
123
* @see setFilenamePattern
124
124
* @see filenamePattern
125
125
*/
126
126
QString filenamePatternErrorString () const { return mFilenameParserError ; }
127
127
128
- /* *Returns the coverage layer used for the atlas features
128
+ /* * Returns the coverage layer used for the atlas features
129
129
* @returns atlas coverage layer
130
130
* @see setCoverageLayer
131
131
*/
132
132
QgsVectorLayer* coverageLayer () const { return mCoverageLayer ; }
133
133
134
- /* *Sets the coverage layer to use for the atlas features
134
+ /* * Sets the coverage layer to use for the atlas features
135
135
* @param layer vector coverage layer
136
136
* @see coverageLayer
137
137
*/
138
138
void setCoverageLayer ( QgsVectorLayer* layer );
139
139
140
- /* *Returns whether the atlas will be exported to a single file. This is only
140
+ /* * Returns whether the atlas will be exported to a single file. This is only
141
141
* applicable for PDF exports.
142
142
* @returns true if atlas will be exported to a single file
143
143
* @see setSingleFile
144
144
* @note This property is only used for PDF exports.
145
145
*/
146
146
bool singleFile () const { return mSingleFile ; }
147
147
148
- /* *Sets whether the atlas should be exported to a single file. This is only
148
+ /* * Sets whether the atlas should be exported to a single file. This is only
149
149
* applicable for PDF exports.
150
150
* @param single set to true to export atlas to a single file.
151
151
* @see singleFile
@@ -165,7 +165,7 @@ class CORE_EXPORT QgsAtlasComposition : public QObject
165
165
QString featureFilter () const { return mFeatureFilter ; }
166
166
void setFeatureFilter ( const QString& expression ) { mFeatureFilter = expression; }
167
167
168
- /* *Returns an error string from parsing the feature filter expression.
168
+ /* * Returns an error string from parsing the feature filter expression.
169
169
* @returns filename pattern parser error
170
170
* @see setFilenamePattern
171
171
* @see filenamePattern
@@ -178,15 +178,15 @@ class CORE_EXPORT QgsAtlasComposition : public QObject
178
178
Q_DECL_DEPRECATED int sortKeyAttributeIndex () const ;
179
179
Q_DECL_DEPRECATED void setSortKeyAttributeIndex ( int idx );
180
180
181
- /* *Returns the current list of predefined scales for the atlas. This is used
181
+ /* * Returns the current list of predefined scales for the atlas. This is used
182
182
* for maps which are set to the predefined atlas scaling mode.
183
183
* @returns a vector of doubles representing predefined scales
184
184
* @see setPredefinedScales
185
185
* @see QgsComposerMap::atlasScalingMode
186
186
*/
187
187
const QVector<qreal>& predefinedScales () const { return mPredefinedScales ; }
188
188
189
- /* *Sets the list of predefined scales for the atlas. This is used
189
+ /* * Sets the list of predefined scales for the atlas. This is used
190
190
* for maps which are set to the predefined atlas scaling mode.
191
191
* @param scales a vector of doubles representing predefined scales
192
192
* @see predefinedScales
@@ -203,14 +203,14 @@ class CORE_EXPORT QgsAtlasComposition : public QObject
203
203
/* * Returns the number of features in the coverage layer */
204
204
int numFeatures () const ;
205
205
206
- /* *Prepare the atlas map for the given feature. Sets the extent and context variables
206
+ /* * Prepare the atlas map for the given feature. Sets the extent and context variables
207
207
* @param i feature number
208
208
* @param updateMaps set to true to redraw maps and recalculate their extent
209
209
* @returns true if feature was successfully prepared
210
210
*/
211
211
bool prepareForFeature ( const int i, const bool updateMaps = true );
212
212
213
- /* *Prepare the atlas map for the given feature. Sets the extent and context variables
213
+ /* * Prepare the atlas map for the given feature. Sets the extent and context variables
214
214
* @returns true if feature was successfully prepared
215
215
*/
216
216
bool prepareForFeature ( const QgsFeature *feat );
@@ -220,15 +220,15 @@ class CORE_EXPORT QgsAtlasComposition : public QObject
220
220
221
221
void writeXML ( QDomElement& elem, QDomDocument& doc ) const ;
222
222
223
- /* *Reads general atlas settings from xml
223
+ /* * Reads general atlas settings from xml
224
224
* @param elem a QDomElement holding the atlas properties.
225
225
* @param doc QDomDocument for the source xml.
226
226
* @see readXMLMapSettings
227
227
* @note This method should be called before restoring composer item properties
228
228
*/
229
229
void readXML ( const QDomElement& elem, const QDomDocument& doc );
230
230
231
- /* *Reads old (pre 2.2) map related atlas settings from xml
231
+ /* * Reads old (pre 2.2) map related atlas settings from xml
232
232
* @param elem a QDomElement holding the atlas map properties.
233
233
* @param doc QDomDocument for the source xml.
234
234
* @see readXMLMapSettings
@@ -246,12 +246,17 @@ class CORE_EXPORT QgsAtlasComposition : public QObject
246
246
/* * Returns the current atlas feature. Must be called after prepareForFeature( i ). */
247
247
QgsFeature* currentFeature () { return &mCurrentFeature ; }
248
248
249
+ /* * Returns the current feature number.
250
+ * @note added in QGIS 2.12
251
+ */
252
+ int currentFeatureNumber () const { return mCurrentFeatureNo ; }
253
+
249
254
/* * Recalculates the bounds of an atlas driven map */
250
255
void prepareMap ( QgsComposerMap* map );
251
256
252
257
public slots:
253
258
254
- /* *Refreshes the current atlas feature, by refetching its attributes from the vector layer provider
259
+ /* * Refreshes the current atlas feature, by refetching its attributes from the vector layer provider
255
260
* @note added in QGIS 2.5
256
261
*/
257
262
void refreshFeature ();
@@ -262,34 +267,39 @@ class CORE_EXPORT QgsAtlasComposition : public QObject
262
267
void firstFeature ();
263
268
264
269
signals:
265
- /* * emitted when one of the parameters changes */
270
+ /* * Emitted when one of the parameters changes */
266
271
void parameterChanged ();
267
272
268
- /* * emitted when atlas is enabled or disabled */
273
+ /* * Emitted when atlas is enabled or disabled */
269
274
void toggled ( bool );
270
275
271
- /* *Is emitted when the atlas has an updated status bar message for the composer window*/
276
+ /* * Is emitted when the atlas has an updated status bar message for the composer window*/
272
277
void statusMsgChanged ( QString message );
273
278
274
- /* *Is emitted when the coverage layer for an atlas changes*/
279
+ /* * Is emitted when the coverage layer for an atlas changes*/
275
280
void coverageLayerChanged ( QgsVectorLayer* layer );
276
281
277
- /* *Is emitted when atlas rendering has begun*/
282
+ /* * Is emitted when atlas rendering has begun*/
278
283
void renderBegun ();
279
284
280
- /* *Is emitted when atlas rendering has ended*/
285
+ /* * Is emitted when atlas rendering has ended*/
281
286
void renderEnded ();
282
287
283
- /* *Is emitted when the current atlas feature changes*/
288
+ /* * Is emitted when the current atlas feature changes*/
284
289
void featureChanged ( QgsFeature* feature );
285
290
291
+ /* * Is emitted when the number of features for the atlas changes.
292
+ * @note added in QGIS 2.12
293
+ */
294
+ void numberFeaturesChanged ( int numFeatures );
295
+
286
296
private:
287
- /* *Updates the filename expression.
297
+ /* * Updates the filename expression.
288
298
* @returns true if expression was successfully parsed, false if expression is invalid
289
299
*/
290
300
bool updateFilenameExpression ();
291
301
292
- /* *Evaluates filename for current feature
302
+ /* * Evaluates filename for current feature
293
303
* @returns true if feature filename was successfully evaluated
294
304
*/
295
305
bool evalFeatureFilename ();
0 commit comments