Skip to content
Permalink
Browse files

Improve documentation

  • Loading branch information
nyalldawson committed Nov 12, 2017
1 parent 3405bc1 commit d13eaa6a3bfbc17da8ae14c387f2e0764e43a3f0
Showing with 36 additions and 6 deletions.
  1. +18 −3 python/core/symbology/qgsrenderer.sip
  2. +18 −3 src/core/symbology/qgsrenderer.h
@@ -115,16 +115,28 @@ return a new renderer - used by default in vector layers

virtual void startRender( QgsRenderContext &context, const QgsFields &fields ) = 0;
%Docstring
Needs to be called when a new render cycle is started
Must be called when a new render cycle is started. A call to startRender() must always
be followed by a corresponding call to stopRender() after all features have been rendered.

\param context Additional information passed to the renderer about the job which will be rendered
\param fields The fields available for rendering
:return: Information passed back from the renderer that can e.g. be used to reduce the amount of requested features

.. seealso:: stopRender()

\warning This method is not thread safe. Before calling startRender() in a non-main thread,
the renderer should instead be cloned and startRender()/stopRender() called on the clone.
%End

virtual void stopRender( QgsRenderContext &context ) = 0;
%Docstring
Needs to be called when a render cycle has finished to clean up.
Must be called when a render cycle has finished, to allow the renderer to clean up.

Calls to stopRender() must always be preceeded by a call to startRender().

\warning This method is not thread safe. Before calling startRender() in a non-main thread,
the renderer should instead be cloned and startRender()/stopRender() called on the clone.

.. seealso:: startRender()
%End

virtual QString filter( const QgsFields &fields = QgsFields() );
@@ -177,6 +189,9 @@ return a new renderer - used by default in vector layers

If layer is not -1, the renderer should draw only a particula layer from symbols
(in order to support symbol level rendering).

.. seealso:: startRender()
.. seealso:: stopRender()
:rtype: bool
%End

@@ -151,16 +151,28 @@ class CORE_EXPORT QgsFeatureRenderer
virtual QSet< QString > legendKeysForFeature( QgsFeature &feature, QgsRenderContext &context );

/**
* Needs to be called when a new render cycle is started
* Must be called when a new render cycle is started. A call to startRender() must always
* be followed by a corresponding call to stopRender() after all features have been rendered.
*
* \param context Additional information passed to the renderer about the job which will be rendered
* \param fields The fields available for rendering
* \returns Information passed back from the renderer that can e.g. be used to reduce the amount of requested features
*
* \see stopRender()
*
* \warning This method is not thread safe. Before calling startRender() in a non-main thread,
* the renderer should instead be cloned and startRender()/stopRender() called on the clone.
*/
virtual void startRender( QgsRenderContext &context, const QgsFields &fields ) = 0;

/**
* Needs to be called when a render cycle has finished to clean up.
* Must be called when a render cycle has finished, to allow the renderer to clean up.
*
* Calls to stopRender() must always be preceeded by a call to startRender().
*
* \warning This method is not thread safe. Before calling startRender() in a non-main thread,
* the renderer should instead be cloned and startRender()/stopRender() called on the clone.
*
* \see startRender()
*/
virtual void stopRender( QgsRenderContext &context ) = 0;

@@ -209,6 +221,9 @@ class CORE_EXPORT QgsFeatureRenderer
*
* If layer is not -1, the renderer should draw only a particula layer from symbols
* (in order to support symbol level rendering).
*
* \see startRender()
* \see stopRender()
*/
virtual bool renderFeature( QgsFeature &feature, QgsRenderContext &context, int layer = -1, bool selected = false, bool drawVertexMarker = false );

0 comments on commit d13eaa6

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