|
24 | 24 | #include "qgsmaptopixel.h" |
25 | 25 | #include "qgsrectangle.h" |
26 | 26 | #include "qgsvectorsimplifymethod.h" |
| 27 | +#include "qgsexpressioncontext.h" |
27 | 28 |
|
28 | 29 | class QPainter; |
29 | 30 |
|
@@ -118,6 +119,27 @@ class CORE_EXPORT QgsRenderContext |
118 | 119 | const QgsVectorSimplifyMethod& vectorSimplifyMethod() const { return mVectorSimplifyMethod; } |
119 | 120 | void setVectorSimplifyMethod( const QgsVectorSimplifyMethod& simplifyMethod ) { mVectorSimplifyMethod = simplifyMethod; } |
120 | 121 |
|
| 122 | + /** Sets the expression context. This context is used for all expression evaluation |
| 123 | + * associated with this render context. |
| 124 | + * @see expressionContext() |
| 125 | + * @note added in QGIS 2.12 |
| 126 | + */ |
| 127 | + void setExpressionContext( const QgsExpressionContext& context ) { mExpressionContext = context; } |
| 128 | + |
| 129 | + /** Gets the expression context. This context should be used for all expression evaluation |
| 130 | + * associated with this render context. |
| 131 | + * @see setExpressionContext() |
| 132 | + * @note added in QGIS 2.12 |
| 133 | + */ |
| 134 | + QgsExpressionContext& expressionContext() { return mExpressionContext; } |
| 135 | + |
| 136 | + /** Gets the expression context (const version). This context should be used for all expression evaluation |
| 137 | + * associated with this render context. |
| 138 | + * @see setExpressionContext() |
| 139 | + * @note added in QGIS 2.12 |
| 140 | + */ |
| 141 | + const QgsExpressionContext& expressionContext() const { return mExpressionContext; } |
| 142 | + |
121 | 143 | private: |
122 | 144 |
|
123 | 145 | /** Painter for rendering operations*/ |
@@ -165,6 +187,9 @@ class CORE_EXPORT QgsRenderContext |
165 | 187 |
|
166 | 188 | /** Simplification object which holds the information about how to simplify the features for fast rendering */ |
167 | 189 | QgsVectorSimplifyMethod mVectorSimplifyMethod; |
| 190 | + |
| 191 | + /** Expression context */ |
| 192 | + QgsExpressionContext mExpressionContext; |
168 | 193 | }; |
169 | 194 |
|
170 | 195 | #endif |
0 commit comments