Skip to content
Permalink
Browse files

Remove deprecated members and fix TODOs for QgsFeatureRenderer

  • Loading branch information
nyalldawson committed Sep 13, 2016
1 parent f55d7d3 commit a921c190d003980f53e2f74c91323e59e1428e7d
@@ -552,7 +552,17 @@ None will need to be modified, as the method will return an empty geometry if th
\subsection qgis_api_break_3_0_QgsFeatureRendererV2 QgsFeatureRendererV2

<ul>
<li>The method capabilities() returns QgsFeatureRendererV2::Capabilities flags instead of an integer. The two are binary compatible.
<li>The method capabilities() returns QgsFeatureRendererV2::Capabilities flags instead of an integer. The two are binary compatible.</li>
<li>symbolForFeature( QgsFeature& feature ) has been removed. The symbolForFeature( QgsFeature& feature, QgsRenderContext& context ) method should be used instead (previously available as symbolForFeature2 in PyQGIS bindings). symbolForFeature has been made pure virtual.</li>
<li>originalSymbolForFeature( QgsFeature& feature ) has been removed. The symbolForFeature( QgsFeature& feature, QgsRenderContext& context ) method should be used instead (previously available as originalSymbolForFeature2 in PyQGIS bindings).</li>
<li>startRender( QgsRenderContext& context, const QgsVectorLayer *vlayer ) was removed. This function has had no effect since QGIS 2.4</li>
<li>symbols() has been removed. The symbols( QgsRenderContext& context ) method should be used instead (previously available as symbols2 in PyQGIS bindings).</li>
<li>writeSld( QDomDocument& doc, const QgsVectorLayer &layer ) was removed. writeSld( QDomDocument& doc, const QgsVectorLayer &layer ) should be used instead.</li>
<li>rotationField() and setRotationField() were removed. Data defined properties for QgsSymbolLayer should be used instead.</li>
<li>willRenderFeature( QgsFeature& feat ) has been removed. The willRenderFeature( QgsFeature& feat, QgsRenderContext& context ) method should be used instead (previously available as willRenderFeature2 in PyQGIS bindings).</li>
<li>symbolsForFeature( QgsFeature& feat ) has been removed. The symbolsForFeature( QgsFeature& feat, QgsRenderContext& context ) method should be used instead (previously available as symbolsForFeature2 in PyQGIS bindings).</li>
<li>originalSymbolsForFeature( QgsFeature& feat ) has been removed. The originalSymbolsForFeature( QgsFeature& feat, QgsRenderContext& context ) method should be used instead (previously available as originalSymbolsForFeature2 in PyQGIS bindings).</li>
<li>copyPaintEffect() was removed. copyRendererData() should be used instead.</li>
</ul>

\subsection qgis_api_break_3_0_QgsFields QgsFields
@@ -50,10 +50,10 @@ class QgsCategorizedSymbolRenderer : QgsFeatureRenderer
virtual ~QgsCategorizedSymbolRenderer();

//! @note available in python as symbolForFeature2
virtual QgsSymbol* symbolForFeature( QgsFeature& feature, QgsRenderContext& context ) /PyName=symbolForFeature2/;
virtual QgsSymbol* symbolForFeature( QgsFeature& feature, QgsRenderContext& context );

//! @note available in python as originalSymbolForFeature2
virtual QgsSymbol* originalSymbolForFeature( QgsFeature& feature, QgsRenderContext& context ) /PyName=originalSymbolForFeature2/;
virtual QgsSymbol* originalSymbolForFeature( QgsFeature& feature, QgsRenderContext& context );

virtual void startRender( QgsRenderContext& context, const QgsFields& fields );

@@ -73,7 +73,7 @@ class QgsCategorizedSymbolRenderer : QgsFeatureRenderer
virtual QString filter( const QgsFields& fields = QgsFields() );

//! @note available in python as symbols2
virtual QgsSymbolList symbols( QgsRenderContext& context ) /PyName=symbols2/;
virtual QgsSymbolList symbols( QgsRenderContext& context );

/** Update all the symbols but leave categories and colors. This method also sets the source
* symbol for the renderer.
@@ -168,9 +168,6 @@ class QgsCategorizedSymbolRenderer : QgsFeatureRenderer
*/
void updateColorRamp( QgsColorRamp* ramp /Transfer/, bool inverted = false );

void setRotationField( const QString& fieldOrExpression ) /Deprecated/;
QString rotationField() const /Deprecated/;

void setSizeScaleField( const QString& fieldOrExpression );
QString sizeScaleField() const;

@@ -94,9 +94,9 @@ class QgsGraduatedSymbolRenderer : QgsFeatureRenderer
virtual ~QgsGraduatedSymbolRenderer();

//! @note labelForLowerUpper in python bindings
virtual QgsSymbol* symbolForFeature( QgsFeature& feature, QgsRenderContext& context ) /PyName=symbolForFeature2/;
virtual QgsSymbol* symbolForFeature( QgsFeature& feature, QgsRenderContext& context );
//! @note originalSymbolForFeature2 in python bindings
virtual QgsSymbol* originalSymbolForFeature( QgsFeature& feature, QgsRenderContext& context ) /PyName=originalSymbolForFeature2/;
virtual QgsSymbol* originalSymbolForFeature( QgsFeature& feature, QgsRenderContext& context );

virtual void startRender( QgsRenderContext& context, const QgsFields& fields );

@@ -114,7 +114,7 @@ class QgsGraduatedSymbolRenderer : QgsFeatureRenderer
virtual QgsFeatureRenderer::Capabilities capabilities();

//! @note symbol2 in python bindings
virtual QgsSymbolList symbols( QgsRenderContext& context ) /PyName=symbols2/;
virtual QgsSymbolList symbols( QgsRenderContext& context );

QString classAttribute() const;
void setClassAttribute( const QString& attr );
@@ -299,9 +299,6 @@ class QgsGraduatedSymbolRenderer : QgsFeatureRenderer
//! @note added in 2.10
void setGraduatedMethod( GraduatedMethod method );

void setRotationField( const QString& fieldOrExpression ) /Deprecated/;
QString rotationField() const /Deprecated/;

void setSizeScaleField( const QString& fieldOrExpression );
QString sizeScaleField() const;

@@ -14,9 +14,9 @@ class QgsHeatmapRenderer : QgsFeatureRenderer
virtual bool renderFeature( QgsFeature& feature, QgsRenderContext& context, int layer = -1, bool selected = false, bool drawVertexMarker = false );
virtual void stopRender( QgsRenderContext& context );
//! @note symbolForFeature2 in python bindings
virtual QgsSymbol* symbolForFeature( QgsFeature& feature, QgsRenderContext& context ) /PyName=symbolForFeature2/;
virtual QgsSymbol* symbolForFeature( QgsFeature& feature, QgsRenderContext& context );
//! @note symbol2 in python bindings
virtual QgsSymbolList symbols( QgsRenderContext& context ) /PyName=symbols2/;
virtual QgsSymbolList symbols( QgsRenderContext& context );
virtual QString dump() const;
virtual QList<QString> usedAttributes();
static QgsFeatureRenderer* create( QDomElement& element ) /Factory/;
@@ -45,23 +45,23 @@ class QgsInvertedPolygonRenderer : QgsFeatureRenderer
/** Proxy that will call this method on the embedded renderer.
* @note available in python bindings as symbol2
*/
virtual QgsSymbolList symbols( QgsRenderContext& context ) /PyName=symbols2/;
virtual QgsSymbolList symbols( QgsRenderContext& context );
/** Proxy that will call this method on the embedded renderer.
* @note available in python bindings as symbolForFeature2
*/
virtual QgsSymbol* symbolForFeature( QgsFeature& feature, QgsRenderContext& context ) /PyName=symbolForFeature2/;
virtual QgsSymbol* symbolForFeature( QgsFeature& feature, QgsRenderContext& context );
/** Proxy that will call this method on the embedded renderer.
* @note available in python bindings as originalSymbolForFeature2
*/
virtual QgsSymbol* originalSymbolForFeature( QgsFeature& feat, QgsRenderContext& context ) /PyName=originalSymbolForFeature2/;
virtual QgsSymbol* originalSymbolForFeature( QgsFeature& feat, QgsRenderContext& context );
/** Proxy that will call this method on the embedded renderer.
* @note available in python bindings as symbolsForFeature
*/
virtual QgsSymbolList symbolsForFeature( QgsFeature& feat, QgsRenderContext& context ) /PyName=symbolsForFeature/;
virtual QgsSymbolList symbolsForFeature( QgsFeature& feat, QgsRenderContext& context );
/** Proxy that will call this method on the embedded renderer.
* @note available in python bindings as originalSymbolsForFeature2
*/
virtual QgsSymbolList originalSymbolsForFeature( QgsFeature& feat, QgsRenderContext& context ) /PyName=originalSymbolsForFeature2/;
virtual QgsSymbolList originalSymbolsForFeature( QgsFeature& feat, QgsRenderContext& context );
/** Proxy that will call this method on the embedded renderer. */
virtual QgsLegendSymbologyList legendSymbologyItems( QSize iconSize );
/** Proxy that will call this method on the embedded renderer.
@@ -71,7 +71,7 @@ class QgsInvertedPolygonRenderer : QgsFeatureRenderer
/** Proxy that will call this method on the embedded renderer.
* @note available in python bindings as willRenderFeature2
*/
virtual bool willRenderFeature( QgsFeature& feat, QgsRenderContext& context ) /PyName=willRenderFeature2/;
virtual bool willRenderFeature( QgsFeature& feat, QgsRenderContext& context );

/** Creates a renderer out of an XML, for loading*/
static QgsFeatureRenderer* create( QDomElement& element ) /Factory/;
@@ -27,7 +27,7 @@ class QgsNullSymbolRenderer : QgsFeatureRenderer
virtual QList<QString> usedAttributes();
virtual QString dump() const;
virtual QgsFeatureRenderer* clone() const /Factory/;
virtual QgsSymbolList symbols( QgsRenderContext& context ) /PyName=symbols2/;
virtual QgsSymbolList symbols( QgsRenderContext& context );

/** Creates a null renderer from XML element.
* @param element DOM element
@@ -30,27 +30,27 @@ class QgsPointDisplacementRenderer : QgsFeatureRenderer
/** Proxy that will call this method on the embedded renderer.
@note available in python as symbols2
*/
virtual QgsSymbolList symbols( QgsRenderContext& context ) /PyName=symbols2/;
virtual QgsSymbolList symbols( QgsRenderContext& context );
/** Proxy that will call this method on the embedded renderer.
@note available in python as symbolForFeature2
*/
virtual QgsSymbol* symbolForFeature( QgsFeature& feature, QgsRenderContext& context ) /PyName=symbolForFeature2/;
virtual QgsSymbol* symbolForFeature( QgsFeature& feature, QgsRenderContext& context );
/** Proxy that will call this method on the embedded renderer.
@note available in python as originalSymbolForFeature2
*/
virtual QgsSymbol* originalSymbolForFeature( QgsFeature& feat, QgsRenderContext& context ) /PyName=originalSymbolForFeature2/;
virtual QgsSymbol* originalSymbolForFeature( QgsFeature& feat, QgsRenderContext& context );
/** Proxy that will call this method on the embedded renderer.
@note available in python as symbolsForFeature2
*/
virtual QgsSymbolList symbolsForFeature( QgsFeature& feat, QgsRenderContext& context ) /PyName=symbolsForFeature2/;
virtual QgsSymbolList symbolsForFeature( QgsFeature& feat, QgsRenderContext& context );
/** Proxy that will call this method on the embedded renderer.
@note available in python as originalSymbolsForFeature2
*/
virtual QgsSymbolList originalSymbolsForFeature( QgsFeature& feat, QgsRenderContext& context ) /PyName=originalSymbolsForFeature2/;
virtual QgsSymbolList originalSymbolsForFeature( QgsFeature& feat, QgsRenderContext& context );
/** Proxy that will call this method on the embedded renderer.
@note available in python as willRenderFeature2
*/
virtual bool willRenderFeature( QgsFeature& feat, QgsRenderContext& context ) /PyName=willRenderFeature2/;
virtual bool willRenderFeature( QgsFeature& feat, QgsRenderContext& context );

virtual void startRender( QgsRenderContext& context, const QgsFields& fields );

@@ -64,46 +64,23 @@ class QgsFeatureRenderer

QString type() const;

/** To be overridden
*
* Must be called between startRender() and stopRender() calls.
* @param feature feature
* @return returns pointer to symbol or 0 if symbol was not found
* @deprecated use symbolForFeature( QgsFeature& feature, QgsRenderContext& context ) instead
*/
virtual QgsSymbol* symbolForFeature( QgsFeature& feature ) /Deprecated/;

/** To be overridden
*
* Must be called between startRender() and stopRender() calls.
* @param feature feature
* @param context render context
* @return returns pointer to symbol or 0 if symbol was not found
* @note added in QGIS 2.12
* @note available in Python bindings as symbolForFeature2
*/
// TODO - QGIS 3.0 make pure virtual when above method is removed
// TODO - QGIS 3.0 change PyName to symbolForFeature when deprecated method is removed
virtual QgsSymbol* symbolForFeature( QgsFeature& feature, QgsRenderContext& context ) /PyName=symbolForFeature2/;

/**
* Return symbol for feature. The difference compared to symbolForFeature() is that it returns original
* symbol which can be used as an identifier for renderer's rule - the former may return a temporary replacement
* of a symbol for use in rendering.
* @note added in 2.6
* @deprecated use originalSymbolForFeature( QgsFeature& feature, QgsRenderContext& context ) instead
*/
virtual QgsSymbol* originalSymbolForFeature( QgsFeature& feature ) /Deprecated/;
virtual QgsSymbol* symbolForFeature( QgsFeature& feature, QgsRenderContext& context ) = 0;

/**
* Return symbol for feature. The difference compared to symbolForFeature() is that it returns original
* symbol which can be used as an identifier for renderer's rule - the former may return a temporary replacement
* of a symbol for use in rendering.
* @note added in 2.12
* @note available in Python bindings as originalSymbolForFeature2
*/
//TODO - QGIS 3.0 change PyName to originalSymbolForFeature when deprecated method is removed
virtual QgsSymbol* originalSymbolForFeature( QgsFeature& feature, QgsRenderContext& context ) /PyName=originalSymbolForFeature2/;
virtual QgsSymbol* originalSymbolForFeature( QgsFeature& feature, QgsRenderContext& context );

/**
* Return legend keys matching a specified feature.
@@ -120,9 +97,6 @@ class QgsFeatureRenderer
*/
virtual void startRender( QgsRenderContext& context, const QgsFields& fields ) = 0;

//! @deprecated since 2.4 - not using QgsVectorLayer directly anymore
virtual void startRender( QgsRenderContext& context, const QgsVectorLayer *vlayer ) /Deprecated/;

/**
* Needs to be called when a render cycle has finished to clean up.
*/
@@ -186,18 +160,12 @@ class QgsFeatureRenderer
//! returns bitwise OR-ed capabilities of the renderer
virtual QgsFeatureRenderer::Capabilities capabilities();

/** For symbol levels
* @deprecated use symbols( QgsRenderContext& context ) instead
*/
virtual QgsSymbolList symbols() /Deprecated/;

/** Returns list of symbols used by the renderer.
* @param context render context
* @note added in QGIS 2.12
* @note available in Python bindings as symbols2
*/
//TODO - QGIS 3.0 change PyName to symbols when deprecated method is removed
virtual QgsSymbolList symbols( QgsRenderContext& context ) /PyName=symbols2/;
virtual QgsSymbolList symbols( QgsRenderContext& context );

bool usingSymbolLevels() const;
void setUsingSymbolLevels( bool usingSymbolLevels );
@@ -208,9 +176,6 @@ class QgsFeatureRenderer
//! store renderer info to XML element
virtual QDomElement save( QDomDocument& doc );

//! create the SLD UserStyle element following the SLD v1.1 specs
//! @deprecated since 2.8 - use the other override with styleName
virtual QDomElement writeSld( QDomDocument& doc, const QgsVectorLayer &layer ) const /Deprecated/;
//! create the SLD UserStyle element following the SLD v1.1 specs with the given name
//! @note added in 2.8
virtual QDomElement writeSld( QDomDocument& doc, const QString& styleName ) const;
@@ -268,60 +233,24 @@ class QgsFeatureRenderer
//! set type and size of editing vertex markers for subsequent rendering
void setVertexMarkerAppearance( int type, int size );

//! return rotation field name (or empty string if not set or not supported by renderer)
//! @deprecated use the symbol's methods instead
virtual QString rotationField() const /Deprecated/;

//! sets rotation field of renderer (if supported by the renderer)
//! @deprecated use the symbol's methods instead
virtual void setRotationField( const QString& fieldName ) /Deprecated/;

/** Returns whether the renderer will render a feature or not.
* Must be called between startRender() and stopRender() calls.
* Default implementation uses symbolForFeature().
* @deprecated use willRenderFeature( QgsFeature& feat, QgsRenderContext& context ) instead
*/
virtual bool willRenderFeature( QgsFeature& feat ) /Deprecated/;

/** Returns whether the renderer will render a feature or not.
* Must be called between startRender() and stopRender() calls.
* Default implementation uses symbolForFeature().
* @note added in QGIS 2.12
* @note available in Python bindings as willRenderFeature2
*/
//TODO - QGIS 3.0 change PyName to willRenderFeature when deprecated method is removed
virtual bool willRenderFeature( QgsFeature& feat, QgsRenderContext& context ) /PyName=willRenderFeature2/;

/** Returns list of symbols used for rendering the feature.
* For renderers that do not support MoreSymbolsPerFeature it is more efficient
* to use symbolForFeature()
* @deprecated use symbolsForFeature( QgsFeature& feat, QgsRenderContext& context ) instead
*/
virtual QgsSymbolList symbolsForFeature( QgsFeature& feat ) /Deprecated/;
virtual bool willRenderFeature( QgsFeature& feat, QgsRenderContext& context );

/** Returns list of symbols used for rendering the feature.
* For renderers that do not support MoreSymbolsPerFeature it is more efficient
* to use symbolForFeature()
* @note added in QGIS 2.12
* @note available in Python bindings as symbolsForFeature2
*/
//TODO - QGIS 3.0 change PyName to symbolsForFeature when deprecated method is removed
virtual QgsSymbolList symbolsForFeature( QgsFeature& feat, QgsRenderContext& context ) /PyName=symbolsForFeature2/;
virtual QgsSymbolList symbolsForFeature( QgsFeature& feat, QgsRenderContext& context );

/** Equivalent of originalSymbolsForFeature() call
* extended to support renderers that may use more symbols per feature - similar to symbolsForFeature()
* @note added in 2.6
* @deprecated use originalSymbolsForFeature( QgsFeature& feat, QgsRenderContext& context ) instead
*/
virtual QgsSymbolList originalSymbolsForFeature( QgsFeature& feat ) /Deprecated/;

/** Equivalent of originalSymbolsForFeature() call
* extended to support renderers that may use more symbols per feature - similar to symbolsForFeature()
* @note added in 2.12
* @note available in Python bindings as originalSymbolsForFeature2
*/
//TODO - QGIS 3.0 change PyName to symbolsForFeature when deprecated method is removed
virtual QgsSymbolList originalSymbolsForFeature( QgsFeature& feat, QgsRenderContext& context ) /PyName=originalSymbolsForFeature2/;
* @note added in 2.12 */
virtual QgsSymbolList originalSymbolsForFeature( QgsFeature& feat, QgsRenderContext& context );

/** Allows for a renderer to modify the extent of a feature request prior to rendering
* @param extent reference to request's filter extent. Modify extent to change the
@@ -443,12 +372,6 @@ class QgsFeatureRenderer
*/
void copyRendererData( QgsFeatureRenderer *destRenderer ) const;

/** Copies paint effect of this renderer to another renderer
* @param destRenderer destination renderer for copied effect
* @deprecated use copyRendererData instead
*/
void copyPaintEffect( QgsFeatureRenderer *destRenderer ) const /Deprecated/;

/** @note this function is used to convert old sizeScale expresssions to symbol
* level DataDefined size
*/

0 comments on commit a921c19

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