Skip to content

Commit 8c80ff5

Browse files
committedDec 15, 2018
Dox++
(cherry picked from commit 44bbf1f)
1 parent c4c793a commit 8c80ff5

File tree

2 files changed

+91
-7
lines changed

2 files changed

+91
-7
lines changed
 

‎python/core/auto_generated/qgsrendercontext.sip.in

Lines changed: 45 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -109,8 +109,14 @@ Returns the destination QPainter for the render operation.
109109

110110
QgsCoordinateTransform coordinateTransform() const;
111111
%Docstring
112-
Returns the current coordinate transform for the context, or an invalid
113-
transform is no coordinate transformation is required.
112+
Returns the current coordinate transform for the context.
113+
114+
This represents the coordinate transform required to transform a layer
115+
which is being rendered back to the CRS of the rendered map. If no coordinate
116+
transformation is required, or the render context is not associated with
117+
a map layer render, then an invalid coordinate transformation is returned.
118+
119+
.. seealso:: :py:func:`setCoordinateTransform`
114120
%End
115121

116122
const QgsDistanceArea &distanceArea() const;
@@ -163,6 +169,22 @@ during rendering operations, e.g. for resolving relative symbol paths.
163169
%End
164170

165171
const QgsRectangle &extent() const;
172+
%Docstring
173+
When rendering a map layer, calling this method returns the "clipping"
174+
extent for the layer (in the layer's CRS).
175+
176+
This extent is a "worst-case" scenario, which is guaranteed to cover the complete
177+
visible portion of the layer when it is rendered to a map. It is often larger
178+
than the actual visible portion of that layer.
179+
180+
.. warning::
181+
182+
For some layers, depending on the visible extent and the coordinate
183+
transforms involved, this extent will represent the entire globe. This method
184+
should never be used to determine the actual visible extent of a map render.
185+
186+
.. seealso:: :py:func:`setExtent`
187+
%End
166188

167189
const QgsMapToPixel &mapToPixel() const;
168190

@@ -218,10 +240,30 @@ Returns true if vector selections should be shown in the rendered map
218240

219241
void setCoordinateTransform( const QgsCoordinateTransform &t );
220242
%Docstring
221-
Sets coordinate transformation.
243+
Sets the current coordinate transform for the context.
244+
245+
This represents the coordinate transform required to transform the layer
246+
which is being rendered back to the CRS of the rendered map.
247+
248+
Set to an invalid QgsCoordinateTransform to indicate that no transformation is required.
249+
250+
.. seealso:: :py:func:`coordinateTransform`
222251
%End
252+
223253
void setMapToPixel( const QgsMapToPixel &mtp );
254+
224255
void setExtent( const QgsRectangle &extent );
256+
%Docstring
257+
When rendering a map layer, calling this method sets the "clipping"
258+
extent for the layer (in the layer's CRS).
259+
260+
This extent should be a "worst-case" scenario, which is guaranteed to
261+
completely cover the entire visible portion of the layer when it is rendered
262+
to the map. It may be larger than the actual visible area, but MUST contain at least the
263+
entire visible area.
264+
265+
.. seealso:: :py:func:`setExtent`
266+
%End
225267

226268
void setDrawEditingInformation( bool b );
227269

‎src/core/qgsrendercontext.h

Lines changed: 46 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -166,8 +166,14 @@ class CORE_EXPORT QgsRenderContext
166166
QPainter *painter() {return mPainter;}
167167

168168
/**
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()
171177
*/
172178
QgsCoordinateTransform coordinateTransform() const {return mCoordTransform;}
173179

@@ -215,7 +221,21 @@ class CORE_EXPORT QgsRenderContext
215221
*/
216222
void setPathResolver( const QgsPathResolver &resolver ) { mPathResolver = resolver; }
217223

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; }
219239

220240
const QgsMapToPixel &mapToPixel() const {return mMapToPixel;}
221241

@@ -269,9 +289,31 @@ class CORE_EXPORT QgsRenderContext
269289

270290
//setters
271291

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+
*/
273302
void setCoordinateTransform( const QgsCoordinateTransform &t );
303+
274304
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+
*/
275317
void setExtent( const QgsRectangle &extent ) {mExtent = extent;}
276318

277319
void setDrawEditingInformation( bool b );

0 commit comments

Comments
 (0)
Please sign in to comment.