@@ -65,15 +65,32 @@ class QgsFeatureRendererV2
6565 * @param feature feature
6666 * @return returns pointer to symbol or 0 if symbol was not found
6767 */
68- virtual QgsSymbolV2* symbolForFeature( QgsFeature& feature ) = 0;
68+ virtual QgsSymbolV2* symbolForFeature( QgsFeature& feature ) /Deprecated/;
69+
70+ /** To be overridden
71+ * @param feature feature
72+ * @param context render context
73+ * @return returns pointer to symbol or 0 if symbol was not found
74+ * @note added in QGIS 2.12
75+ */
76+ //TODO - make pure virtual when above method is removed
77+ virtual QgsSymbolV2* symbolForFeature( QgsFeature& feature, QgsRenderContext& context );
6978
7079 /**
7180 * Return symbol for feature. The difference compared to symbolForFeature() is that it returns original
7281 * symbol which can be used as an identifier for renderer's rule - the former may return a temporary replacement
7382 * of a symbol for use in rendering.
7483 * @note added in 2.6
7584 */
76- virtual QgsSymbolV2* originalSymbolForFeature( QgsFeature& feature );
85+ virtual QgsSymbolV2* originalSymbolForFeature( QgsFeature& feature ) /Deprecated/;
86+
87+ /**
88+ * Return symbol for feature. The difference compared to symbolForFeature() is that it returns original
89+ * symbol which can be used as an identifier for renderer's rule - the former may return a temporary replacement
90+ * of a symbol for use in rendering.
91+ * @note added in 2.12
92+ */
93+ virtual QgsSymbolV2* originalSymbolForFeature( QgsFeature& feature, QgsRenderContext& context );
7794
7895 virtual void startRender( QgsRenderContext& context, const QgsFields& fields ) = 0;
7996
@@ -108,7 +125,7 @@ class QgsFeatureRendererV2
108125 virtual int capabilities();
109126
110127 //! for symbol levels
111- virtual QgsSymbolV2List symbols() = 0;
128+ virtual QgsSymbolV2List symbols( QgsRenderContext& context ) = 0;
112129
113130 bool usingSymbolLevels() const;
114131 void setUsingSymbolLevels( bool usingSymbolLevels );
@@ -180,17 +197,34 @@ class QgsFeatureRendererV2
180197 //! return whether the renderer will render a feature or not.
181198 //! Must be called between startRender() and stopRender() calls.
182199 //! Default implementation uses symbolForFeature().
183- virtual bool willRenderFeature( QgsFeature& feat );
200+ virtual bool willRenderFeature( QgsFeature& feat ) /Deprecated/;
201+
202+ /** Returns whether the renderer will render a feature or not.
203+ * Must be called between startRender() and stopRender() calls.
204+ * Default implementation uses symbolForFeature().
205+ * @note added in QGIS 2.12
206+ */
207+ virtual bool willRenderFeature( QgsFeature& feat, QgsRenderContext& context );
208+
209+ //! return list of symbols used for rendering the feature.
210+ //! For renderers that do not support MoreSymbolsPerFeature it is more efficient
211+ //! to use symbolForFeature()
212+ virtual QgsSymbolV2List symbolsForFeature( QgsFeature& feat ) /Deprecated/;
184213
185214 //! return list of symbols used for rendering the feature.
186215 //! For renderers that do not support MoreSymbolsPerFeature it is more efficient
187216 //! to use symbolForFeature()
188- virtual QgsSymbolV2List symbolsForFeature( QgsFeature& feat );
217+ virtual QgsSymbolV2List symbolsForFeature( QgsFeature& feat, QgsRenderContext& context );
218+
219+ //! Equivalent of originalSymbolsForFeature() call
220+ //! extended to support renderers that may use more symbols per feature - similar to symbolsForFeature()
221+ //! @note added in 2.6
222+ virtual QgsSymbolV2List originalSymbolsForFeature( QgsFeature& feat ) /Deprecated/;
189223
190224 //! Equivalent of originalSymbolsForFeature() call
191225 //! extended to support renderers that may use more symbols per feature - similar to symbolsForFeature()
192226 //! @note added in 2.6
193- virtual QgsSymbolV2List originalSymbolsForFeature( QgsFeature& feat );
227+ virtual QgsSymbolV2List originalSymbolsForFeature( QgsFeature& feat, QgsRenderContext& context );
194228
195229 /** Allows for a renderer to modify the extent of a feature request prior to rendering
196230 * @param extent reference to request's filter extent. Modify extent to change the
0 commit comments