@@ -166,8 +166,14 @@ class CORE_EXPORT QgsRenderContext
166
166
QPainter *painter () {return mPainter ;}
167
167
168
168
/* *
169
- * Returns the current coordinate transform for the context, or an invalid
170
- * transform is no coordinate transformation is required.
169
+ * Returns the current coordinate transform for the context.
170
+ *
171
+ * This represents the coordinate transform required to transform a layer
172
+ * which is being rendered back to the CRS of the rendered map. If no coordinate
173
+ * transformation is required, or the render context is not associated with
174
+ * a map layer render, then an invalid coordinate transformation is returned.
175
+ *
176
+ * \see setCoordinateTransform()
171
177
*/
172
178
QgsCoordinateTransform coordinateTransform () const {return mCoordTransform ;}
173
179
@@ -215,7 +221,21 @@ class CORE_EXPORT QgsRenderContext
215
221
*/
216
222
void setPathResolver ( const QgsPathResolver &resolver ) { mPathResolver = resolver; }
217
223
218
- const QgsRectangle &extent () const {return mExtent ;}
224
+ /* *
225
+ * When rendering a map layer, calling this method returns the "clipping"
226
+ * extent for the layer (in the layer's CRS).
227
+ *
228
+ * This extent is a "worst-case" scenario, which is guaranteed to cover the complete
229
+ * visible portion of the layer when it is rendered to a map. It is often larger
230
+ * than the actual visible portion of that layer.
231
+ *
232
+ * \warning For some layers, depending on the visible extent and the coordinate
233
+ * transforms involved, this extent will represent the entire globe. This method
234
+ * should never be used to determine the actual visible extent of a map render.
235
+ *
236
+ * \see setExtent()
237
+ */
238
+ const QgsRectangle &extent () const { return mExtent ; }
219
239
220
240
const QgsMapToPixel &mapToPixel () const {return mMapToPixel ;}
221
241
@@ -269,9 +289,31 @@ class CORE_EXPORT QgsRenderContext
269
289
270
290
// setters
271
291
272
- // ! Sets coordinate transformation.
292
+ /* *
293
+ * Sets the current coordinate transform for the context.
294
+ *
295
+ * This represents the coordinate transform required to transform the layer
296
+ * which is being rendered back to the CRS of the rendered map.
297
+ *
298
+ * Set to an invalid QgsCoordinateTransform to indicate that no transformation is required.
299
+ *
300
+ * \see coordinateTransform()
301
+ */
273
302
void setCoordinateTransform ( const QgsCoordinateTransform &t );
303
+
274
304
void setMapToPixel ( const QgsMapToPixel &mtp ) {mMapToPixel = mtp;}
305
+
306
+ /* *
307
+ * When rendering a map layer, calling this method sets the "clipping"
308
+ * extent for the layer (in the layer's CRS).
309
+ *
310
+ * This extent should be a "worst-case" scenario, which is guaranteed to
311
+ * completely cover the entire visible portion of the layer when it is rendered
312
+ * to the map. It may be larger than the actual visible area, but MUST contain at least the
313
+ * entire visible area.
314
+ *
315
+ * \see setExtent()
316
+ */
275
317
void setExtent ( const QgsRectangle &extent ) {mExtent = extent;}
276
318
277
319
void setDrawEditingInformation ( bool b );
0 commit comments