QGIS API Documentation 3.38.0-Grenoble (exported)
|
#include <qgssymbolrendercontext.h>
Public Member Functions | |
QgsSymbolRenderContext (const QgsSymbolRenderContext &rh)=delete | |
QgsSymbolRenderContext cannot be copied. | |
QgsSymbolRenderContext (QgsRenderContext &c, Qgis::RenderUnit u, qreal opacity=1.0, bool selected=false, Qgis::SymbolRenderHints renderHints=Qgis::SymbolRenderHints(), const QgsFeature *f=nullptr, const QgsFields &fields=QgsFields(), const QgsMapUnitScale &mapUnitScale=QgsMapUnitScale()) | |
Constructor for QgsSymbolRenderContext. | |
~QgsSymbolRenderContext () | |
QgsExpressionContextScope * | expressionContextScope () |
This scope is always available when a symbol of this type is being rendered. | |
const QgsFeature * | feature () const |
Returns the current feature being rendered. | |
QgsFields | fields () const |
Fields of the layer. | |
int | geometryPartCount () const |
Part count of current geometry. | |
int | geometryPartNum () const |
Part number of current geometry. | |
Q_DECL_DEPRECATED QgsMapUnitScale | mapUnitScale () const |
qreal | opacity () const |
Returns the opacity for the symbol. | |
QgsSymbolRenderContext & | operator= (const QgsSymbolRenderContext &) |
Qgis::GeometryType | originalGeometryType () const |
Returns the geometry type for the original feature geometry being rendered. | |
Q_DECL_DEPRECATED double | outputLineWidth (double width) const |
Q_DECL_DEPRECATED double | outputPixelSize (double size) const |
Q_DECL_DEPRECATED Qgis::RenderUnit | outputUnit () const |
Returns the output unit for the context. | |
const QgsLegendPatchShape * | patchShape () const |
Returns the symbol patch shape, to use if rendering symbol preview icons. | |
QgsRenderContext & | renderContext () |
Returns a reference to the context's render context. | |
const QgsRenderContext & | renderContext () const |
Returns a reference to the context's render context. | |
Qgis::SymbolRenderHints | renderHints () const |
Returns the rendering hint flags for the symbol. | |
bool | selected () const |
Returns true if symbols should be rendered using the selected symbol coloring and style. | |
void | setExpressionContextScope (QgsExpressionContextScope *contextScope) |
Set an expression scope for this symbol. | |
void | setFeature (const QgsFeature *f) |
void | setGeometryPartCount (int count) |
Sets the part count of current geometry. | |
void | setGeometryPartNum (int num) |
Sets the part number of current geometry. | |
Q_DECL_DEPRECATED void | setMapUnitScale (const QgsMapUnitScale &scale) |
void | setOpacity (qreal opacity) |
Sets the opacity for the symbol. | |
void | setOriginalGeometryType (Qgis::GeometryType type) |
Sets the geometry type for the original feature geometry being rendered. | |
void | setOriginalValueVariable (const QVariant &value) |
Sets the original value variable value for data defined symbology. | |
Q_DECL_DEPRECATED void | setOutputUnit (Qgis::RenderUnit u) |
Sets the output unit for the context. | |
void | setPatchShape (const QgsLegendPatchShape &shape) |
Sets the symbol patch shape, to use if rendering symbol preview icons. | |
void | setRenderHints (Qgis::SymbolRenderHints hints) |
Sets rendering hint flags for the symbol. | |
void | setSelected (bool selected) |
Sets whether symbols should be rendered using the selected symbol coloring and style. | |
Definition at line 33 of file qgssymbolrendercontext.h.
QgsSymbolRenderContext::QgsSymbolRenderContext | ( | QgsRenderContext & | c, |
Qgis::RenderUnit | u, | ||
qreal | opacity = 1.0 , |
||
bool | selected = false , |
||
Qgis::SymbolRenderHints | renderHints = Qgis::SymbolRenderHints() , |
||
const QgsFeature * | f = nullptr , |
||
const QgsFields & | fields = QgsFields() , |
||
const QgsMapUnitScale & | mapUnitScale = QgsMapUnitScale() |
||
) |
Constructor for QgsSymbolRenderContext.
c | |
u | |
opacity | value between 0 (fully transparent) and 1 (fully opaque) |
selected | set to true if symbol should be drawn in a "selected" state |
renderHints | flags controlling rendering behavior |
f | |
fields | |
mapUnitScale |
Definition at line 20 of file qgssymbolrendercontext.cpp.
|
default |
|
delete |
QgsSymbolRenderContext cannot be copied.
QgsExpressionContextScope * QgsSymbolRenderContext::expressionContextScope | ( | ) |
This scope is always available when a symbol of this type is being rendered.
Definition at line 62 of file qgssymbolrendercontext.cpp.
|
inline |
Returns the current feature being rendered.
This may be nullptr
.
Definition at line 140 of file qgssymbolrendercontext.h.
|
inline |
Fields of the layer.
Currently only available in startRender() calls to allow symbols with data-defined properties prepare the expressions (other times fields() returns an empty QgsFields object).
Definition at line 162 of file qgssymbolrendercontext.h.
|
inline |
Part count of current geometry.
Definition at line 167 of file qgssymbolrendercontext.h.
|
inline |
Part number of current geometry.
Definition at line 177 of file qgssymbolrendercontext.h.
|
inline |
Definition at line 90 of file qgssymbolrendercontext.h.
|
inline |
Returns the opacity for the symbol.
Definition at line 102 of file qgssymbolrendercontext.h.
QgsSymbolRenderContext & QgsSymbolRenderContext::operator= | ( | const QgsSymbolRenderContext & | ) |
Definition at line 52 of file qgssymbolrendercontext.cpp.
|
inline |
Returns the geometry type for the original feature geometry being rendered.
This can be useful if symbol layers alter their appearance based on geometry type - eg offsetting a simple line style will look different if the simple line is rendering a polygon feature (a closed buffer) vs a line feature (an unclosed offset line).
Definition at line 155 of file qgssymbolrendercontext.h.
double QgsSymbolRenderContext::outputLineWidth | ( | double | width | ) | const |
Definition at line 41 of file qgssymbolrendercontext.cpp.
double QgsSymbolRenderContext::outputPixelSize | ( | double | size | ) | const |
Definition at line 46 of file qgssymbolrendercontext.cpp.
|
inline |
Returns the output unit for the context.
Definition at line 79 of file qgssymbolrendercontext.h.
const QgsLegendPatchShape * QgsSymbolRenderContext::patchShape | ( | ) | const |
Returns the symbol patch shape, to use if rendering symbol preview icons.
Definition at line 72 of file qgssymbolrendercontext.cpp.
|
inline |
Returns a reference to the context's render context.
Definition at line 60 of file qgssymbolrendercontext.h.
|
inline |
Returns a reference to the context's render context.
Definition at line 66 of file qgssymbolrendercontext.h.
|
inline |
Returns the rendering hint flags for the symbol.
Definition at line 127 of file qgssymbolrendercontext.h.
|
inline |
Returns true
if symbols should be rendered using the selected symbol coloring and style.
Definition at line 115 of file qgssymbolrendercontext.h.
void QgsSymbolRenderContext::setExpressionContextScope | ( | QgsExpressionContextScope * | contextScope | ) |
Set an expression scope for this symbol.
Will take ownership.
contextScope | An expression scope for details about this symbol |
Definition at line 67 of file qgssymbolrendercontext.cpp.
|
inline |
Definition at line 135 of file qgssymbolrendercontext.h.
|
inline |
Sets the part count of current geometry.
Definition at line 172 of file qgssymbolrendercontext.h.
|
inline |
Sets the part number of current geometry.
Definition at line 182 of file qgssymbolrendercontext.h.
|
inline |
Definition at line 95 of file qgssymbolrendercontext.h.
|
inline |
Sets the opacity for the symbol.
opacity | opacity value between 0 (fully transparent) and 1 (fully opaque) |
Definition at line 109 of file qgssymbolrendercontext.h.
|
inline |
Sets the geometry type for the original feature geometry being rendered.
Definition at line 146 of file qgssymbolrendercontext.h.
void QgsSymbolRenderContext::setOriginalValueVariable | ( | const QVariant & | value | ) |
Sets the original value variable value for data defined symbology.
value | value for original value variable. This usually represents the symbol property value before any data defined overrides have been applied. |
Definition at line 36 of file qgssymbolrendercontext.cpp.
|
inline |
Sets the output unit for the context.
Definition at line 85 of file qgssymbolrendercontext.h.
void QgsSymbolRenderContext::setPatchShape | ( | const QgsLegendPatchShape & | shape | ) |
Sets the symbol patch shape, to use if rendering symbol preview icons.
Definition at line 77 of file qgssymbolrendercontext.cpp.
|
inline |
Sets rendering hint flags for the symbol.
Definition at line 133 of file qgssymbolrendercontext.h.
|
inline |
Sets whether symbols should be rendered using the selected symbol coloring and style.
Definition at line 121 of file qgssymbolrendercontext.h.