diff --git a/python/core/symbology-ng/qgscategorizedsymbolrendererv2.sip b/python/core/symbology-ng/qgscategorizedsymbolrendererv2.sip index 8c5ec00e1e4..036b04c3016 100644 --- a/python/core/symbology-ng/qgscategorizedsymbolrendererv2.sip +++ b/python/core/symbology-ng/qgscategorizedsymbolrendererv2.sip @@ -45,9 +45,9 @@ class QgsCategorizedSymbolRendererV2 : QgsFeatureRendererV2 virtual ~QgsCategorizedSymbolRendererV2(); - virtual QgsSymbolV2* symbolForFeature( QgsFeature& feature, QgsRenderContext& context ); + virtual QgsSymbolV2* symbolForFeature( QgsFeature& feature, QgsRenderContext& context ) /PyName=symbolForFeature2/; - virtual QgsSymbolV2* originalSymbolForFeature( QgsFeature& feature, QgsRenderContext& context ); + virtual QgsSymbolV2* originalSymbolForFeature( QgsFeature& feature, QgsRenderContext& context ) /PyName=originalSymbolForFeature2/; virtual void startRender( QgsRenderContext& context, const QgsFields& fields ); @@ -64,7 +64,7 @@ class QgsCategorizedSymbolRendererV2 : QgsFeatureRendererV2 //! returns bitwise OR-ed capabilities of the renderer virtual int capabilities(); - virtual QgsSymbolV2List symbols( QgsRenderContext& context ); + virtual QgsSymbolV2List symbols( QgsRenderContext& context ) /PyName=symbols2/; void updateSymbols( QgsSymbolV2 * sym ); const QgsCategoryList& categories() const; diff --git a/python/core/symbology-ng/qgsgraduatedsymbolrendererv2.sip b/python/core/symbology-ng/qgsgraduatedsymbolrendererv2.sip index 234a30947d8..c1a36645622 100644 --- a/python/core/symbology-ng/qgsgraduatedsymbolrendererv2.sip +++ b/python/core/symbology-ng/qgsgraduatedsymbolrendererv2.sip @@ -87,9 +87,9 @@ class QgsGraduatedSymbolRendererV2 : QgsFeatureRendererV2 virtual ~QgsGraduatedSymbolRendererV2(); - virtual QgsSymbolV2* symbolForFeature( QgsFeature& feature, QgsRenderContext& context ); + virtual QgsSymbolV2* symbolForFeature( QgsFeature& feature, QgsRenderContext& context ) /PyName=symbolForFeature2/; - virtual QgsSymbolV2* originalSymbolForFeature( QgsFeature& feature, QgsRenderContext& context ); + virtual QgsSymbolV2* originalSymbolForFeature( QgsFeature& feature, QgsRenderContext& context ) /PyName=originalSymbolForFeature2/; virtual void startRender( QgsRenderContext& context, const QgsFields& fields ); @@ -106,7 +106,7 @@ class QgsGraduatedSymbolRendererV2 : QgsFeatureRendererV2 //! returns bitwise OR-ed capabilities of the renderer virtual int capabilities(); - virtual QgsSymbolV2List symbols( QgsRenderContext& context ); + virtual QgsSymbolV2List symbols( QgsRenderContext& context ) /PyName=symbols2/; QString classAttribute() const; void setClassAttribute( const QString& attr ); diff --git a/python/core/symbology-ng/qgsheatmaprenderer.sip b/python/core/symbology-ng/qgsheatmaprenderer.sip index a15b993213f..b3549c1f44e 100644 --- a/python/core/symbology-ng/qgsheatmaprenderer.sip +++ b/python/core/symbology-ng/qgsheatmaprenderer.sip @@ -13,8 +13,8 @@ class QgsHeatmapRenderer : QgsFeatureRendererV2 virtual void startRender( QgsRenderContext& context, const QgsFields& fields ); virtual bool renderFeature( QgsFeature& feature, QgsRenderContext& context, int layer = -1, bool selected = false, bool drawVertexMarker = false ); virtual void stopRender( QgsRenderContext& context ); - virtual QgsSymbolV2* symbolForFeature( QgsFeature& feature, QgsRenderContext& context ); - virtual QgsSymbolV2List symbols( QgsRenderContext& context ); + virtual QgsSymbolV2* symbolForFeature( QgsFeature& feature, QgsRenderContext& context ) /PyName=symbolForFeature2/; + virtual QgsSymbolV2List symbols( QgsRenderContext& context ) /PyName=symbols2/; virtual QString dump() const; virtual QList usedAttributes(); static QgsFeatureRendererV2* create( QDomElement& element ) /Factory/; diff --git a/python/core/symbology-ng/qgsinvertedpolygonrenderer.sip b/python/core/symbology-ng/qgsinvertedpolygonrenderer.sip index 45e6087b0aa..ab98cc8c857 100644 --- a/python/core/symbology-ng/qgsinvertedpolygonrenderer.sip +++ b/python/core/symbology-ng/qgsinvertedpolygonrenderer.sip @@ -41,15 +41,15 @@ class QgsInvertedPolygonRenderer : QgsFeatureRendererV2 /** Proxy that will call this method on the embedded renderer. */ virtual int capabilities(); /** Proxy that will call this method on the embedded renderer. */ - virtual QgsSymbolV2List symbols( QgsRenderContext& context ); + virtual QgsSymbolV2List symbols( QgsRenderContext& context ) /PyName=symbols2/; /** Proxy that will call this method on the embedded renderer. */ - virtual QgsSymbolV2* symbolForFeature( QgsFeature& feature, QgsRenderContext& context ); + virtual QgsSymbolV2* symbolForFeature( QgsFeature& feature, QgsRenderContext& context ) /PyName=symbolForFeature2/; /** Proxy that will call this method on the embedded renderer. */ - virtual QgsSymbolV2* originalSymbolForFeature( QgsFeature& feat, QgsRenderContext& context ); + virtual QgsSymbolV2* originalSymbolForFeature( QgsFeature& feat, QgsRenderContext& context ) /PyName=originalSymbolForFeature2/; /** Proxy that will call this method on the embedded renderer. */ - virtual QgsSymbolV2List symbolsForFeature( QgsFeature& feat, QgsRenderContext& context ); + virtual QgsSymbolV2List symbolsForFeature( QgsFeature& feat, QgsRenderContext& context ) /PyName=symbolsForFeature/; /** Proxy that will call this method on the embedded renderer. */ - virtual QgsSymbolV2List originalSymbolsForFeature( QgsFeature& feat, QgsRenderContext& context ); + virtual QgsSymbolV2List originalSymbolsForFeature( QgsFeature& feat, QgsRenderContext& context ) /PyName=originalSymbolsForFeature2/; /** 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. @@ -57,7 +57,7 @@ class QgsInvertedPolygonRenderer : QgsFeatureRendererV2 */ // virtual QgsLegendSymbolList legendSymbolItems( double scaleDenominator = -1, const QString& rule = "" ); /** Proxy that will call this method on the embedded renderer. */ - virtual bool willRenderFeature( QgsFeature& feat, QgsRenderContext& context ); + virtual bool willRenderFeature( QgsFeature& feat, QgsRenderContext& context ) /PyName=willRenderFeature2/; /** Creates a renderer out of an XML, for loading*/ static QgsFeatureRendererV2* create( QDomElement& element ) /Factory/; diff --git a/python/core/symbology-ng/qgspointdisplacementrenderer.sip b/python/core/symbology-ng/qgspointdisplacementrenderer.sip index f9cabf9584b..bf70fe5683a 100644 --- a/python/core/symbology-ng/qgspointdisplacementrenderer.sip +++ b/python/core/symbology-ng/qgspointdisplacementrenderer.sip @@ -28,17 +28,17 @@ class QgsPointDisplacementRenderer : QgsFeatureRendererV2 /** Proxy that will call this method on the embedded renderer. */ virtual int capabilities(); /** Proxy that will call this method on the embedded renderer. */ - virtual QgsSymbolV2List symbols( QgsRenderContext& context ); + virtual QgsSymbolV2List symbols( QgsRenderContext& context ) /PyName=symbols2/; /** Proxy that will call this method on the embedded renderer. */ - virtual QgsSymbolV2* symbolForFeature( QgsFeature& feature, QgsRenderContext& context ); + virtual QgsSymbolV2* symbolForFeature( QgsFeature& feature, QgsRenderContext& context ) /PyName=symbolForFeature2/; /** Proxy that will call this method on the embedded renderer. */ - virtual QgsSymbolV2* originalSymbolForFeature( QgsFeature& feat, QgsRenderContext& context ); + virtual QgsSymbolV2* originalSymbolForFeature( QgsFeature& feat, QgsRenderContext& context ) /PyName=originalSymbolForFeature2/; /** Proxy that will call this method on the embedded renderer. */ - virtual QgsSymbolV2List symbolsForFeature( QgsFeature& feat, QgsRenderContext& context ); + virtual QgsSymbolV2List symbolsForFeature( QgsFeature& feat, QgsRenderContext& context ) /PyName=symbolsForFeature2/; /** Proxy that will call this method on the embedded renderer. */ - virtual QgsSymbolV2List originalSymbolsForFeature( QgsFeature& feat, QgsRenderContext& context ); + virtual QgsSymbolV2List originalSymbolsForFeature( QgsFeature& feat, QgsRenderContext& context ) /PyName=originalSymbolsForFeature2/; /** Proxy that will call this method on the embedded renderer. */ - virtual bool willRenderFeature( QgsFeature& feat, QgsRenderContext& context ); + virtual bool willRenderFeature( QgsFeature& feat, QgsRenderContext& context ) /PyName=willRenderFeature2/; virtual void startRender( QgsRenderContext& context, const QgsFields& fields ); diff --git a/python/core/symbology-ng/qgsrendererv2.sip b/python/core/symbology-ng/qgsrendererv2.sip index 4a31a1a5ec3..5cf341de461 100644 --- a/python/core/symbology-ng/qgsrendererv2.sip +++ b/python/core/symbology-ng/qgsrendererv2.sip @@ -72,9 +72,10 @@ class QgsFeatureRendererV2 * @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 - make pure virtual when above method is removed - virtual QgsSymbolV2* symbolForFeature( QgsFeature& feature, QgsRenderContext& context ); + //TODO - QGIS 3.0 change PyName to symbolForFeature when deprecated method is removed + virtual QgsSymbolV2* symbolForFeature( QgsFeature& feature, QgsRenderContext& context ) /PyName=symbolForFeature2/; /** * Return symbol for feature. The difference compared to symbolForFeature() is that it returns original @@ -89,8 +90,10 @@ class QgsFeatureRendererV2 * 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 */ - virtual QgsSymbolV2* originalSymbolForFeature( QgsFeature& feature, QgsRenderContext& context ); + //TODO - QGIS 3.0 change PyName to originalSymbolForFeature when deprecated method is removed + virtual QgsSymbolV2* originalSymbolForFeature( QgsFeature& feature, QgsRenderContext& context ) /PyName=originalSymbolForFeature2/; virtual void startRender( QgsRenderContext& context, const QgsFields& fields ) = 0; @@ -130,8 +133,10 @@ class QgsFeatureRendererV2 /** 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 */ - virtual QgsSymbolV2List symbols( QgsRenderContext& context ); + //TODO - QGIS 3.0 change PyName to symbols when deprecated method is removed + virtual QgsSymbolV2List symbols( QgsRenderContext& context ) /PyName=symbols2/; bool usingSymbolLevels() const; void setUsingSymbolLevels( bool usingSymbolLevels ); @@ -209,28 +214,37 @@ class QgsFeatureRendererV2 * 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 */ - virtual bool willRenderFeature( QgsFeature& feat, QgsRenderContext& context ); + //TODO - QGIS 3.0 change PyName to willRenderFeature when deprecated method is removed + virtual bool willRenderFeature( QgsFeature& feat, QgsRenderContext& context ) /PyName=willRenderFeature2/; //! return list of symbols used for rendering the feature. //! For renderers that do not support MoreSymbolsPerFeature it is more efficient //! to use symbolForFeature() virtual QgsSymbolV2List symbolsForFeature( QgsFeature& feat ) /Deprecated/; - //! return list of symbols used for rendering the feature. - //! For renderers that do not support MoreSymbolsPerFeature it is more efficient - //! to use symbolForFeature() - virtual QgsSymbolV2List symbolsForFeature( 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 QgsSymbolV2List symbolsForFeature( QgsFeature& feat, QgsRenderContext& context ) /PyName=symbolsForFeature2/; //! Equivalent of originalSymbolsForFeature() call //! extended to support renderers that may use more symbols per feature - similar to symbolsForFeature() //! @note added in 2.6 virtual QgsSymbolV2List 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.6 - virtual QgsSymbolV2List originalSymbolsForFeature( 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.12 + * @note available in Python bindings as originalSymbolsForFeature2 + */ + //TODO - QGIS 3.0 change PyName to symbolsForFeature when deprecated method is removed + virtual QgsSymbolV2List originalSymbolsForFeature( QgsFeature& feat, QgsRenderContext& context ) /PyName=originalSymbolsForFeature2/; /** 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 diff --git a/python/core/symbology-ng/qgsrulebasedrendererv2.sip b/python/core/symbology-ng/qgsrulebasedrendererv2.sip index 95422d2a465..6efc0ae80d1 100644 --- a/python/core/symbology-ng/qgsrulebasedrendererv2.sip +++ b/python/core/symbology-ng/qgsrulebasedrendererv2.sip @@ -67,7 +67,7 @@ class QgsRuleBasedRendererV2 : QgsFeatureRendererV2 ~Rule(); QString dump( int offset = 0 ) const; QSet usedAttributes(); - QgsSymbolV2List symbols( const QgsRenderContext& context = QgsRenderContext() ); + QgsSymbolV2List symbols( const QgsRenderContext& context = QgsRenderContext() ) /PyName=symbols2/; //! @note not available in python bindings // QgsLegendSymbolList legendSymbolItems(); //! @note added in 2.6 diff --git a/python/core/symbology-ng/qgssinglesymbolrendererv2.sip b/python/core/symbology-ng/qgssinglesymbolrendererv2.sip index dadc4fbc97c..9cc8b063bb2 100644 --- a/python/core/symbology-ng/qgssinglesymbolrendererv2.sip +++ b/python/core/symbology-ng/qgssinglesymbolrendererv2.sip @@ -9,9 +9,9 @@ class QgsSingleSymbolRendererV2 : QgsFeatureRendererV2 virtual ~QgsSingleSymbolRendererV2(); - virtual QgsSymbolV2* symbolForFeature( QgsFeature& feature, QgsRenderContext& context ); + virtual QgsSymbolV2* symbolForFeature( QgsFeature& feature, QgsRenderContext& context ) /PyName=symbolForFeature2/; - virtual QgsSymbolV2* originalSymbolForFeature( QgsFeature& feature, QgsRenderContext& context ); + virtual QgsSymbolV2* originalSymbolForFeature( QgsFeature& feature, QgsRenderContext& context ) /PyName=originalSymbolForFeature2/; virtual void startRender( QgsRenderContext& context, const QgsFields& fields ); @@ -41,7 +41,7 @@ class QgsSingleSymbolRendererV2 : QgsFeatureRendererV2 //! returns bitwise OR-ed capabilities of the renderer virtual int capabilities(); - virtual QgsSymbolV2List symbols( QgsRenderContext& context ); + virtual QgsSymbolV2List symbols( QgsRenderContext& context ) /PyName=symbols2/; //! create renderer from XML element static QgsFeatureRendererV2* create( QDomElement& element ) /Factory/; diff --git a/src/core/symbology-ng/qgsrendererv2.h b/src/core/symbology-ng/qgsrendererv2.h index 295af35aa17..5a9ede6cdb7 100644 --- a/src/core/symbology-ng/qgsrendererv2.h +++ b/src/core/symbology-ng/qgsrendererv2.h @@ -92,8 +92,10 @@ class CORE_EXPORT QgsFeatureRendererV2 * @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 - make pure virtual when above method is removed + //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 QgsSymbolV2* symbolForFeature( QgsFeature& feature, QgsRenderContext& context ); /** @@ -109,7 +111,9 @@ class CORE_EXPORT QgsFeatureRendererV2 * 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 QgsSymbolV2* originalSymbolForFeature( QgsFeature& feature, QgsRenderContext& context ); /** @@ -168,7 +172,9 @@ class CORE_EXPORT QgsFeatureRendererV2 /** 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 QgsSymbolV2List symbols( QgsRenderContext& context ); bool usingSymbolLevels() const { return mUsingSymbolLevels; } @@ -251,7 +257,9 @@ class CORE_EXPORT QgsFeatureRendererV2 * 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 ); //! return list of symbols used for rendering the feature. @@ -259,9 +267,13 @@ class CORE_EXPORT QgsFeatureRendererV2 //! to use symbolForFeature() Q_DECL_DEPRECATED virtual QgsSymbolV2List symbolsForFeature( QgsFeature& feat ); - //! return list of symbols used for rendering the feature. - //! For renderers that do not support MoreSymbolsPerFeature it is more efficient - //! to use symbolForFeature() + /** 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 QgsSymbolV2List symbolsForFeature( QgsFeature& feat, QgsRenderContext& context ); //! Equivalent of originalSymbolsForFeature() call @@ -269,9 +281,12 @@ class CORE_EXPORT QgsFeatureRendererV2 //! @note added in 2.6 Q_DECL_DEPRECATED virtual QgsSymbolV2List originalSymbolsForFeature( QgsFeature& feat ); - //! Equivalent of originalSymbolsForFeature() call - //! extended to support renderers that may use more symbols per feature - similar to symbolsForFeature() - //! @note added in 2.6 + /** 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 QgsSymbolV2List originalSymbolsForFeature( QgsFeature& feat, QgsRenderContext& context ); /** Allows for a renderer to modify the extent of a feature request prior to rendering diff --git a/tests/src/python/test_qgsgraduatedsymbolrendererv2.py b/tests/src/python/test_qgsgraduatedsymbolrendererv2.py index 0ebdb80791c..019841574a2 100644 --- a/tests/src/python/test_qgsgraduatedsymbolrendererv2.py +++ b/tests/src/python/test_qgsgraduatedsymbolrendererv2.py @@ -356,7 +356,7 @@ class TestQgsGraduatedSymbolRendererV2(TestCase): self.assertEqual(renderer.minSymbolSize(), 2) refSizes = [2, (13 + 2) * .5, 13] ctx = QgsRenderContext() - for idx, symbol in enumerate(renderer.symbols(ctx)): + for idx, symbol in enumerate(renderer.symbols2(ctx)): self.assertEqual(symbol.size(), refSizes[idx]) def testQgsGraduatedSymbolRendererV2_2(self):